forked from loafle/openapi-generator-original
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
|
// Ensure that the enum type doesn't match a reserved word or
|
||||||
// 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)) {
|
||||||
name.equals(codegenProperty.datatypeWithEnum)) {
|
codegenProperty.datatypeWithEnum = codegenProperty.datatypeWithEnum + "Enum";
|
||||||
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return codegenProperty;
|
return codegenProperty;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user