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

[bug] Generate url with nested query params #19809

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

snewcomer
Copy link
Contributor

@snewcomer snewcomer changed the title Generate url with nested query params [bug] Generate url with nested query params Nov 9, 2021
@kategengler
Copy link
Member

Is this still relevant? It is a draft PR

return this.visit('/').then(() => {
let expectedURL = this.routerService.urlFor('parent.child', queryParams);

assert.equal('/child?filter=[user][name][$contains]=foo', expectedURL);
Copy link
Contributor

@sukima sukima Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: This looks off. are we sure this is encoded correctly?

Per RFC3986:

If data for a URI component would conflict with a reserved character's purpose as a delimiter, then the conflicting data must be percent-encoded before the URI is formed.

And states that = is indeed a reserved character as a sub-delim. I'm a little confused how to parse this. Is filter the key to the key/value pair or is [user][name][$contains] or filter=[user][name][$contains] the key?

suggestion: per this SO answer a convention might be: ?filter[user][name][$contains]=foo instead.

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.

3 participants