Skip to content

fix(doctrine): scalar schema for comparison params - #8605

Open
soyuka wants to merge 1 commit into
api-platform:4.4from
soyuka:fix/comparison-filter-openapi-params-8589
Open

soyuka wants to merge 1 commit into
api-platform:4.4from
soyuka:fix/comparison-filter-openapi-params-8589

Conversation

@soyuka

@soyuka soyuka commented Sep 29, 2026

Copy link
Copy Markdown
Member
Q A
Branch? 4.4
Tickets Closes #8589
License MIT

ComparisonFilter::getOpenApiParameters() returned the [gt], [gte], [lt], [lte] and [ne] parameters without a schema. OpenApiFactory::mergeParameter then merged them over a default that carries the object schema from getSchema(), with explode=true. Postman therefore expanded the object into bare gt/lt query params.

Each operator param now has the inner filter schema and explode: false. The inner schema is computed with castToArray(false), so a UuidFilter or UlidFilter documents one uuid and not oneOf[uuid, array], which applyOperator would reject. ORM and ODM get the same change. getSchema() does not change.

Tests:

  • ComparisonFilterTest::testOpenApiOperatorParametersAreScalar checks {type: string} and explode: false.
  • UuidComparisonFilterTest::testOpenApiOperatorParametersUseScalarUuidSchema checks {type: string, format: uuid}.

On the merge-up to 5.0, add the same two arguments to the [between] parameter.

ComparisonFilter's per-operator OpenAPI parameters inherited the parent object schema and explode=true, so Postman expanded bare gt/lt/... params. Each operator param now carries the inner filter's scalar schema with explode=false. The inner schema is computed with castToArray=false, so UuidFilter and UlidFilter document a single uuid, not oneOf[uuid, array].

Fixes api-platform#8589
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