mirror of
https://github.com/opdavies/build-configs.git
synced 2025-02-02 13:57:33 +00:00
chore: allow for missing fields
This commit is contained in:
parent
8b2181525d
commit
eeeb70df14
|
@ -18,6 +18,7 @@ final class ConfigurationValidator implements ValidatorInterface
|
|||
|
||||
$constraint = new Assert\Collection(
|
||||
[
|
||||
'fields' => [
|
||||
'name' => [
|
||||
new Assert\NotNull(),
|
||||
new Assert\Type('string'),
|
||||
|
@ -51,8 +52,16 @@ final class ConfigurationValidator implements ValidatorInterface
|
|||
|
||||
'web' => new Assert\Optional(),
|
||||
],
|
||||
|
||||
'allowExtraFields' => false,
|
||||
'allowMissingFields' => true,
|
||||
],
|
||||
);
|
||||
|
||||
return $validator->validate($configurationData, $constraint, $groups);
|
||||
return $validator->validate(
|
||||
constraints: $constraint,
|
||||
groups: $groups,
|
||||
value: $configurationData,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue