Skip to content

Fixed: splitting on comma in legacy filter notation #825

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

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Fixed: splitting on comma in legacy filter notation #825

merged 1 commit into from
Sep 15, 2020

Conversation

bart-degreed
Copy link
Contributor

Fixes #815.

The original code looked at the first operator and would, unless that operator was 'in' or 'nin', split the query string parameter value on comma.

This never worked correctly in composition, because the syntax becomes ambiguous.
For example: ?filter[name]=like:a,in:b,c,d could mean:

  • like(a), in(b,c,d)
  • like(a), in(b,c), equals(d)

So while this fix addresses the simple case, it still fails on combinations, including mixing with the new notation.

The original code looked at the first operator and would, unless that operator was 'in' or 'nin', split the query string parameter value on comma.

This never worked correctly in composition, because the syntax becomes ambiguous.
For example: `?filter[name]=like:a,in:b,c,d` could mean:
- like(a), in(b,c,d)
- like(a), in(b,c), equals(d)

So while this fix addresses the simple case, it still fails on combinations, including mixing with the new notation.
@bart-degreed bart-degreed requested a review from maurei September 14, 2020 09:57
@maurei maurei merged commit 0654b42 into json-api-dotnet:master Sep 15, 2020
@bart-degreed bart-degreed deleted the legacy-filters-fix branch September 15, 2020 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Invalid parsing of legacy query strings
2 participants