Skip to content

Instantly share code, notes, and snippets.

@agraebe
Last active August 6, 2019 16:25
Show Gist options
  • Save agraebe/766fc8f38f42654d78ece155a792d4d0 to your computer and use it in GitHub Desktop.
Save agraebe/766fc8f38f42654d78ece155a792d4d0 to your computer and use it in GitHub Desktop.
JSON Schema Definition: HyperTrack - Trip Creation
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"additionalProperties": false,
"title": "The Root Schema",
"required": ["device_id"],
"properties": {
"device_id": {
"$id": "#/properties/device_id",
"type": "string",
"title": "The Device_id Schema",
"default": "",
"examples": ["00112233-4455-6677-8899-AABBCCDDEEFF"],
"pattern": "^(.*)$"
},
"destination": {
"$id": "#/properties/destination",
"type": "object",
"additionalProperties": false,
"title": "The Destination Schema",
"required": ["geometry"],
"properties": {
"geometry": {
"$id": "#/properties/destination/properties/geometry",
"type": "object",
"additionalProperties": false,
"title": "The Geometry Schema",
"required": ["type", "coordinates"],
"properties": {
"type": {
"$id": "#/properties/destination/properties/geometry/properties/type",
"type": "string",
"title": "The Type Schema",
"default": "Point",
"const": "Point",
"examples": ["Point"],
"pattern": "^(.*)$"
},
"coordinates": {
"$id": "#/properties/destination/properties/geometry/properties/coordinates",
"type": "array",
"title": "The Coordinates Schema",
"items": [
{
"$id": "#/properties/destination/properties/geometry/properties/coordinates/items/0",
"type": "number",
"title": "The Longitude Schema",
"minimum": -180,
"maximum": 180,
"default": 0.0,
"examples": [-122.3980960195712]
},
{
"$id": "#/properties/destination/properties/geometry/properties/coordinates/items/1",
"type": "number",
"title": "The Latitude Schema",
"minimum": -90,
"maximum": 90,
"default": 0.0,
"examples": [37.7930386903944]
}
],
"additionalItems": false
}
}
},
"radius": {
"$id": "#/properties/destination/properties/radius",
"type": "integer",
"title": "The Radius Schema",
"default": 30,
"minimum": 0,
"examples": [30]
},
"scheduled_at": {
"$id": "#/properties/destination/properties/scheduled_at",
"type": "string",
"title": "The Scheduled_at Schema",
"default": "",
"examples": ["2019-05-03T06:25:51.238000Z"],
"pattern": "^(.*)$",
"format": "date-time"
}
}
},
"metadata": {
"$id": "#/properties/metadata",
"type": "object",
"additionalProperties": false,
"title": "The Metadata Schema",
"default": "",
"examples": ["{'destination_label': 'chestnut'}"],
"pattern": "^(.*)$",
"patternProperties": {
"^.*$": {
"anyOf": [
{ "type": "string" },
{ "type": "number" },
{ "type": "boolean" },
{ "type": "null" },
{ "type": "object" },
{ "type": "array" }
]
}
}
}
}
}
@agraebe
Copy link
Author

agraebe commented Aug 6, 2019

Revision: Remove generate_estimate from the body. We're now generating estimates by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment