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

Standardize on underscoring query parameters #285

Open
TylerPachal opened this issue Jan 11, 2023 · 2 comments
Open

Standardize on underscoring query parameters #285

TylerPachal opened this issue Jan 11, 2023 · 2 comments

Comments

@TylerPachal
Copy link
Contributor

TylerPachal commented Jan 11, 2023

I was working on a PR to add "dasherized support" for the sort and include fields, in the same way I added it for the filter field in #282.

While I was doing that, I realized that it already works for include, because the parse_include function performs its own underscoring already, and doesn't need any help from the UnderscoreParameters plug.

This was something that the parse_sort function does not do, which I addressed by changing the UnderscoreParameters plug in #282.

So now we are in a state where certain query parameters always underscore their values, while others do not:

Query Parameter Underscored?
fields Always
filter Opt-in via replace_query_params
include Always
sort Never

I think for version 2.0 of this library:

But in the mean time, there should still be a way to underscore the sort query parameter. It looks like our options are:

  1. Add the sort underscoring in the same fashion as the filter underscoring by putting it behind the replace_query_params option.
  2. Do it all of the time by adding a call to underscore/1 in the QueryParser.parse_filter function.

Let me know what you think is best, and I can prepare the PR.

@esbanarango
Copy link

🙏

Copy link
Contributor

This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet.
If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.

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

No branches or pull requests

2 participants