[codegen/python] - Exclude single word properties from casing tables.
@@ -965,6 +965,11 @@ func recordProperty(prop *schema.Property, snakeCaseToCamelCase, camelCaseToSnak
}
if mapCase {
snakeCaseName := PyName(prop.Name)
+ // If the property is a single word, don't add it to the tables.
+ containsOneUnderscore := strings.Count(snakeCaseName, "_") == 1
+ endsWithUnderscore := strings.HasSuffix(snakeCaseName, "_")
+ singleWordProp := containsOneUnderscore && endsWithUnderscore
+ if !singleWordProp {
if snakeCaseToCamelCase != nil {
snakeCaseToCamelCase[snakeCaseName] = prop.Name
}
@@ -972,6 +977,7 @@ func recordProperty(prop *schema.Property, snakeCaseToCamelCase, camelCaseToSnak
camelCaseToSnakeCase[prop.Name] = snakeCaseName
}
}
+ }
if obj, ok := prop.Type.(*schema.ObjectType); ok {
for _, p := range obj.Properties {
