Open
Description
There appears to be no way of defining a non-null optional field, you get a validation/linting warning when you publish such a schema, but I feel this is perfectly valid.
I had to make lat/lon type ["number", "null"], but this is not valid, I do not want a null value to be passed in at all, in fact I want to a null value to fail validation for this location schema
"location": {
"description": "Place name and lat/Lon coordinates",
"type": ["object", "null"],
"properties": {
"name": {
"description": "The name of this location, city/town etc",
"type": "string",
"maxLength": 2048
},
"lat": {
"description": "Latitude for the location",
"type": ["number", "null"],
"minimum": -90,
"maximum": 90
},
"lon": {
"description": "Longitude for the location",
"type": ["number", "null"],
"minimum": -180,
"maximum": 180
}
},
"required": [
"name"
],
"dependencies": {
"lat": ["lon"],
"lon": ["lat"]
},
"additionalProperties" : false
}
Metadata
Assignees
Labels
No labels