Skip to content

Commit 41732db

Browse files
committed
Refactor a single test into the "definitions" area
1 parent 2fc576e commit 41732db

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

test-schema.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,30 @@
2020
"items": {"$ref": "#/definitions/outputItem"}
2121
}
2222
}
23+
},
24+
"test": {
25+
"type": "object",
26+
"required": ["description", "data", "valid"],
27+
"properties": {
28+
"id": {
29+
"description": "Uniquely identifies a single test",
30+
"type": "string",
31+
"format": "uri"
32+
},
33+
"description": {"type": "string"},
34+
"data": {},
35+
"valid": {"type": "boolean"},
36+
"output": {
37+
"type": "object",
38+
"properties": {
39+
"basic": {"$ref": "#/definitions/outputItem"},
40+
"detailed": {"$ref": "#/definitions/outputItem"},
41+
"verbose": {"$ref": "#/definitions/outputItem"}
42+
},
43+
"required": ["basic", "detailed", "verbose"]
44+
}
45+
},
46+
"additionalProperties": false
2347
}
2448
},
2549
"type": "array",
@@ -36,30 +60,7 @@
3660
"schema": {},
3761
"tests": {
3862
"type": "array",
39-
"items": {
40-
"type": "object",
41-
"required": ["description", "data", "valid"],
42-
"properties": {
43-
"id": {
44-
"description": "Uniquely identifies a single test",
45-
"type": "string",
46-
"format": "uri"
47-
},
48-
"description": {"type": "string"},
49-
"data": {},
50-
"valid": {"type": "boolean"},
51-
"output": {
52-
"type": "object",
53-
"properties": {
54-
"basic": {"$ref": "#/definitions/outputItem"},
55-
"detailed": {"$ref": "#/definitions/outputItem"},
56-
"verbose": {"$ref": "#/definitions/outputItem"}
57-
},
58-
"required": ["basic", "detailed", "verbose"]
59-
}
60-
},
61-
"additionalProperties": false
62-
},
63+
"items": { "$ref": "#/definitions/test" },
6364
"minItems": 1
6465
}
6566
},

0 commit comments

Comments
 (0)