forked from opensearch-project/opensearch-api-specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_story.schema.yaml
193 lines (179 loc) · 4.59 KB
/
test_story.schema.yaml
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
$schema: https://json-schema.org/draft/2019-09/schema
type: object
properties:
$schema:
type: string
description:
type: string
prologues:
type: array
items:
$ref: '#/definitions/SupplementalChapter'
epilogues:
type: array
items:
$ref: '#/definitions/SupplementalChapter'
chapters:
type: array
items:
$ref: '#/definitions/Chapter'
version:
$ref: '#/definitions/Version'
required: [chapters,description]
additionalProperties: false
definitions:
Chapter:
unevaluatedProperties: false
allOf:
- $ref: '#/definitions/ChapterRequest'
- properties:
synopsis:
type: string
description: A brief description of the chapter.
response:
$ref: '#/definitions/ExpectedResponse'
warnings:
$ref: '#/definitions/Warnings'
required: [synopsis]
ReadChapter:
allOf:
- $ref: '#/definitions/Chapter'
- type: object
properties:
response:
$ref: '#/definitions/ActualResponse'
required: [response]
additionalProperties: false
SupplementalChapter:
unevaluatedProperties: false
allOf:
- $ref: '#/definitions/ChapterRequest'
- type: object
properties:
status:
description: Array of success HTTP status codes. Default to [200, 201].
type: array
default: [200, 201]
items:
type: integer
ChapterRequest:
type: object
properties:
id:
type: string
description: A unique identifier for the chapter, useful for accessing outputs.
path:
type: string
method:
type: string
# eslint-disable-next-line yml/sort-sequence-values
enum: [GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS]
parameters:
type: object
additionalProperties:
$ref: '#/definitions/Parameter'
request_body:
$ref: '#/definitions/RequestBody'
output:
$ref: '#/definitions/Output'
version:
$ref: '#/definitions/Version'
retry:
$ref: '#/definitions/Retry'
required: [method, path]
Output:
description: |
Describes output for a chapter.
The keys are the names for the variable in the chapter output.
The values are paths to the values in the response.
The values should be in the form:
- `payload.<payload-path>` for the payload
- `headers.<header-name>` for the headers
type: object
additionalProperties:
type: string
Version:
description: |
The semver range to execute the story or chapter against.
type: string
Retry:
description: |
Number of times to retry on error.
oneOf:
- type: object
properties:
count:
type: integer
description: Number of retries.
wait:
type: integer
description: Number of milliseconds to wait before retrying.
required:
- count
RequestBody:
type: object
properties:
content_type:
type: string
default: application/json
payload:
$ref: '#/definitions/Payload'
required: [payload]
additionalProperties: false
ExpectedResponse:
type: object
properties:
status:
type: integer
description: The expected HTTP status code. Default to 200.
default: 200
content_type:
type: string
default: application/json
payload:
$ref: '#/definitions/Payload'
required: [status]
additionalProperties: false
ActualResponse:
type: object
properties:
status:
type: integer
content_type:
type: string
payload:
$ref: '#/definitions/Payload'
message:
type: string
description: Error message for non 2XX responses.
error:
type: object
description: Error object.
required: [content_type, payload, status]
additionalProperties: false
Payload:
anyOf:
- type: object
- type: array
- type: string
- type: number
- type: boolean
Parameter:
anyOf:
- type: array
items:
oneOf:
- type: string
- type: number
- type: boolean
- type: string
- type: number
- type: boolean
Warnings:
type: object
properties:
multiple-paths-detected:
type: boolean
default: true
description: Enable/disable warnings about multiple paths being tested in the same story.
additionalProperties: false