Skip to content

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

Merged
soyuka merged 3 commits into
api-platform:4.4from
Amoifr:fix-8744-sort-filter-openapi-array
Nov 3, 2026
Merged

soyuka merged 3 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.
…rm/openapi

When a component is installed alone, only the api-platform packages it
requires itself are allowed at their dev version, so the json-schema
dependency of openapi could not be resolved.
@soyuka
soyuka merged commit 7166df6 into api-platform:4.4 Nov 3, 2026
117 checks passed
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.

2 participants