json-schema
json-schema copied to clipboard
fix: Allow enum with type null
Enum with both type with null, and string thow a validation error.
{
"type": ["string", null],
"enum": ["A", "B"]
}
Today we need to use
{
"oneOf": {
[
{
"type": null
},
{
"type": "string",
"enum": ["A", "B"]
}
]
}
}
or
{
"type": ["string", null],
"enum": [null, "A", "B"]
}