Created
December 19, 2018 20:45
-
-
Save NickyMeuleman/f18b70684e12697d71b4178ad1403988 to your computer and use it in GitHub Desktop.
JSON-schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "./drivers.schema.json", | |
"series": "f1", | |
"season": 2018, | |
"driverList": [ | |
{ | |
"raceNumber": 14, | |
"code": "ALO", | |
"firstName": "Fernando", | |
"lastName": "Alonso", | |
"dateOfBirth": "1981-07-29", | |
"team": "MCLAREN", | |
"quotes": ["GP2 engine, GP2", "5 second penalty? Issa yoke"] | |
}, | |
{ | |
"raceNumber": 3, | |
"code": "RIC", | |
"firstName": "Daniel", | |
"lastName": "Ricciardo", | |
"dateOfBirth": "1989-07-01", | |
"nationality": "Australian", | |
"team": "REDBULL" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema", | |
"title": "Drivers", | |
"description": "Formula 1 drivers", | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"$schema": { | |
"type": "string", | |
"description": "path to the JSON-schema to use for this file" | |
}, | |
"series": { | |
"type": "string", | |
"const": "f1" | |
}, | |
"season": { | |
"type": "integer", | |
"description": "year corresponding with season" | |
}, | |
"driverList": { | |
"type": "array", | |
"items": { | |
"$ref": "#/definitions/driver" | |
} | |
} | |
}, | |
"definitions": { | |
"driver": { | |
"type": "object", | |
"additionalProperties": false, | |
"properties": { | |
"raceNumber": { | |
"type": "integer", | |
"minimum": 0, | |
"maximum": 99, | |
"description": "number this driver races with" | |
}, | |
"code": { | |
"type": "string", | |
"minLength": 3, | |
"maxLength": 3, | |
"description": "3 letter abbreviation" | |
}, | |
"firstName": { | |
"type": "string" | |
}, | |
"lastName": { | |
"type": "string" | |
}, | |
"dateOfBirth": { | |
"type": "string", | |
"format": "date", | |
"description": "dateOfBirth in YYYY-MM-DD format", | |
"default": "YYYY-MM-DD" | |
}, | |
"nationality": { | |
"type": "string" | |
}, | |
"team": { | |
"$ref": "#/definitions/team" | |
}, | |
"quotes": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
}, | |
"uniqueItems": true | |
} | |
}, | |
"required": ["raceNumber", "code", "team"] | |
}, | |
"team": { | |
"enum": [ | |
"MCLAREN", | |
"FERRARI", | |
"REDBULL", | |
"TOROROSSO", | |
"MERCEDES", | |
"RENAULT", | |
"HAAS", | |
"FORCEINDIA", | |
"SAUBER", | |
"WILLIAMS" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sounds good, I'll track them down. Thanks