swagger-api / swagger-api/swagger-codegen
[TypeScript-Inversify] Wrong variable used when generating collection query params
@gracekarina is already working on this.
Since Apr 22, 2020.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The TypeScript-Inversify code generator generates wrong code for collection query parameters. It iterates over the collection and appends the whole collection itself instead of the current element.
Swagger-codegen version
Using swagger hub.
Suggest a fix/enhancement
Currently in "modules/swagger-codegen/src/main/resources/typescript-inversify/api.service.mustache" on line 66 the code is
{{#isCollectionFormatMulti}}
{{paramName}}.forEach((element) => {
queryParameters.push('{{paramName}}='+encodeURIComponent(String({{paramName}})));
})
{{/isCollectionFormatMulti}}
It should be
{{#isCollectionFormatMulti}}
{{paramName}}.forEach((element) => {
queryParameters.push('{{paramName}}='+encodeURIComponent(String({{element}})));
})
{{/isCollectionFormatMulti}}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.