Skip to content

refactor: dedupe the parameter validation factories - #8914

Open
Maxcastel wants to merge 1 commit into
api-platform:mainfrom
Maxcastel:refactor/parameter-validation-factories
Open

Maxcastel wants to merge 1 commit into
api-platform:mainfrom
Maxcastel:refactor/parameter-validation-factories

Conversation

@Maxcastel

@Maxcastel Maxcastel commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor
Q A
Branch? main
License MIT

Both ParameterValidationResourceMetadataCollectionFactory (validator and Laravel) had the same loop over the HTTP and GraphQL operations, and the same code to set one constraint or an array of them. It's now in an @internal trait in Metadata, like MetadataCollectionFactoryTrait.

The Laravel factory had no test, so I added one.

api-platform/validator now requires api-platform/metadata ^5.1 for the trait.

@Maxcastel
Maxcastel force-pushed the refactor/parameter-validation-factories branch from 4838d66 to cbeb4b4 Compare December 1, 2026 14:17
@Maxcastel
Maxcastel force-pushed the refactor/parameter-validation-factories branch from cbeb4b4 to 3ec7d79 Compare December 1, 2026 16:10
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