The following JSON Schema describes a valid JSON for a lat/lon coordinate:
{
"title": "coordinates",
"type": "object",
"properties": {
"longitude": {
"type": "number",
"minimum": -180,
"maximum":180,
"exclusiveMinimum": false,
"exclusiveMaximum": false
},
"latitude": {
"type": "number",
"minimum": -180,
"maximum":180,
"exclusiveMinimum": false,
"exclusiveMaximum": false
}
},
"required": ["longitude", "latitude"],
"additionalProperties":false
}
The required
setting sets the latitude
property to be mandatory.
Is there a way to define an alias for the latitude
key, so that the client can use either latitude
or lat
- but not neither and not both?