mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
updated templates to fix petstore build error
This commit is contained in:
parent
e82ecf695d
commit
2ce0049ce4
@ -110,18 +110,25 @@ static NSString * basePath = @"{{basePath}}";
|
||||
}
|
||||
{{/bodyParam}}
|
||||
{{^bodyParam}}
|
||||
bodyDictionary = [[NSMutableArray alloc] init];
|
||||
|
||||
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
|
||||
|
||||
{{#formParams}}{{#notFile}}
|
||||
{{#formParams}}
|
||||
{{#notFile}}
|
||||
formParams[@"{{paramName}}"] = {{paramName}};
|
||||
{{/notFile}}{{#isFile}}
|
||||
requestContentType = @"multipart/form-data";
|
||||
if(bodyDictionary == nil) {
|
||||
bodyDictionary = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[bodyDictionary addObject:{{paramName}}];
|
||||
{{paramName}}.paramName = @"{{baseName}}";
|
||||
{{/isFile}}{{/formParams}}
|
||||
{{/isFile}}
|
||||
if(bodyDictionary == nil) {
|
||||
bodyDictionary = [[NSMutableArray alloc] init];
|
||||
}
|
||||
[bodyDictionary addObject:formParams];
|
||||
{{/formParams}}
|
||||
{{/bodyParam}}
|
||||
|
||||
{{#requiredParamCount}}
|
||||
@ -134,11 +141,26 @@ static NSString * basePath = @"{{basePath}}";
|
||||
|
||||
SWGApiClient* client = [SWGApiClient sharedClientFromPool:basePath];
|
||||
|
||||
{{#returnContainer}}{{>apiBodyResponseWithContainer}}{{/returnContainer}}
|
||||
{{#returnContainer}}
|
||||
// response is in a container
|
||||
{{>apiBodyResponseWithContainer}}{{/returnContainer}}
|
||||
|
||||
{{#returnSimpleType}}
|
||||
{{#returnTypeIsPrimitive}}{{>apiPrimitiveResponse}}{{/returnTypeIsPrimitive}}
|
||||
{{#returnBaseType}}{{>apiNonPrimitiveResponse}}{{/returnBaseType}}
|
||||
// non container response
|
||||
|
||||
{{#returnTypeIsPrimitive}}
|
||||
// primitive response
|
||||
{{>apiPrimitiveResponse}}{{/returnTypeIsPrimitive}}
|
||||
|
||||
{{#returnBaseType}}
|
||||
// complex response
|
||||
{{>apiNonPrimitiveResponse}}{{/returnBaseType}}
|
||||
{{/returnSimpleType}}
|
||||
|
||||
{{^returnSimpleType}}{{^returnContainer}}
|
||||
// it's void
|
||||
{{>voidResponse}}
|
||||
{{/returnContainer}}{{/returnSimpleType}}
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
|
@ -13,12 +13,11 @@
|
||||
{{^returnBaseType}}completionBlock(error);{{/returnBaseType}}
|
||||
return;
|
||||
}
|
||||
{{#returnBaseType}}
|
||||
{{returnBaseType}} *result = nil;
|
||||
{{#returnType}}{{returnType}} result = nil;
|
||||
if (data) {
|
||||
result = [[{{#instantiationType}}NSClassFromString(@"{{{instantiationType}}}") {{/instantiationType}}{{^instantiationType}}{{{returnBaseType}}} {{/instantiationType}} alloc]initWithValues: data];
|
||||
result = [[{{#instantiationType}}NSClassFromString(@"{{{instantiationType}}}") {{/instantiationType}}{{^instantiationType}}{{{returnBaseType}}} {{/instantiationType}} alloc] {{#returnContainer}}{{#isMapContainer}}initWithDictionary{{/isMapContainer}}{{#isListContainer}}initWithValues{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}initWithValues {{/returnContainer}}: data];
|
||||
}
|
||||
{{#returnBaseType}}completionBlock(result , nil);{{/returnBaseType}}
|
||||
{{/returnBaseType}}
|
||||
{{#returnType}}completionBlock(result , nil);{{/returnType}}
|
||||
{{/returnType}}
|
||||
}];
|
||||
{{/returnTypeIsPrimitive}}
|
Loading…
Reference in New Issue
Block a user