Skip to content

Commit 2ee86ec

Browse files
committed
Check that submission entry_point is present for Java and absent for C/C++.
1 parent 4023a6f commit 2ee86ec

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

contest-api/json-schema/submission.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,33 @@
1616
"reaction": { "$ref": "common.json#/filerefsornull" }
1717
},
1818
"required": ["id", "language_id", "problem_id", "team_id", "time", "contest_time", "files"],
19+
"oneOf": [
20+
{
21+
"properties": {
22+
"language_id": { "enum": ["java"] }
23+
},
24+
"required": ["entry_point"]
25+
},
26+
{
27+
"properties": {
28+
"language_id": { "enum": ["c", "cpp"] }
29+
},
30+
"oneOf": [
31+
{
32+
"not": { "required": ["entry_point"] }
33+
},
34+
{
35+
"properties": { "entry_point": { "type": "null" } }
36+
}
37+
]
38+
},
39+
{
40+
"not": {
41+
"properties": {
42+
"language_id": { "enum": ["java", "c", "cpp"] }
43+
}
44+
}
45+
}
46+
],
1947
"$ref": "common.json#/strictproperties"
2048
}

0 commit comments

Comments
 (0)