Skip to content

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