Merge branch 'swift/enums' of https://github.com/jaz-ah/swagger-codegen into jaz-ah-swift/enums

Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java
This commit is contained in:
wing328 2016-05-19 16:10:47 +08:00
commit a31f78b454
2 changed files with 4510 additions and 1435 deletions

View File

@ -342,7 +342,7 @@ 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)) {
if (isReservedWord(codegenProperty.datatypeWithEnum) || toVarName(name).equals(codegenProperty.datatypeWithEnum)) {
codegenProperty.datatypeWithEnum = codegenProperty.datatypeWithEnum + "Enum";
}
}