From a3c93a64b47e8f70bce0b415e8c1abe916392bad Mon Sep 17 00:00:00 2001 From: marcotta Date: Sat, 22 Jul 2017 10:27:05 +0200 Subject: [PATCH] [objc] Convert boolean query params to true/false (#6139) (#6142) Change booleans in query parameters from 0/1 to true/false to match Swagger UI behaviour --- .../src/main/resources/objc/api-body.mustache | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache index c9afce2f27a..f083aed1cd7 100644 --- a/modules/swagger-codegen/src/main/resources/objc/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/objc/api-body.mustache @@ -92,7 +92,14 @@ NSInteger k{{classname}}MissingParamErrorCode = 234513; {{#collectionFormat}} queryParams[@"{{baseName}}"] = [[{{classPrefix}}QueryParamCollection alloc] initWithValuesAndFormat: {{paramName}} format: @"{{collectionFormat}}"]; {{/collectionFormat}} - {{^collectionFormat}}queryParams[@"{{baseName}}"] = {{paramName}};{{/collectionFormat}} + {{^collectionFormat}} + {{#isBoolean}} + queryParams[@"{{baseName}}"] = [{{paramName}} isEqual:@(YES)] ? @"true" : @"false"; + {{/isBoolean}} + {{^isBoolean}} + queryParams[@"{{baseName}}"] = {{paramName}}; + {{/isBoolean}} + {{/collectionFormat}} } {{/queryParams}} NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders];