Change model naming

This commit is contained in:
kubo_takaichi 2015-06-22 19:04:45 +09:00
parent 8540ac71c8
commit 24465d2df4

View File

@ -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;
} }