Skip to content

Commit b3b81f4

Browse files
committed
Update the test schema: add test ID, add descriptions, refactor
1 parent d17e1ba commit b3b81f4

File tree

1 file changed

+46
-38
lines changed

1 file changed

+46
-38
lines changed

test-schema.json

+46-38
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,67 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"description": "Schema for tests",
4+
"type": "array",
5+
"items": {
6+
"type": "object",
7+
"required": [ "description", "schema", "tests" ],
8+
"properties": {
9+
"id": {
10+
"description": "Uniquely identifies a single test",
11+
"type": "string",
12+
"format": "uri"
13+
},
14+
"description": { "type": "string" },
15+
"schema": {},
16+
"tests": {
17+
"type": "array",
18+
"items": { "$ref": "#/definitions/test" },
19+
"minItems": 1
20+
}
21+
},
22+
"additionalProperties": false,
23+
"minItems": 1
24+
},
325
"definitions": {
426
"outputItem": {
527
"type": "object",
628
"properties": {
7-
"valid": {"type": "boolean"},
8-
"keywordLocation": {"type": "string"},
29+
"valid": { "type": "boolean" },
30+
"keywordLocation": { "type": "string" },
931
"absoluteKeywordLocation": {
1032
"type": "string",
1133
"format": "uri"
1234
},
13-
"instanceLocation": {"type": "string"},
35+
"instanceLocation": { "type": "string" },
1436
"annotations": {
1537
"type": "array",
16-
"items": {"$ref": "#/definitions/outputItem"}
38+
"items": { "$ref": "#/definitions/outputItem" }
1739
},
1840
"errors": {
1941
"type": "array",
20-
"items": {"$ref": "#/definitions/outputItem"}
42+
"items": { "$ref": "#/definitions/outputItem" }
2143
}
2244
}
23-
}
24-
},
25-
"type": "array",
26-
"items": {
27-
"type": "object",
28-
"required": ["description", "schema", "tests"],
29-
"properties": {
30-
"description": {"type": "string"},
31-
"schema": {},
32-
"tests": {
33-
"type": "array",
34-
"items": {
45+
},
46+
"test": {
47+
"description": "A single test",
48+
"type": "object",
49+
"required": [ "description", "data", "valid" ],
50+
"properties": {
51+
"description": { "type": "string" },
52+
"data": {},
53+
"valid": { "type": "boolean" },
54+
"output": {
3555
"type": "object",
36-
"required": ["description", "data", "valid"],
56+
"required": [ "basic", "detailed", "verbose" ],
3757
"properties": {
38-
"description": {"type": "string"},
39-
"data": {},
40-
"valid": {"type": "boolean"},
41-
"output": {
42-
"type": "object",
43-
"properties": {
44-
"basic": {"$ref": "#/definitions/outputItem"},
45-
"detailed": {"$ref": "#/definitions/outputItem"},
46-
"verbose": {"$ref": "#/definitions/outputItem"}
47-
},
48-
"required": ["basic", "detailed", "verbose"]
49-
}
50-
},
51-
"additionalProperties": false
52-
},
53-
"minItems": 1
54-
}
55-
},
56-
"additionalProperties": false,
57-
"minItems": 1
58+
"basic": { "$ref": "#/definitions/outputItem" },
59+
"detailed": { "$ref": "#/definitions/outputItem" },
60+
"verbose": { "$ref": "#/definitions/outputItem" }
61+
}
62+
}
63+
},
64+
"additionalProperties": false
65+
}
5866
}
5967
}

0 commit comments

Comments
 (0)