Skip to content

test: cover Assert\Choice exposure in OpenAPI schema#8191

Merged
soyuka merged 1 commit into
api-platform:4.3from
soyuka:feat/1522-choice-openapi-test
May 21, 2026
Merged

test: cover Assert\Choice exposure in OpenAPI schema#8191
soyuka merged 1 commit into
api-platform:4.3from
soyuka:feat/1522-choice-openapi-test

Conversation

@soyuka
Copy link
Copy Markdown
Member

@soyuka soyuka commented May 21, 2026

Summary

  • Adds functional ApiTestCase verifying PropertySchemaChoiceRestriction surfaces enum, items.enum, minItems, maxItems in /docs (OpenAPI JSON).
  • Existing OpenApiTest only covered PHP backed enum properties (genderType, playMode); Symfony Validator Choice constraint exposure was uncovered at the functional level.
  • Confirms issue [RFC] Choice Validation to be documented on Swagger  #1522 ("Choice Validation to be documented on Swagger") is already resolved; this PR locks the behaviour with regression coverage.

Test plan

  • vendor/bin/phpunit tests/Functional/ChoiceValidationOpenApiTest.php — passes (1 test, 9 assertions)

Closes #1522

Functional ApiTestCase verifies PropertySchemaChoiceRestriction
surfaces `enum` (single), `items.enum`, `minItems`, `maxItems`
(multi) in /docs output. Existing OpenApiTest only covered PHP
backed enums, not Symfony Validator Choice constraint.

Closes api-platform#1522
@soyuka soyuka merged commit b42ca7b into api-platform:4.3 May 21, 2026
120 checks passed
@soyuka soyuka deleted the feat/1522-choice-openapi-test branch May 21, 2026 09:17
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