Skip to content

Commit 9f8eb1e

Browse files
Add accounts and persons to JSON API verifier.
For now, don't drop team-members yet.
1 parent f313a84 commit 9f8eb1e

File tree

7 files changed

+80
-0
lines changed

7 files changed

+80
-0
lines changed

contest-api/check-api.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ languages
1414
problems
1515
groups
1616
organizations
17+
persons
1718
team-members
19+
accounts
1820
teams
1921
state
2022
submissions
@@ -30,6 +32,8 @@ scoreboard
3032

3133
ENDPOINTS_OPTIONAL='
3234
team-members
35+
persons
36+
accounts
3337
awards
3438
commentary
3539
'

contest-api/json-schema/account.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "CLICS Contest API - account",
4+
"description": "Definition of a single account object",
5+
6+
"type": "object",
7+
"properties": {
8+
"id": { "$ref": "common.json#/identifier" },
9+
"username": { "type": "string" },
10+
"password": { "type": ["string", "null"] },
11+
"type": {
12+
"oneOf": [
13+
{ "enum": [ "team", "judge", "admin", "analyst", "staff" ] },
14+
{ "type": "null" }
15+
]
16+
},
17+
"ip": { "type": ["string", "null"] },
18+
"team_id": { "$ref": "common.json#/identifierornull" },
19+
"person_id": { "$ref": "common.json#/identifierornull" }
20+
},
21+
"required": ["id", "username", "type"],
22+
"$ref": "common.json#/strictproperties"
23+
}

contest-api/json-schema/accounts.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "CLICS Contest API: accounts",
4+
"description": "JSON response of this API call",
5+
6+
"type": "array",
7+
"uniqueItems": true,
8+
"$ref": "common.json#/nonemptyarray",
9+
"items": {
10+
"$ref": "account.json#"
11+
}
12+
}

contest-api/json-schema/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"problems",
1212
"groups",
1313
"organizations",
14+
"persons",
1415
"team-members",
16+
"accounts",
1517
"teams",
1618
"state",
1719
"submissions",

contest-api/json-schema/event-feed.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
{ "$ref": "group.json#" },
2323
{ "$ref": "organization.json#" },
2424
{ "$ref": "team.json#" },
25+
{ "$ref": "person.json#" },
2526
{ "$ref": "team-member.json#" },
27+
{ "$ref": "account.json#" },
2628
{ "$ref": "state.json#" },
2729
{ "$ref": "submission.json#" },
2830
{ "$ref": "judgement.json#" },

contest-api/json-schema/person.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "CLICS Contest API - person",
4+
"description": "Definition of a single person object",
5+
6+
"type": "object",
7+
"properties": {
8+
"id": { "$ref": "common.json#/identifier" },
9+
"team_id": { "$ref": "common.json#/identifier" },
10+
"icpc_id": { "type": [ "string", "null" ] },
11+
"name": { "type": "string" },
12+
"title": { "type": [ "string", "null" ] },
13+
"email": { "type": [ "string", "null" ] },
14+
"sex": {
15+
"oneOf": [
16+
{ "enum": [ "male", "female" ] },
17+
{ "type": "null" }
18+
]
19+
},
20+
"role": { "enum": [ "contestant", "coach", "staff" ] },
21+
"photo": { "$ref": "common.json#/imagerefsornull" }
22+
},
23+
"required": ["id", "team_id", "name", "role"],
24+
"$ref": "common.json#/strictproperties"
25+
}

contest-api/json-schema/persons.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "CLICS Contest API: persons",
4+
"description": "JSON response of this API call",
5+
6+
"type": "array",
7+
"uniqueItems": true,
8+
"$ref": "common.json#/nonemptyarray",
9+
"items": {
10+
"$ref": "person.json#"
11+
}
12+
}

0 commit comments

Comments
 (0)