Skip to content
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

paramsSerializerOptions: arrayFormat does not seems to work. #1751

Open
omarkhatibco opened this issue Dec 18, 2024 · 5 comments · May be fixed by #1795
Open

paramsSerializerOptions: arrayFormat does not seems to work. #1751

omarkhatibco opened this issue Dec 18, 2024 · 5 comments · May be fixed by #1795
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@omarkhatibco
Copy link

omarkhatibco commented Dec 18, 2024

Hello,

I'm trying to use arrayFormat but it does not seems to work, as in the docs

paramsSerializerOptions: {
    qs: {
        arrayFormat: 'brackets',
    },
},

I'm not sure it's a bug since there is no qs library installed anyway. does this option only works if axios is used?

Update: I just tried to provide a custom params serializer function, it's not used in the generated code and all the code are using URLSearchParams

@melloware melloware added the documentation Improvements or additions to documentation label Dec 18, 2024
@melloware
Copy link
Collaborator

melloware commented Dec 18, 2024

I think we need much better documentation: https://orval.dev/reference/configuration/output#paramsserializeroptions

I have no idea what qs means or what the options for arrayFormat are! Or even any explanaton on what paramsserializeroptions is used for or what problem it solves.

@melloware melloware added the bug Something isn't working label Dec 18, 2024
@melloware melloware changed the title arrayFormat does not seems to work. paramsserializeroptions: arrayFormat does not seems to work. Dec 18, 2024
@melloware melloware changed the title paramsserializeroptions: arrayFormat does not seems to work. paramsSerializerOptions: arrayFormat does not seems to work. Dec 18, 2024
@AllieJonsson
Copy link
Contributor

Yes, it seems like this is only supported for axios currently..

@melloware
Copy link
Collaborator

@AllieJonsson these docs definitely need improving as I looked at it and it tells me absolutely nothing about this feature, what its for, what the values mean, Axios only etc?

@AllieJonsson
Copy link
Contributor

I agree! I can try to both improve the docs and make this work with fetch, its quite a cool feature!
qs is a npm package that stringifies query parameters from an object. E.g.

{
  Foo: {
    Bar: "baz"
  }
}

Could become
?Foo[Bar]=baz

@melloware
Copy link
Collaborator

Thanks!

@AllieJonsson AllieJonsson linked a pull request Jan 8, 2025 that will close this issue
3 tasks
@melloware melloware added this to the 7.4.1 milestone Jan 8, 2025
@melloware melloware modified the milestones: 7.4.1, 7.4.2 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants