forked from loafle/openapi-generator-original
make sure to only escape an enum if the actual final variable name is going to match the enum name - now that we camelCase variable names this cuts down on the amount of enum escaping we have.
This commit is contained in:
parent
c624311cab
commit
b9bbbc6cad
@ -332,7 +332,7 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// the variable name doesn't match the generated enum type or the
|
||||
// Swift compiler will generate an error
|
||||
if (isReservedWord(codegenProperty.datatypeWithEnum) ||
|
||||
name.equals(codegenProperty.datatypeWithEnum)) {
|
||||
toVarName(name).equals(codegenProperty.datatypeWithEnum)) {
|
||||
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user