-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
fix(fetch): properly append array values to normalizedParams
object
#1580
Conversation
Looks like the build is failing? |
I can now reproduce locally, I'm working on a fix 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I'm wondering if I should make it optional and selectable. Because this is currently working.
I've found the cause of the error, it's because the strong typed pet store example export type ListPetsParams = {
/**
* How many items to return at one time (max 100)
*/
limit?: string;
}; this is based on the parameters:
- name: limit
in: query
description: How many items to return at one time (max 100)
required: false
schema:
type: string The error claims that the code So then the proposed change of the PR would have to be dynamically included based on whether the type is an array or not. I haven't figured out how / where to do this best. If you have any idea on how to do this properly, don't hesitate to do so 😉 |
This means changing the conditions for constructing query parameters depending on the |
Hi, @n2k3 |
I'll close this PR. Because, this issue fixed by #1604. |
Status
WIP
Description
related #1285
I experienced a problem with array values.
For example I want to send this:
Foo: [0, 1]
this will be added by this line of code to the URLSearchParams instance, which in turn will by stringified toFoo=0,1
and appended to the API url in generated code.Shouldn't this be done according to this example in the MDN docs? Resulting in
Foo=0&Foo=1
as stringified value.This PR addresses that. Let me know if I need to anything else within this PR.
Thanks @soartec-lab for the great work on the fetch client 🎉
Related PRs
List related PRs against other branches:
fetch
client #1387Todos