-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Milestone
Description
Description
I am currently developing a middleware API and I generate my angular2 client using codegen. I have one call that expects a short array of strings as a query parameter. The current generator will create a call like this:
http://www.foo.bar/somthing?array=value1,value2,value3
My middleware doesn't understand this format and as far as I have researched, it is preferred to use the following format:
http://www.foo.bar/somthing?array=value1&array=value2&array=value3
Swagger-codegen version
2.0.17
Suggest a Fix
I suggest replacing the current template for queryParams with this code:
{{#queryParams}}
if ({{paramName}} !== undefined) {
{{#isListContainer}}
if({{paramName}}){
{{paramName}}.forEach((element) => {
queryParameters.append('{{baseName}}', <any>element);
})
}
{{/isListContainer}}
{{^isListContainer}}
queryParameters.set('{{baseName}}', <any>{{paramName}});
{{/isListContainer}}
}
{{/queryParams}}