{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "version": { "const": 1 }, "externalId": { "type": "string", "minLength": 1, "description": "ID within competition software; used to avoid accidentally overwriting data within Skate Results" }, "athletes": { "type": "array", "items": { "$ref": "#/$defs/athlete" } }, "ageGroups": { "type": "array", "items": { "$ref": "#/$defs/ageGroup" } }, "evaluations": { "type": "array", "items": { "$ref": "#/$defs/evaluation" }, "minItems": 1, "description": "One evaluation must have id \"0\"" } }, "required": [ "version", "externalId", "athletes", "ageGroups", "evaluations" ], "additionalProperties": false, "$defs": { "competitionRanking": { "type": "object", "properties": { "rank": { "anyOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] }, "points": { "anyOf": [ { "type": "integer", "minimum": 0, "description": "Points for overall ranking" }, { "type": "null" } ] } }, "required": [ "rank", "points" ], "additionalProperties": false }, "time": { "type": "object", "properties": { "seconds": { "type": "number", "minimum": 0 }, "precision": { "type": "integer", "minimum": 0 } }, "required": [ "seconds", "precision" ], "additionalProperties": false }, "raceResult": { "type": "object", "properties": { "raceIndex": { "type": "integer", "minimum": 0 }, "startPos": { "anyOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] }, "rank": { "anyOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] }, "time": { "anyOf": [ { "$ref": "#/$defs/time" }, { "type": "null" } ] }, "points": { "anyOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ], "description": "Points in points race" }, "remarks": { "type": "string" }, "rr": { "type": "boolean", "description": "Reduced in rank" }, "dsqSF": { "type": "boolean", "description": "Disqualified by sports fault" }, "dsqTF": { "type": "boolean", "description": "Disqualified by technical fault" }, "fs1": { "type": "boolean", "description": "1st false start" }, "warning1": { "type": "boolean", "description": "1st warning" }, "warning2": { "type": "boolean", "description": "2nd warning" }, "dns": { "type": "boolean", "description": "Did not start" } }, "required": [ "raceIndex", "startPos", "rank", "time", "points", "remarks", "rr", "dsqSF", "dsqTF", "fs1", "warning1", "warning2", "dns" ], "additionalProperties": false }, "competitionResult": { "type": "object", "properties": { "rounds": { "type": "object", "properties": { "final-a": { "$ref": "#/$defs/raceResult" }, "final-b": { "$ref": "#/$defs/raceResult" }, "final-c": { "$ref": "#/$defs/raceResult" }, "final-d": { "$ref": "#/$defs/raceResult" }, "final-e": { "$ref": "#/$defs/raceResult" }, "final-f": { "$ref": "#/$defs/raceResult" }, "final-g": { "$ref": "#/$defs/raceResult" }, "final-h": { "$ref": "#/$defs/raceResult" }, "final-i": { "$ref": "#/$defs/raceResult" }, "final-j": { "$ref": "#/$defs/raceResult" }, "semifinals": { "$ref": "#/$defs/raceResult" }, "quarterfinals": { "$ref": "#/$defs/raceResult" }, "eighthfinals": { "$ref": "#/$defs/raceResult" }, "heats": { "$ref": "#/$defs/raceResult" } }, "required": [], "additionalProperties": false }, "ranking": { "allOf": [ { "type": "object", "properties": { "0": { "$ref": "#/$defs/competitionRanking" } }, "required": [ "0" ], "description": "Main evaluation" }, { "type": "object", "additionalProperties": { "$ref": "#/$defs/competitionRanking" }, "description": "Key is the evaluation ID" } ] } }, "required": [ "rounds", "ranking" ], "additionalProperties": false }, "competitionResults": { "type": "object", "additionalProperties": { "$ref": "#/$defs/competitionResult" }, "description": "Key is the competition ID" }, "overallRanking": { "type": "object", "properties": { "rank": { "anyOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] }, "points": { "anyOf": [ { "type": "integer", "minimum": 0, "description": "Sum of all competition points" }, { "type": "null" } ] } }, "required": [ "rank", "points" ], "additionalProperties": false }, "overallResults": { "allOf": [ { "type": "object", "properties": { "0": { "$ref": "#/$defs/overallRanking" } }, "required": [ "0" ], "description": "Main evaluation" }, { "type": "object", "additionalProperties": { "$ref": "#/$defs/overallRanking" }, "description": "Key is the evaluation ID" } ] }, "athlete": { "type": "object", "properties": { "id": { "$ref": "#/$defs/id" }, "bib": { "anyOf": [ { "type": "integer", "minimum": 1 }, { "type": "null" } ] }, "lastName": { "type": "string", "minLength": 1 }, "firstName": { "type": "string", "minLength": 1 }, "club": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "nation": { "anyOf": [ { "type": "string", "minLength": 3, "maxLength": 3, "description": "IOC country code" }, { "type": "null" } ] }, "ageGroupId": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ] }, "evaluationIds": { "type": "array", "items": [ { "const": "0" } ], "minItems": 1, "additionalItems": { "type": "string", "minLength": 1 }, "description": "Evaluations the athlete is ranked in" }, "results": { "type": "object", "properties": { "overall": { "$ref": "#/$defs/overallResults" }, "competitions": { "$ref": "#/$defs/competitionResults" } }, "required": [ "overall", "competitions" ], "additionalProperties": false }, "transponderCodes": { "type": "array", "items": { "type": "string", "minLength": 1 }, "default": [] } }, "required": [ "id", "bib", "lastName", "firstName", "club", "nation", "ageGroupId", "evaluationIds", "results" ], "additionalProperties": false }, "raceStatus": { "anyOf": [ { "const": "open" }, { "const": "seeded" }, { "const": "done" } ] }, "roundStatus": { "anyOf": [ { "const": "open" }, { "const": "seeded" }, { "const": "done" } ] }, "timetableNumber": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null }, "qualificationCount": { "type": "integer", "minimum": 0, "default": 0 }, "race": { "type": "object", "properties": { "status": { "$ref": "#/$defs/roundStatus" } }, "required": [ "status" ], "additionalProperties": false }, "roundId": { "enum": [ "final-a", "final-b", "final-c", "final-d", "final-e", "final-f", "final-g", "final-h", "final-i", "final-j", "semifinals", "quarterfinals", "eighthfinals", "heats" ] }, "qualificationRule": { "type": "object", "properties": { "round": { "$ref": "#/$defs/roundId" }, "byTime": { "$ref": "#/$defs/qualificationCount" }, "byRank": { "$ref": "#/$defs/qualificationCount" } }, "required": [ "round" ], "additionalProperties": false }, "round": { "type": "object", "properties": { "id": { "$ref": "#/$defs/roundId" }, "status": { "$ref": "#/$defs/roundStatus" }, "timetableNumber": { "$ref": "#/$defs/timetableNumber" }, "label": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ], "default": null, "description": "Custom round label instead of the default one" }, "raceLabelPrefix": { "anyOf": [ { "type": "string", "minLength": 1 }, { "type": "null" } ], "default": null, "description": "Custom race label prefix instead of the default one. Without trailing space." }, "races": { "type": "array", "items": { "$ref": "#/$defs/race" }, "minItems": 1 }, "qualificationRules": { "type": "array", "items": { "$ref": "#/$defs/qualificationRule" }, "description": "Ordered by priority. E.g. `final-a` is the first rule, `final-b` is the second rule, etc." } }, "required": [ "id", "status", "races", "qualificationRules" ], "additionalProperties": false }, "competition": { "type": "object", "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "type": "string", "minLength": 1 }, "distance": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "description": "Distance in meters" }, "done": { "type": "boolean" }, "priority": { "type": "integer", "minimum": 1, "description": "Priority of competitions in case of a tie in points; currently not used" }, "rounds": { "type": "array", "items": { "$ref": "#/$defs/round" }, "minItems": 1 } }, "required": [ "id", "name", "done", "rounds" ], "additionalProperties": false }, "age": { "type": "integer", "description": "Age in years" }, "ageGroup": { "type": "object", "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "type": "string", "minLength": 1, "description": "Name including the gender" }, "gender": { "anyOf": [ { "const": "female" }, { "const": "male" }, { "const": "mixed" } ] }, "ageRange": { "anyOf": [ { "type": "array", "items": [ { "$ref": "#/$defs/age" }, { "$ref": "#/$defs/age" } ], "minItems": 2 }, { "type": "null" } ], "default": null, "description": "Minimum and maximum age" }, "competitions": { "type": "array", "items": { "$ref": "#/$defs/competition" } } }, "required": [ "id", "name", "gender", "competitions" ], "additionalProperties": false }, "evaluation": { "type": "object", "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "type": "string", "minLength": 1 } }, "required": [ "id", "name" ], "additionalProperties": false }, "id": { "type": "string", "pattern": "^[A-Za-z0-9._~-]*$", "minLength": 1, "maxLength": 32 } } }