[codegen/python] Only add item to map if it doesn't already exist.
@@ -971,13 +971,17 @@ func recordProperty(prop *schema.Property, snakeCaseToCamelCase, camelCaseToSnak
singleWordProp := containsOneUnderscore && endsWithUnderscore
if !singleWordProp {
if snakeCaseToCamelCase != nil {
+ if _, ok := snakeCaseToCamelCase[snakeCaseName]; !ok {
snakeCaseToCamelCase[snakeCaseName] = prop.Name
}
+ }
if camelCaseToSnakeCase != nil {
+ if _, ok := camelCaseToSnakeCase[prop.Name]; !ok {
camelCaseToSnakeCase[prop.Name] = snakeCaseName
}
}
}
+ }
if obj, ok := prop.Type.(*schema.ObjectType); ok {
for _, p := range obj.Properties {
