Skip to content

fix(doctrine): document SortFilter parameters as a single value - #8759

Open
Amoifr wants to merge 2 commits into
api-platform:4.4from
Amoifr:fix-8744-sort-filter-openapi-array
Open

Amoifr wants to merge 2 commits into
api-platform:4.4from
Amoifr:fix-8744-sort-filter-openapi-array

Conversation

@Amoifr

@Amoifr Amoifr commented Oct 23, 2026

Copy link
Copy Markdown
Contributor
Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fixes #8744
License MIT
Doc PR n/a

SortFilter::apply() only handles a string direction, but since #8423 the default castToArray: null makes OpenApiFilterTrait document both orderDate and orderDate[]. The array form can never work: it fails validation with a 422.

The ORM and ODM SortFilter now default castToArray to false before building their OpenAPI parameters. An explicit castToArray is still honored.

Tests: a functional test on /docs (fails before the change) and unit tests for the three castToArray values in both bridges. The ODM unit test could not run locally (no ext-mongodb), I checked it on a copy without the DocumentManager setup.

SortFilter only applies a string direction, but with the default castToArray
OpenAPI also advertised an "order[]" array form that always fails validation.
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