forked from loafle/openapi-generator-original
Change model naming
This commit is contained in:
parent
8540ac71c8
commit
24465d2df4
@ -127,7 +127,7 @@ public class SwiftGenerator extends DefaultCodegen implements CodegenConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String escapeReservedWord(String name) {
|
public String escapeReservedWord(String name) {
|
||||||
return "_" + name; // add an underscore to the name
|
return "Swagger" + name; // add an underscore to the name
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -202,6 +202,9 @@ public class SwiftGenerator extends DefaultCodegen implements CodegenConfig {
|
|||||||
codegenProperty.allowableValues.put("values", swiftEnums);
|
codegenProperty.allowableValues.put("values", swiftEnums);
|
||||||
codegenProperty.datatypeWithEnum =
|
codegenProperty.datatypeWithEnum =
|
||||||
StringUtils.left(codegenProperty.datatypeWithEnum, codegenProperty.datatypeWithEnum.length() - "Enum".length());
|
StringUtils.left(codegenProperty.datatypeWithEnum, codegenProperty.datatypeWithEnum.length() - "Enum".length());
|
||||||
|
if (reservedWords.contains(codegenProperty.datatypeWithEnum)) {
|
||||||
|
codegenProperty.datatypeWithEnum = escapeReservedWord(codegenProperty.datatypeWithEnum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return codegenProperty;
|
return codegenProperty;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user