You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an API resource uses semi-colon to separate query parameters, the generated client code will not concatenate the query parameters correctly.
Instead of https://openapi-typescript-bug.free.mockoapp.net/hello;count=10;start=20 the generated client code will produce https://openapi-typescript-bug.free.mockoapp.net/hello[object Object].
Description
When an API resource uses semi-colon to separate query parameters, the generated client code will not concatenate the query parameters correctly.
Instead of
https://openapi-typescript-bug.free.mockoapp.net/hello;count=10;start=20
the generated client code will producehttps://openapi-typescript-bug.free.mockoapp.net/hello[object Object]
.This is caused by the apis.mustache template file, which generates the following code to concatenate the request parameters:
But since
requestParameters.params
is an object,String
will convert it to[object Object]
.openapi-generator version
6.3.0 / "@openapitools/openapi-generator-cli": "^2.7.0"
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
npm install
npm run generate
to generate the client codenpm run execute
to execute the example queryhttps://openapi-typescript-bug.free.mockoapp.net/hello[object Object]
I have also created a Github workflow that runs the necessary steps to reproduce the issue:
https://github.com/dschu-lab/openapi-typescript-fetch-issue/actions/runs/5620936093/job/15230781491#step:6:9
Related issues/PRs
#569
Suggest a fix
I think we have to update the logic in /main/resources/typescript-fetch/apis.mustache, but not sure which approach to follow / how to differentiate between the different cases.
The text was updated successfully, but these errors were encountered: