Skip to content

Commit

Permalink
Update InputValidator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
joesaunderson authored May 1, 2024
1 parent f3260df commit be4325a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Validator/InputValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ private function buildValidationTree(ValidationNode $rootObject, iterable $field

foreach ($fields as $name => $arg) {
$property = $arg['name'] ?? $name;

if (!array_key_exists($property, $inputData)) {
// This field was not provided in the inputData. Do not attempt to validate it.
continue;
}

$config = static::normalizeConfig($arg['validation'] ?? []);

if (isset($config['cascade']) && isset($inputData[$property])) {
Expand Down

0 comments on commit be4325a

Please sign in to comment.