-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy pathtest-schema.json
124 lines (119 loc) · 5.59 KB
/
test-schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/tests/test-schema",
"description": "A schema for files contained within this suite",
"type": "array",
"minItems": 1,
"items": {
"description": "An individual test case, containing multiple tests of a single schema's behavior",
"type": "object",
"required": [ "description", "schema", "tests" ],
"properties": {
"description": {
"description": "The test case description",
"type": "string"
},
"comment": {
"description": "Any additional comments about the test case",
"type": "string"
},
"schema": {
"description": "A valid JSON Schema (one written for the corresponding version directory that the file sits within)."
},
"tests": {
"description": "A set of related tests all using the same schema",
"type": "array",
"items": { "$ref": "#/$defs/test" },
"minItems": 1
},
"specification":{
"description": "A reference to a specification document which defines the behavior tested by this test case. Typically this should be a JSON Schema specification document, though in cases where the JSON Schema specification points to another RFC it should contain *both* the portion of the JSON Schema specification which indicates what RFC (and section) to follow as *well* as information on where in that specification the behavior is specified.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items":{
"properties": {
"core": {
"description": "A section in official JSON Schema core drafts",
"url": "https://json-schema.org/specification-links",
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
"type":"string"
},
"validation": {
"description": "A section in official JSON Schema validation drafts",
"url": "https://json-schema.org/specification-links",
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
"type":"string"
},
"ecma262": {
"description": "A section in official ECMA 262 specification for defining regular expressions",
"url": "https://262.ecma-international.org/",
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
"type":"string"
},
"perl5": {
"description": "A section name in Perl documentation for defining regular expressions",
"url": "https://perldoc.perl.org/perlre",
"type":"string"
},
"quote": {
"description": "Quote describing the test case",
"type":"string"
}
},
"patternProperties": {
"^rfc\\d+$": {
"description": "A section in official RFC for the given rfc number",
"url": "https://www.rfc-editor.org/",
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
"type":"string"
},
"^iso\\d+$": {
"description": "A section in official ISO for the given iso number",
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
"type": "string"
}
},
"additionalProperties": { "type": "string" },
"minProperties": 1,
"propertyNames": {
"oneOf": [
{
"pattern": "^((iso)|(rfc))[0-9]+$"
},
{
"enum": [ "core", "validation", "ecma262", "perl5", "quote" ]
}
]
}
}
}
},
"additionalProperties": false
},
"$defs": {
"test": {
"description": "A single test",
"type": "object",
"required": [ "description", "data", "valid" ],
"properties": {
"description": {
"description": "The test description, briefly explaining which behavior it exercises",
"type": "string"
},
"comment": {
"description": "Any additional comments about the test",
"type": "string"
},
"data": {
"description": "The instance which should be validated against the schema in \"schema\"."
},
"valid": {
"description": "Whether the validation process of this instance should consider the instance valid or not",
"type": "boolean"
}
},
"additionalProperties": false
}
}
}