mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
[Obj-C] Fixed an issue where NSNumber parameters would cause a crash in multipart/form-data upload endpoints
This commit is contained in:
parent
46f78f2180
commit
1321d5f9a5
@ -115,6 +115,9 @@ static {{classname}}* singletonAPI = nil;
|
||||
NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.defaultHeaders];
|
||||
|
||||
{{#headerParams}}if({{paramName}} != nil)
|
||||
if([{{paramName}} isKindOfClass:[NSNumber class]]){
|
||||
headerParams[@"{{baseName}}"] = [((NSNumber *){{paramName}}) stringValue];
|
||||
}
|
||||
headerParams[@"{{baseName}}"] = {{paramName}};
|
||||
{{/headerParams}}
|
||||
|
||||
@ -148,6 +151,9 @@ static {{classname}}* singletonAPI = nil;
|
||||
{{#formParams}}
|
||||
{{#notFile}}
|
||||
if ({{paramName}}) {
|
||||
if([{{paramName}} isKindOfClass:[NSNumber class]]){
|
||||
formParams[@"{{baseName}}"] = [((NSNumber *){{paramName}}) stringValue];
|
||||
}
|
||||
formParams[@"{{baseName}}"] = {{paramName}};
|
||||
}
|
||||
{{/notFile}}{{#isFile}}
|
||||
|
Loading…
Reference in New Issue
Block a user