fix: Cannot pass null to nullable enum parameters (#299)
* nullable enum value * fix tests
This commit is contained in:
parent
797472777f
commit
06917f6af6
1 changed files with 5 additions and 3 deletions
|
|
@ -197,7 +197,7 @@ final class SchemaGeneratorTest extends TestCase
|
|||
$this->assertEquals(['type' => 'string', 'description' => 'Backed string enum', 'enum' => ['A', 'B']], $schema['properties']['stringEnum']);
|
||||
$this->assertEquals(['type' => 'integer', 'description' => 'Backed int enum', 'enum' => [1, 2]], $schema['properties']['intEnum']);
|
||||
$this->assertEquals(['type' => 'string', 'description' => 'Unit enum', 'enum' => ['Yes', 'No']], $schema['properties']['unitEnum']);
|
||||
$this->assertEquals(['type' => ['null', 'string'], 'enum' => ['A', 'B'], 'default' => null], $schema['properties']['nullableEnum']);
|
||||
$this->assertEquals(['type' => ['string', 'null'], 'enum' => ['A', 'B', null], 'default' => null], $schema['properties']['nullableEnum']);
|
||||
$this->assertEquals(['type' => 'integer', 'enum' => [1, 2], 'default' => 1], $schema['properties']['enumWithDefault']);
|
||||
$this->assertEqualsCanonicalizing(['stringEnum', 'intEnum', 'unitEnum'], $schema['required']);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue