I need to define a JSON schema wherein the input can either be a date or empty string.
My current JSON schema is
{
"type": "object",
"required": [
"FirstName",
"DateOfBirth"
],
"properties": {
"FirstName": {
"type": "string"
},
"DateOfBirth": {
"type": "string",
"format": "date"
}
}
}
This allows
{
"FirstName": "Alex",
"DateOfBirth": "1980-10-31"
}
but not
{
"FirstName": "Alex",
"DateOfBirth": ""
}
How can I define the JSON schema so that DateOfBirth allows dates as well as empty string.