Coerce ignore validation to array to cover both array/non-array values

This commit is contained in:
Djamil Legato
2023-03-06 11:01:15 -08:00
parent 5fcf690918
commit bd7a74d79e

View File

@@ -129,7 +129,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface
$items = $name !== '' ? $this->getProperty($name)['fields'] ?? [] : $this->items;
foreach ($items as $key => $rules) {
$type = $rules['type'] ?? '';
$ignore = (bool) array_filter($rules['validate']['ignore'] ?? []) ?? false;
$ignore = (bool) array_filter((array)($rules['validate']['ignore'] ?? [])) ?? false;
if (!str_starts_with($type, '_') && !str_contains($key, '*') && $ignore !== true) {
$list[$prefix . $key] = null;
}