|
1 | 1 | { |
2 | | - "$schema": "http://json-schema.org/draft-06/schema#", |
3 | | - "description": "Schema for tests", |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "description": "A schema for files contained within this suite", |
| 4 | + |
4 | 5 | "type": "array", |
| 6 | + "minItems": 1, |
5 | 7 | "items": { |
| 8 | + "description": "An individual test case, containing multiple tests of a single schema's behavior", |
| 9 | + |
6 | 10 | "type": "object", |
7 | 11 | "required": [ "description", "schema", "tests" ], |
8 | 12 | "properties": { |
9 | | - "id": { |
10 | | - "description": "Uniquely identifies a set of tests", |
11 | | - "type": "string", |
12 | | - "format": "uri" |
13 | | - }, |
14 | 13 | "description": { |
15 | | - "description": "The test set description", |
| 14 | + "description": "The test case description", |
16 | 15 | "type": "string" |
17 | 16 | }, |
18 | 17 | "comment": { |
19 | | - "description": "Any additional comments about the test set", |
| 18 | + "description": "Any additional comments about the test case", |
20 | 19 | "type": "string" |
21 | 20 | }, |
22 | 21 | "schema": { |
23 | | - "description": "This should be a valid schema. This should be a ref to a meta-schema if schema keywords need testing." |
| 22 | + "description": "A valid JSON Schema (one written for the corresponding version directory that the file sits within)." |
24 | 23 | }, |
25 | 24 | "tests": { |
26 | 25 | "description": "A set of related tests all using the same schema", |
27 | 26 | "type": "array", |
28 | | - "items": { "$ref": "#/definitions/test" }, |
| 27 | + "items": { "$ref": "#/$defs/test" }, |
29 | 28 | "minItems": 1 |
30 | 29 | } |
31 | 30 | }, |
32 | | - "additionalProperties": false, |
33 | | - "minItems": 1 |
| 31 | + "additionalProperties": false |
34 | 32 | }, |
35 | | - "definitions": { |
36 | | - "outputItem": { |
37 | | - "type": "object", |
38 | | - "properties": { |
39 | | - "valid": { "type": "boolean" }, |
40 | | - "keywordLocation": { "type": "string" }, |
41 | | - "absoluteKeywordLocation": { |
42 | | - "type": "string", |
43 | | - "format": "uri" |
44 | | - }, |
45 | | - "instanceLocation": { "type": "string" }, |
46 | | - "annotations": { |
47 | | - "type": "array", |
48 | | - "items": { "$ref": "#/definitions/outputItem" } |
49 | | - }, |
50 | | - "errors": { |
51 | | - "type": "array", |
52 | | - "items": { "$ref": "#/definitions/outputItem" } |
53 | | - } |
54 | | - } |
55 | | - }, |
| 33 | + |
| 34 | + "$defs": { |
56 | 35 | "test": { |
57 | 36 | "description": "A single test", |
| 37 | + |
58 | 38 | "type": "object", |
59 | 39 | "required": [ "description", "data", "valid" ], |
60 | 40 | "properties": { |
61 | | - "id": { |
62 | | - "description": "Uniquely identifies a single test", |
63 | | - "type": "string", |
64 | | - "format": "uri" |
65 | | - }, |
66 | 41 | "description": { |
67 | | - "description": "The test description", |
| 42 | + "description": "The test description, briefly explaining which behavior it exercises", |
68 | 43 | "type": "string" |
69 | 44 | }, |
70 | 45 | "comment": { |
71 | 46 | "description": "Any additional comments about the test", |
72 | 47 | "type": "string" |
73 | 48 | }, |
74 | 49 | "data": { |
75 | | - "description": "This is the instance to be validated against the schema in \"schema\"." |
| 50 | + "description": "The instance which should be validated against the schema in \"schema\"." |
76 | 51 | }, |
77 | | - "valid": { "type": "boolean" }, |
78 | | - "output": { |
79 | | - "type": "object", |
80 | | - "required": [ "basic", "detailed", "verbose" ], |
81 | | - "properties": { |
82 | | - "basic": { "$ref": "#/definitions/outputItem" }, |
83 | | - "detailed": { "$ref": "#/definitions/outputItem" }, |
84 | | - "verbose": { "$ref": "#/definitions/outputItem" } |
85 | | - } |
| 52 | + "valid": { |
| 53 | + "description": "Whether the validation process of this instance should consider the instance valid or not", |
| 54 | + "type": "boolean" |
86 | 55 | } |
87 | 56 | }, |
88 | 57 | "additionalProperties": false |
|
0 commit comments