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

Add support for comma separated numeric values in numeric filter #6719

Conversation

frankdekker
Copy link

@frankdekker frankdekker commented Oct 13, 2024

Q A
Branch? main
Tickets -
License MIT
Doc PR api-platform/docs#2037

Currently the NumericFilter allows for searching for numeric-string or numeric-string[]:

/api/entity?numericValue=5
/api/entity?numericValue[]=5&numericValue[]=6

This PR adds the support for comma-separated numeric-values:

/api/entity?numericValue=5,6

Which allows for much shorter urls when searching on multiple numeric values and if I understand the specification correctly this is a valid format. A snipper from the documentation:

Query parameters can be primitive values, arrays and objects. OpenAPI 3.0 provides several ways to serialize objects and arrays in the query string.

Arrays can be serialized as:

form – /products?color=blue,green,red or /products?color=blue&color=green, depending on the explode keyword

https://swagger.io/docs/specification/v3_0/describing-parameters/#query-parameters

@frankdekker frankdekker deleted the Add-support-for-comma-separated-numbers-in-numeric-filter branch October 13, 2024 21:45
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.

1 participant