Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "data-api-docs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"directories": {
"doc": "docs"
},
"scripts": {
"validate": "node scripts/validate.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Pixellot/data-api-docs.git"
},
"homepage": "https://github.com/Pixellot/data-api-docs#readme",
"dependencies": {
"ajv": "^8.17.1"
}
}
75 changes: 62 additions & 13 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"description": "Version of the schema following semantic versioning (X.Y.Z)",
"pattern": "^\\d+\\.\\d+\\.\\d+$",
"examples": ["2.0.0"]
},
},
"matchTeamStats": {
"type": "object",
"description": "Stats for the teams that participated in the game",
Expand Down Expand Up @@ -318,9 +318,9 @@
"type": "object",
"description": "A point of interest in a game which was logged, plus enriched data about the tag resource and tag attributes",
"required": [
"id",
"gameId",
"resource",
"id",
"gameId",
"resource",
"attrs",
"angles"
],
Expand Down Expand Up @@ -406,17 +406,17 @@
"oneOf": [
{ "type": "string" },
{ "type": "number" },
{
{
"type": "array",
"items": {
"type": "string"
}
}
],
"examples": [
"offense",
"6579de1d7e14a67a0e1a91bf",
"67a38884b62bf88b1146a82a",
"offense",
"6579de1d7e14a67a0e1a91bf",
"67a38884b62bf88b1146a82a",
"50 John Cohen",
"{\"x\":517.2781982421875,\"y\":311.42251586914062,\"x2\":0,\"y2\":0,\"type\":\"point\",\"sector\":11,\"orientation\":\"left\"}"
]
Expand Down Expand Up @@ -534,6 +534,23 @@
}
}
},
"fileAttributes": {
"type": "object",
"description": "Attributes describing the file",
"properties": {
"lastUpdatedAt": {
"type": "string",
"format": "date-time",
"description": "Last updated at date and time of the file in ISO 8601 format",
"examples": ["2025-09-25T02:00:00.000Z"]
},
"lastUpdateReason": {
"type": "string",
"description": "Reason for the last update",
"examples": ["breakdown_completed"]
}
}
},
"eventAttributes": {
"type": "object",
"description": "Attributes describing the event/game",
Expand Down Expand Up @@ -609,6 +626,34 @@
},
"required": ["id", "name"]
},
"league": {
"oneOf": [
{
"type": "object",
"description": "League information",
"properties": {
"advantageId": {
"type": "string",
"description": "ID of the league in Advantage",
"examples": ["68af417a5b1a116e63804719"]
},
"title": {
"type": "string",
"description": "Title of the league"
},
"vidswapId": {
"type": "integer",
"description": "ID of the league in VidSwap",
"examples": [7627829]
}
},
"required": ["advantageId", "title", "vidswapId"]
},
{
"type": "null"
}
]
},
"ids": {
"type": "object",
"description": "Various system IDs for the event",
Expand Down Expand Up @@ -719,6 +764,11 @@
"priority": {
"type": "integer",
"description": "Priority of the breakdown (integer number). Optional field"
},
"loggerNotes": {
"type": "string",
"description": "Notes from the logger",
"examples": ["This game was logged on VidSwap"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly it is possible to have multiple logger notes for a logging job, are they all combined to 1 string? Is there a delimiter? If so, worth noting here.

}
}
},
Expand Down Expand Up @@ -747,13 +797,12 @@
"type": "string",
"description": "URL to the recorded video stream",
"format": "uri",
"examples": ["https://d2s0txx1aqnj4f.cloudfront.net/someTenantName/6736d0dc4c7136f9b31f0269/cloud_hls/0_hd_hls.m3u8"]
"examples": ["https://d2s0txx1aqnj4f.cloudfront.net/someTenantName/6736d0dc4c7136f9b31f0269/cloud_hls/0_hd_hls.m3u8"]
},
"startUtc": {
"type": "string",
"format": "date-time",
"startUTC": {
"type": "integer",
"description": "Indicator of event start time in UTC format",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding that it is seconds - for clarity.

"examples": ["2025-05-01T12:00:00.000Z"]
"examples": [1739552865]
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions scripts/validate.js
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is for internal use, I'm not sure it should be here, since I think the repo is public, maybe we should try keeping it more "formal". WDYT?

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

const Ajv = require('ajv');

const ajv = new Ajv();

const scheme = require('../schema.json');

const isValidSchema = ajv.validateSchema(scheme);

if (!isValidSchema) {
console.log('Schema is invalid');
console.log(ajv.errors);
} else {
console.log('Schema is valid');
}