Fix to let schema attribute enum type hint allow null values (#271)

This commit is contained in:
Sule-Balogun Olanrewaju 2026-04-11 16:21:14 +01:00 • committed by GitHub
commit 5d57b685a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -471,6 +471,7 @@ class SchemaValidatorTest extends TestCase
'active' => ['type' => 'boolean'],
'score' => ['type' => 'number'],
'items' => ['type' => 'array', 'items' => ['type' => 'string']],
'status' => ['enum' => [null, 'active', 'inactive']],
'nullableValue' => ['type' => ['string', 'null']],
'optionalValue' => ['type' => 'string'],
],
@ -486,6 +487,7 @@ class SchemaValidatorTest extends TestCase
* active: bool,
* score: float,
* items: string[],
* status: 'active'|'inactive'|null,
* nullableValue: null,
* optionalValue: string
* }
@ -498,6 +500,7 @@ class SchemaValidatorTest extends TestCase
'active' => true,
'score' => 99.5,
'items' => ['a', 'b'],
'status' => null,
'nullableValue' => null,
'optionalValue' => 'present',
];