Skip to content

Instantly share code, notes, and snippets.

@Fleid
Created June 6, 2017 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fleid/0927e3a2ffa46e2100d1b17674599092 to your computer and use it in GitHub Desktop.
Save Fleid/0927e3a2ffa46e2100d1b17674599092 to your computer and use it in GitHub Desktop.
driveBC API - events JSON schema v1
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {},
"id": "http://example.com/example.json",
"properties": {
"events": {
"items": {
"properties": {
"+ivr_message": {
"type": [
"string",
"null"
]
},
"areas": {
"items": {
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"created": {
"type": "string"
},
"description": {
"type": "string"
},
"event_subtypes": {
"items": {
"type": "string"
},
"type": "array"
},
"event_type": {
"type": "string"
},
"geography": {
"properties": {
"coordinates": {
"items": {
"anyOf": [
{
"items": {
"type": "number"
},
"type": "array"
},
{
"type": "number"
}
]
},
"type": "array"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"headline": {
"type": "string"
},
"id": {
"type": "string"
},
"jurisdiction_url": {
"type": "string"
},
"roads": {
"items": {
"properties": {
"direction": {
"type": "string"
},
"from": {
"type": "string"
},
"name": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"schedule": {
"properties": {
"intervals": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"severity": {
"type": "string"
},
"status": {
"type": "string"
},
"updated": {
"type": "string"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"meta": {
"properties": {
"up_url": {
"type": "string"
},
"url": {
"type": "string"
},
"version": {
"type": "string"
}
},
"type": "object"
},
"pagination": {
"properties": {
"next_url": {
"type": "string"
},
"offset": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
@Fleid
Copy link
Author

Fleid commented Jun 6, 2017

Created from a sample payload using a generator, tweaked the geography attributes with anyOf to take into account the alternate items type (Points or LineStrings)

@Fleid
Copy link
Author

Fleid commented Aug 8, 2017

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