Skip to content

Commit 1968bea

Browse files
authored
Merge pull request #4221 from wing328/swift_generator
[Swift] add ErrorResponse as reserved word in Swift generators
2 parents 6ad3887 + e7e99eb commit 1968bea

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/Swift3Codegen.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,18 @@ public Swift3Codegen() {
102102
);
103103
reservedWords = new HashSet<>(
104104
Arrays.asList(
105-
"Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject", "Any", "Error", "URL",
106-
"class", "Class", "break", "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", "continue",
107-
"false", "dynamic", "extension", "default", "is", "didSet", "func", "do", "nil", "final", "import", "else",
108-
"self", "get", "init", "fallthrough", "Self", "infix", "internal", "for", "super", "inout", "let", "if",
109-
"true", "lazy", "operator", "in", "COLUMN", "left", "private", "return", "FILE", "mutating", "protocol",
110-
"switch", "FUNCTION", "none", "public", "where", "LINE", "nonmutating", "static", "while", "optional",
111-
"struct", "override", "subscript", "postfix", "typealias", "precedence", "var", "prefix", "Protocol",
112-
"required", "right", "set", "Type", "unowned", "weak")
105+
// name used by swift client
106+
"ErrorResponse",
107+
108+
// swift keywords
109+
"Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject", "Any", "Error", "URL",
110+
"class", "Class", "break", "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", "continue",
111+
"false", "dynamic", "extension", "default", "is", "didSet", "func", "do", "nil", "final", "import", "else",
112+
"self", "get", "init", "fallthrough", "Self", "infix", "internal", "for", "super", "inout", "let", "if",
113+
"true", "lazy", "operator", "in", "COLUMN", "left", "private", "return", "FILE", "mutating", "protocol",
114+
"switch", "FUNCTION", "none", "public", "where", "LINE", "nonmutating", "static", "while", "optional",
115+
"struct", "override", "subscript", "postfix", "typealias", "precedence", "var", "prefix", "Protocol",
116+
"required", "right", "set", "Type", "unowned", "weak")
113117
);
114118

115119
typeMapping = new HashMap<>();

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwiftCodegen.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public SwiftCodegen() {
101101
);
102102
reservedWords = new HashSet<String>(
103103
Arrays.asList(
104+
// name used by swift client
105+
"ErrorResponse",
106+
107+
// swift keywords
104108
"Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject",
105109
"class", "Class", "break", "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", "continue",
106110
"false", "dynamic", "extension", "default", "is", "didSet", "func", "do", "nil", "final", "import", "else",

0 commit comments

Comments
 (0)