forked from loafle/openapi-generator-original
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}}
|
||||||
{{^bodyParam}}
|
{{^bodyParam}}
|
||||||
bodyDictionary = [[NSMutableArray alloc] init];
|
|
||||||
|
|
||||||
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
|
NSMutableDictionary * formParams = [[NSMutableDictionary alloc]init];
|
||||||
|
|
||||||
{{#formParams}}{{#notFile}}
|
{{#formParams}}
|
||||||
|
{{#notFile}}
|
||||||
formParams[@"{{paramName}}"] = {{paramName}};
|
formParams[@"{{paramName}}"] = {{paramName}};
|
||||||
{{/notFile}}{{#isFile}}
|
{{/notFile}}{{#isFile}}
|
||||||
requestContentType = @"multipart/form-data";
|
requestContentType = @"multipart/form-data";
|
||||||
|
if(bodyDictionary == nil) {
|
||||||
|
bodyDictionary = [[NSMutableArray alloc] init];
|
||||||
|
}
|
||||||
[bodyDictionary addObject:{{paramName}}];
|
[bodyDictionary addObject:{{paramName}}];
|
||||||
{{paramName}}.paramName = @"{{baseName}}";
|
{{paramName}}.paramName = @"{{baseName}}";
|
||||||
{{/isFile}}{{/formParams}}
|
{{/isFile}}
|
||||||
|
if(bodyDictionary == nil) {
|
||||||
|
bodyDictionary = [[NSMutableArray alloc] init];
|
||||||
|
}
|
||||||
[bodyDictionary addObject:formParams];
|
[bodyDictionary addObject:formParams];
|
||||||
|
{{/formParams}}
|
||||||
{{/bodyParam}}
|
{{/bodyParam}}
|
||||||
|
|
||||||
{{#requiredParamCount}}
|
{{#requiredParamCount}}
|
||||||
@ -134,11 +141,26 @@ static NSString * basePath = @"{{basePath}}";
|
|||||||
|
|
||||||
SWGApiClient* client = [SWGApiClient sharedClientFromPool:basePath];
|
SWGApiClient* client = [SWGApiClient sharedClientFromPool:basePath];
|
||||||
|
|
||||||
{{#returnContainer}}{{>apiBodyResponseWithContainer}}{{/returnContainer}}
|
{{#returnContainer}}
|
||||||
|
// response is in a container
|
||||||
|
{{>apiBodyResponseWithContainer}}{{/returnContainer}}
|
||||||
|
|
||||||
{{#returnSimpleType}}
|
{{#returnSimpleType}}
|
||||||
{{#returnTypeIsPrimitive}}{{>apiPrimitiveResponse}}{{/returnTypeIsPrimitive}}
|
// non container response
|
||||||
{{#returnBaseType}}{{>apiNonPrimitiveResponse}}{{/returnBaseType}}
|
|
||||||
|
{{#returnTypeIsPrimitive}}
|
||||||
|
// primitive response
|
||||||
|
{{>apiPrimitiveResponse}}{{/returnTypeIsPrimitive}}
|
||||||
|
|
||||||
|
{{#returnBaseType}}
|
||||||
|
// complex response
|
||||||
|
{{>apiNonPrimitiveResponse}}{{/returnBaseType}}
|
||||||
{{/returnSimpleType}}
|
{{/returnSimpleType}}
|
||||||
|
|
||||||
|
{{^returnSimpleType}}{{^returnContainer}}
|
||||||
|
// it's void
|
||||||
|
{{>voidResponse}}
|
||||||
|
{{/returnContainer}}{{/returnSimpleType}}
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
{{^returnBaseType}}completionBlock(error);{{/returnBaseType}}
|
{{^returnBaseType}}completionBlock(error);{{/returnBaseType}}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
{{#returnBaseType}}
|
{{#returnType}}{{returnType}} result = nil;
|
||||||
{{returnBaseType}} *result = nil;
|
|
||||||
if (data) {
|
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}}
|
{{#returnType}}completionBlock(result , nil);{{/returnType}}
|
||||||
{{/returnBaseType}}
|
{{/returnType}}
|
||||||
}];
|
}];
|
||||||
{{/returnTypeIsPrimitive}}
|
{{/returnTypeIsPrimitive}}
|
Loading…
x
Reference in New Issue
Block a user