Skip to content

Commit be4325a

Browse files
Update InputValidator.php
1 parent f3260df commit be4325a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Validator/InputValidator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ private function buildValidationTree(ValidationNode $rootObject, iterable $field
138138

139139
foreach ($fields as $name => $arg) {
140140
$property = $arg['name'] ?? $name;
141+
142+
if (!array_key_exists($property, $inputData)) {
143+
// This field was not provided in the inputData. Do not attempt to validate it.
144+
continue;
145+
}
146+
141147
$config = static::normalizeConfig($arg['validation'] ?? []);
142148

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

0 commit comments

Comments
 (0)