forked from FHIR/sql-on-fhir-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.schema.json
109 lines (109 loc) · 3.02 KB
/
tests.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
{
"$id": "http://hl7.org/fhir/uv/sql-on-fhir/tests",
"title": "SQL on FHIR tests schema",
"description": "Standard format for JSON test definitions used to validate SQL on FHIR view runner implementations.",
"type": "object",
"required": [
"title",
"resources",
"tests"
],
"properties": {
"title": {
"type": "string",
"description": "The name of the test suite."
},
"description": {
"type": "string",
"description": "A description of the test suite."
},
"allowExtendedFhirpath": {
"type": "boolean",
"description": "If true, the test runner should allow the use of FHIRPath functions outside of the restricted subset defined in the specification."
},
"authors": {
"type": "array",
"items": {
"type": "string"
},
"description": "The authors of the test suite."
},
"generated": {
"type": "boolean",
"description": "If true, the test suite was generated by a tool and should not be edited directly."
},
"resources": {
"type": "array",
"items": {
"type": "object"
},
"description": "A list of FHIR resources that are used in the tests. There can be multiple different resource types in the list. Each should be a valid FHIR resource."
},
"tests": {
"type": "array",
"description": "A list of tests to run against the view.",
"minItems": 1,
"items": {
"type": "object",
"required": [
"title",
"view"
],
"oneOf": [
{
"required": [
"expect"
]
},
{
"required": [
"expectCount"
]
},
{
"required": [
"expectError"
]
}
],
"properties": {
"title": {
"type": "string",
"description": "The name of the test."
},
"description": {
"type": "string",
"description": "A description of the test."
},
"view": {
"type": "object",
"description": "The view to run the test against."
},
"expect": {
"type": "array",
"description": "The expected result of the test. Each object within the array represents a row in the result set, with column names as keys.",
"items": {
"type": "object"
}
},
"expectCount": {
"type": "number",
"description": "The expected number of rows in the result."
},
"expectError": {
"type": "boolean",
"description": "If true, the test is expected to throw an error."
},
"expectColumns": {
"type": "array",
"description": "The expected columns in the result set.",
"items": {
"type": "string"
},
"minItems": 1
}
}
}
}
}
}