-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript-axios] doesn't serialize deepObject query params #7564
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
@wamujlb do you have a snippet to work around this? |
i did this on the generated file sed -i "s/localVarQueryParameter\['filter'\] \= filter/localVarQueryParameter\['filter'\] \= JSON.stringify(filter)/g" api.ts |
@tsraza this will not work in my case. API expects something like this:
|
I have made a workaround but I think that it will be good to add it to the generator.
|
Any update on this? |
++, nothing changed |
I've just had a similar problem. Loopback 4 expects filter parameters as serialised JSON. It can be solved in a 'nice' way using template overrides.
I modified the template to serialise any object passed as a parameter to JSON:
@wamujlb - In your case, you could probably add your code to the template. |
In my case I updated the |
FYI since array is not being handled well, i updated based on @wamujlb answer
|
Bug Report Checklist
input:
{day: 20, year: {min: 1990, max: 2000}}
actual output:
?day=20&year
expected output:
?day=20&year[min]=1990&year[max]=2000
Description
I'm using [typescript-axios] api client generator. Some of the properties I pass to it specified as
deepObject
. It looks that it doesn't support this type of args at all. Is there any possible ways to fix it?openapi-generator version
v4.3.1
v5.0.0-beta
OpenAPI declaration file content or url
Generation Details
[typescript-axios] generator
Steps to reproduce
Related issues/PRs
#6075
Suggest a fix
Replace old deprecated url API with URLSearchParams.
The text was updated successfully, but these errors were encountered: