mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
Merge pull request #2634 from yonaskolb/swift_enum_type
Append reserved swift enum type with "Enum"
This commit is contained in:
commit
3332692d30
@ -340,10 +340,9 @@ public class SwiftCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
// Ensure that the enum type doesn't match a reserved word or
|
||||
// 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)) {
|
||||
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum);
|
||||
}
|
||||
if (isReservedWord(codegenProperty.datatypeWithEnum) || name.equals(codegenProperty.datatypeWithEnum)) {
|
||||
codegenProperty.datatypeWithEnum = codegenProperty.datatypeWithEnum + "Enum";
|
||||
}
|
||||
}
|
||||
return codegenProperty;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user