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

Generate url with nested query params #175

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

snewcomer
Copy link
Contributor

@snewcomer snewcomer commented Oct 30, 2021

ref emberjs/ember.js#19791

Bug

Nested query params are not serialized into the URL property

/?filter=%5Bobject%20Object%5D

Expected

/?filter=[user][name][$contains]=nick

There are some other considerations - generating nested query strings can be done many different ways and exploring a solution requires that we settle on "one" of the ways to ensure we don't go breaking users.

e.g. a nested filter

?filter[make]=honda&filter[model]=civic
?filter=[make]=honda&filter=[model]=civic
?filter.make=honda&filter.model=civic

e.g. nested array filter
?a[0]=b&a[1]=c
?a[]=b&a[]=c
?a=b&a=c

Note - libraries like qs have taken stances on certain patterns. We can glean what to do from them but in no means is it the "correct" way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant