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,9 +332,9 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
// the variable name doesn't match the generated enum type or the
|
// the variable name doesn't match the generated enum type or the
|
||||||
// Swift compiler will generate an error
|
// Swift compiler will generate an error
|
||||||
if (isReservedWord(codegenProperty.datatypeWithEnum) ||
|
if (isReservedWord(codegenProperty.datatypeWithEnum) ||
|
||||||
name.equals(codegenProperty.datatypeWithEnum)) {
|
toVarName(name).equals(codegenProperty.datatypeWithEnum)) {
|
||||||
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum);
|
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return codegenProperty;
|
return codegenProperty;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user