Skip to content

Commit

Permalink
fix(validator): Don't setup the parameter automatic validation if con…
Browse files Browse the repository at this point in the history
…straints are provided
  • Loading branch information
Eric GELOEN committed Oct 25, 2024
1 parent 67c5a2a commit 483719f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ public function create(string $resourceClass): ResourceMetadataCollection

private function addSchemaValidation(Parameter $parameter, ?array $schema = null, ?bool $required = null, ?OpenApiParameter $openApi = null): Parameter
{
$constraints = $parameter->getConstraints();

if (\is_array($constraints) && \count($constraints) > 0) {
return $parameter;
}

$schema ??= $parameter->getSchema();
$required ??= $parameter->getRequired() ?? false;
$openApi ??= $parameter->getOpenApi();
Expand Down

0 comments on commit 483719f

Please sign in to comment.