diff --git a/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs b/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs index 3709e888fdb8..27c05e2fdace 100644 --- a/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs +++ b/AutoRest/Generators/Ruby/Ruby/RubyCodeNamer.cs @@ -283,9 +283,9 @@ private IType NormalizeCompositeType(CompositeType compositeType) foreach (var property in compositeType.Properties) { property.Name = GetPropertyName(property.GetClientName()); - if (property.SerializedName != null) + if (property.SerializedName != null && !property.WasFlattened()) { - property.SerializedName = property.SerializedName.Replace("\\", "\\\\"); + property.SerializedName = property.SerializedName.Replace(".", "\\\\."); } property.Type = NormalizeTypeReference(property.Type); }