ExactFilter generate an array on the OpenApi doc
API Platform version(s) affected: 4.2.5
Description
By copy/pasting the code on the doc here : https://api-platform.com/docs/core/doctrine-filters/#exact-filter
it result in an array on the doc :
In my real case, where I want to search on an enum field (string in database, enum in symfony entity), when I search with a possible value, it actually works, but the query string include the [] in the query, which is not ok for production.
https://api.url.com/foo?page=1&itemsPerPage=30&type%5B%5D=bar
If I try to fix that with "schema" (because as it's an enum, I'd like to have a select in the doc, not an input text), it get worse : I can select a value, but it result in a 422 ConstraintViolation (Cette valeur doit être l'un des choix proposés)
and I did not succeeded to make the query parameter not an array.
Also, some links in the doc leads to nothing, like
- the "new search filters" here: https://api-platform.com/docs/core/doctrine-filters/#exact-filter
- links here: https://api-platform.com/docs/core/doctrine-filters/#built-in-new-search-filters-api-platform--42
I made the openapi doc ok by adding "openApi" in my QueryParameter
I don't know if it's assumed / necessary / .. as the example in the doc is not an array, but is not mentioning anything about that https://api-platform.com/docs/core/doctrine-filters/#exact-filter
Interesting, my guess is that castToArray is actually true on the parameter, could you screenshot the profiler for this? Indeed by overriding the openapi parameter we don't change it manually therefore its working.. This is looking like a bug I'm transfering this to core.