Skip to content

Commit eb2c6cb

Browse files
committed
schema: add first draft of an event schema
1 parent 897acfc commit eb2c6cb

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

event-schema-d1.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"name": {
6+
"type": "string",
7+
"description": "The name of the event."
8+
},
9+
"slug": {
10+
"type": "string",
11+
"description": "A unique identifier for the event, often used in URLs.",
12+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
13+
},
14+
"period": {
15+
"type": "object",
16+
"description": "The time period during which the event runs.",
17+
"properties": {
18+
"start": {
19+
"type": "string",
20+
"description": "The start date of the event period.",
21+
"format": "date-time"
22+
},
23+
"end": {
24+
"type": "string",
25+
"description": "The end date of the event period.",
26+
"format": "date-time"
27+
}
28+
},
29+
"required": ["start", "end"]
30+
},
31+
"website": {
32+
"anyOf": [
33+
{
34+
"type": "string",
35+
"format": "uri",
36+
"description": "The website URL of the event."
37+
},
38+
{
39+
"type": "array",
40+
"items": {
41+
"type": "string",
42+
"format": "uri"
43+
},
44+
"description": "An array of website URLs for the event."
45+
}
46+
],
47+
"description": "The website or websites of the event."
48+
},
49+
"results": {
50+
"type": "array",
51+
"description": "A list of results for the event.",
52+
"items": {
53+
"type": "object",
54+
"properties": {
55+
"entry_slug": {
56+
"type": "string",
57+
"description": "A unique identifier for the event entry."
58+
},
59+
"final_score": {
60+
"type": "number",
61+
"description": "The final score obtained by the entry."
62+
},
63+
"rank": {
64+
"type": "integer",
65+
"description": "The rank of the entry, useful for tie-breaking."
66+
}
67+
},
68+
"required": ["entry_slug", "final_score", "rank"]
69+
}
70+
}
71+
},
72+
"required": ["name", "slug", "period", "results"]
73+
}

0 commit comments

Comments
 (0)