Repository navigation
Expand file tree
/
Copy pathopenapi-schemas.config.js
More file actions
58 lines (53 loc) · 1.96 KB
/
Copy pathopenapi-schemas.config.js
File metadata and controls
58 lines (53 loc) · 1.96 KB
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
// What utilities/generate-openapi-schemas.js generates for the testing module's OpenAPI
// description (into openapi-schemas.json, which the loader merges into openapi.yaml's
// components). Regenerate after changing this:
//
// node utilities/generate-openapi-schemas.js testing
//
// tests/testing/openapi.test.js fails if the generated file is out of date, and checks that
// the overlay requires everything validateReport() in testing.js requires.
const ref = (name) => ({ $ref: `#/components/schemas/${name}` });
module.exports = {
package: 'hl7.fhir.r5.core#5.0.0',
roots: ['TestReport', 'OperationOutcome', 'Bundle'],
// reports may not contain resources (validateReport rejects them too)
prohibit: ['contained'],
overlay: {
TestReport: {
description: 'A TestReport, as this server accepts it: an R5 TestReport (or an R4 one - see testScript), ' +
'with name, tester, issued and at least one participant, and no contained resources.',
required: ['name', 'tester', 'issued', 'participant'],
properties: {
participant: { minItems: 1 },
testScript: {
$replace: true,
description: 'The TestScript that was run: a canonical (R5), or a Reference (R4)',
anyOf: [{ type: 'string' }, ref('Reference')]
}
}
},
// the search response: a Bundle of TestReports, plus an OperationOutcome entry
// (search.mode = outcome) when unknown parameters were ignored
TestReportSearchBundle: {
description: 'A searchset Bundle of TestReports',
allOf: [
ref('Bundle'),
{
type: 'object',
properties: {
type: { const: 'searchset' },
entry: {
type: 'array',
items: {
type: 'object',
properties: {
resource: { anyOf: [ref('TestReport'), ref('OperationOutcome')] }
}
}
}
}
}
]
}
}
};