Skip to content

Commit 3044563

Browse files
committed
update objc reserved word list to include local variable name in api
methods
1 parent f033f59 commit 3044563

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,24 @@ public ObjcClientCodegen() {
8989
// ref: http://www.tutorialspoint.com/objective_c/objective_c_basic_syntax.htm
9090
reservedWords = new HashSet<String>(
9191
Arrays.asList(
92-
"auto", "else", "long", "switch",
93-
"break", "enum", "register", "typedef",
94-
"case", "extern", "return", "union",
95-
"char", "float", "short", "unsigned",
96-
"const", "for", "signed", "void",
97-
"continue", "goto", "sizeof", "volatile",
98-
"default", "if", "id", "static", "while",
99-
"do", "int", "struct", "_Packed",
100-
"double", "protocol", "interface", "implementation",
101-
"NSObject", "NSInteger", "NSNumber", "CGFloat",
102-
"property", "nonatomic", "retain", "strong",
103-
"weak", "unsafe_unretained", "readwrite", "readonly",
104-
"description"
92+
// local variable names in API methods (endpoints)
93+
"resourcePath", "pathParams", "queryParams", "headerParams",
94+
"responseContentType", "requestContentType", "authSettings",
95+
"formParams", "files", "bodyParam",
96+
// objc reserved words
97+
"auto", "else", "long", "switch",
98+
"break", "enum", "register", "typedef",
99+
"case", "extern", "return", "union",
100+
"char", "float", "short", "unsigned",
101+
"const", "for", "signed", "void",
102+
"continue", "goto", "sizeof", "volatile",
103+
"default", "if", "id", "static", "while",
104+
"do", "int", "struct", "_Packed",
105+
"double", "protocol", "interface", "implementation",
106+
"NSObject", "NSInteger", "NSNumber", "CGFloat",
107+
"property", "nonatomic", "retain", "strong",
108+
"weak", "unsafe_unretained", "readwrite", "readonly",
109+
"description"
105110
));
106111

107112
importMapping = new HashMap<String, String>();

samples/client/petstore/objc/SwaggerClient/SWGPet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Do not edit the class manually.
88
*/
99

10-
#import "SWGTag.h"
1110
#import "SWGCategory.h"
11+
#import "SWGTag.h"
1212

1313

1414
@protocol SWGPet

0 commit comments

Comments
 (0)