Skip to content

Commit 4f65ef2

Browse files
GeLoLabsEric GELOENsoyuka
authoredOct 26, 2024··
fix(metadata): providing parameter constraints skips automatic ones (#6756)
Co-authored-by: Eric GELOEN <eric.geloen@rapid-flyer.com> Co-authored-by: Antoine Bluchet <soyuka@users.noreply.github.com>
1 parent 8c0e30f commit 4f65ef2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/Validator/Metadata/Resource/Factory/ParameterValidationResourceMetadataCollectionFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public function create(string $resourceClass): ResourceMetadataCollection
9191

9292
private function addSchemaValidation(Parameter $parameter, ?array $schema = null, ?bool $required = null, ?OpenApiParameter $openApi = null): Parameter
9393
{
94+
if (null !== $parameter->getConstraints()) {
95+
return $parameter;
96+
}
97+
9498
$schema ??= $parameter->getSchema();
9599
$required ??= $parameter->getRequired() ?? false;
96100
$openApi ??= $parameter->getOpenApi();

0 commit comments

Comments
 (0)
Please sign in to comment.