-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_suite_schema.json
100 lines (100 loc) · 2.9 KB
/
test_suite_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
{
"id": "https://raw.githubusercontent.com/JSONScript/jsonscript-test/master/test_suite_schema.json",
"$schema": "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#",
"description": "schema for the test suite of the JSONScript scripts",
"definitions": {
"nonEmptyString": {
"id": "#nonEmptyString",
"type": "string",
"minLength": 1
}
},
"type": "array",
"minItems": 1,
"items": {
"description": "set of tests for one script or for one data instance",
"type": "object",
"required": [ "description", "tests" ],
"oneOf": [
{
"description": "required 'script' can be in the set of tests or in the test, but not in both",
"required": [ "script" ]
},
{
"properties": {
"tests": {
"items": {
"required": [ "script" ]
}
}
}
}
],
"not": {
"anyOf": [
{
"description": "optional 'data' can be in the set of tests or in the test, but not in both",
"required": [ "data" ],
"properties": {
"tests": {
"items": {
"required": [ "data" ]
}
}
}
},
{
"description": "'only' and 'skip' cannot be used at the same time",
"required": [ "only", "skip" ]
}
]
},
"properties": {
"description": { "$ref": "#nonEmptyString" },
"only": { "type": "boolean" },
"skip": { "type": "boolean" },
"script": {
"description": "JSONScript to test",
"$ref": "http://www.jsonscript.org/schema/schema.json#"
},
"data": {
"description": "data instance, can be any type"
},
"tests": {
"type": "array",
"minItems": 1,
"items": {
"description": "one test, should either have 'result' or 'error' property but not both",
"type": "object",
"required": [ "description" ],
"oneOf": [
{ "required": [ "result" ] },
{ "required": [ "error" ] }
],
"properties": {
"description": { "$ref": "#nonEmptyString" },
"only": { "type": "boolean" },
"skip": { "type": "boolean" },
"script": {
"description": "JSONScript to test",
"$ref": "http://www.jsonscript.org/schema/schema.json#"
},
"data": {
"description": "data instance, can be any type"
},
"result": {
"description": "the result of script evaluation with the data instance"
},
"error": {
"description": "expected error message",
"anyOf": [
{ "enum": [ true ] },
{ "$ref": "#nonEmptyString" }
]
}
}
}
}
}
}
}