To ensure your structured data schema works with Veritone's system, use the following format when you create a schema.
| Field | Field Type | Required | Description | Example |
| $id | String | No | The URI reference to the schema. | "$id": "http://example.com/example.json" |
| description | String | No | Describes the schema. | "description": "Employee birthday list" |
| type | String | No | Indicates the format type of the schema. Default value is "object". The other types are listed in the Supported schema types section. | "type": "object" |
| required | Array | No | Indicates the fields that are required to be present in the structured data. If a required field is not present in a record, that record will not be saved. | "required": ["id", "name"] |
| properties | Object | No | A JSON object containing the names and data types of the fields in the structured data set. | "properties": {"firstName":{"type":"string"},"lastName":{"type":"string"}}| |
Supported schema types
The type field supports these values:
| Type | Example Values | Notes |
array | ["one", "two", "three"] | See json-schema array type |
binary | "U29tZSBiaW5hcnkgYmxvYg==" | See elasticsearch binary type |
boolean | true, false | See json-schema boolean type |
dateTime | "2018-02-22T01:00:00.000Z" | Should be in UTC time and formatted per ISO 8601 |
geoPoint | "34.052235,-118.243683" | Should be a latitude, longitude coordinate pair as a string |
integer | 1, 4, -34, 32134 | See json-schema integer type |
ip | "192.168.1.1" | See elasticsearch ip type |
number | 1, 2.0, 3431455 | See json-schema number type |
object | {"firstName":{"type":"string"},"lastName":{"type":"string"}} | See json-schema object type |
string | "hello world." | See json-schema string type |
The binary, dateTime, geoPoint, and ip types are all custom extensions to the json-schema standard that in some cases dictate additional validation (specified above). The rest of the data types are direct implementations of their json-schema counterparts.