doc-detective-common 1.21.0-openapi.9 → 1.21.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/package.json +10 -6
- package/src/files.js +64 -0
- package/src/index.js +7 -3
- package/src/resolvePaths.js +9 -9
- package/src/schemas/dereferenceSchemas.js +115 -115
- package/src/schemas/output_schemas/config_v2.schema.json +2581 -2577
- package/src/schemas/output_schemas/httpRequest_v2.schema.json +8 -6
- package/src/schemas/output_schemas/openApi_v2.schema.json +4 -2
- package/src/schemas/output_schemas/spec_v2.schema.json +2034 -1797
- package/src/schemas/output_schemas/test_v2.schema.json +123 -6
- package/src/schemas/schemas.json +7829 -7467
- package/src/schemas/src_schemas/checkLink_v2.schema.json +65 -65
- package/src/schemas/src_schemas/config_v2.schema.json +2 -2
- package/src/schemas/src_schemas/goTo_v2.schema.json +57 -57
- package/src/schemas/src_schemas/httpRequest_v2.schema.json +4 -4
- package/src/schemas/src_schemas/openApi_v2.schema.json +5 -2
- package/src/schemas/src_schemas/setVariables_v2.schema.json +37 -37
- package/src/schemas/src_schemas/spec_v2.schema.json +45 -0
- package/src/schemas/src_schemas/stopRecording_v2.schema.json +31 -31
- package/src/schemas/src_schemas/test_v2.schema.json +199 -159
- package/src/schemas/src_schemas/typeKeys_v2.schema.json +63 -63
- package/test/files.test.js +107 -0
- package/test/schema.test.js +24 -14
|
@@ -141,6 +141,101 @@
|
|
|
141
141
|
]
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
+
"openApi": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"items": {
|
|
147
|
+
"allOf": [
|
|
148
|
+
{
|
|
149
|
+
"version": "1.0.0",
|
|
150
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
151
|
+
"title": "openApi",
|
|
152
|
+
"type": "object",
|
|
153
|
+
"description": "OpenAPI definition and configuration.",
|
|
154
|
+
"additionalProperties": false,
|
|
155
|
+
"properties": {
|
|
156
|
+
"name": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "Name of the OpenAPI definition, as defined in your configuration."
|
|
159
|
+
},
|
|
160
|
+
"descriptionPath": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"description": "URL or local path to the OpenAPI definition."
|
|
163
|
+
},
|
|
164
|
+
"operationId": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"description": "ID of the operation to use for the request."
|
|
167
|
+
},
|
|
168
|
+
"server": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"description": "Server to use for example requests. Only valid if `useExample` is `request` or `both`. If not specified but an example is used for the request, uses the first server defined in the OpenAPI definition."
|
|
171
|
+
},
|
|
172
|
+
"validateAgainstSchema": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "Validates the request and/or response against the schema in the OpenAPI definition. If the request or response doesn't match the schema, the step fails.",
|
|
175
|
+
"enum": [
|
|
176
|
+
"request",
|
|
177
|
+
"response",
|
|
178
|
+
"both",
|
|
179
|
+
"none"
|
|
180
|
+
],
|
|
181
|
+
"default": "both"
|
|
182
|
+
},
|
|
183
|
+
"mockResponse": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"description": "If `true`, doesn't make the HTTP request, but instead uses the response example or schema from the OpenAPI definition as the response data. Useful for creating tests when an API isn't fully implemented yet. If `statusCode` isn't specified, uses the first defined response code."
|
|
186
|
+
},
|
|
187
|
+
"statusCode": {
|
|
188
|
+
"type": "integer",
|
|
189
|
+
"description": "Response code to use for validation, examples, and status code checking. If the response code doesn't match, the step fails. `statusCodes` overrides this value when specified."
|
|
190
|
+
},
|
|
191
|
+
"useExample": {
|
|
192
|
+
"type": [
|
|
193
|
+
"string"
|
|
194
|
+
],
|
|
195
|
+
"description": "Uses the example from the OpenAPI definition as the request and response data. If the request or response has multiple examples, specify `exampleKey`. If `statusCode` isn't specified, uses the first defined response code. `requestData`, `requestParams`, and `requestHeaders` override portions of request examples when specified. `responseData` overrides portions of response examples when specified.",
|
|
196
|
+
"enum": [
|
|
197
|
+
"request",
|
|
198
|
+
"response",
|
|
199
|
+
"both",
|
|
200
|
+
"none"
|
|
201
|
+
],
|
|
202
|
+
"default": "none"
|
|
203
|
+
},
|
|
204
|
+
"exampleKey": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"description": "Key of the example to use from the `examples` property in the OpenAPI definition. If an `examples` key isn't specified or isn't available for a given parameter or object, the `example` property value is used.",
|
|
207
|
+
"default": ""
|
|
208
|
+
},
|
|
209
|
+
"requestHeaders": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"description": "Request headers to add to the request. If specified in both a config and a step, the step value overrides the config value.",
|
|
212
|
+
"additionalProperties": {
|
|
213
|
+
"type": "string"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"examples": [
|
|
218
|
+
{
|
|
219
|
+
"descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"operationId": {
|
|
227
|
+
"type": "null",
|
|
228
|
+
"$commment": "Only allow operationId at the step level."
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"required": [
|
|
232
|
+
"name",
|
|
233
|
+
"descriptionPath"
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
},
|
|
144
239
|
"setup": {
|
|
145
240
|
"type": "string",
|
|
146
241
|
"description": "Path to a test specification to perform before this test, while maintaining this test's context. Useful for setting up testing environments. Only the `steps` property is used from the first test in the setup spec."
|
|
@@ -326,6 +421,8 @@
|
|
|
326
421
|
"openApi": {
|
|
327
422
|
"allOf": [
|
|
328
423
|
{
|
|
424
|
+
"version": "1.0.0",
|
|
425
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
329
426
|
"title": "openApi",
|
|
330
427
|
"type": "object",
|
|
331
428
|
"description": "OpenAPI definition and configuration.",
|
|
@@ -335,7 +432,7 @@
|
|
|
335
432
|
"type": "string",
|
|
336
433
|
"description": "Name of the OpenAPI definition, as defined in your configuration."
|
|
337
434
|
},
|
|
338
|
-
"
|
|
435
|
+
"descriptionPath": {
|
|
339
436
|
"type": "string",
|
|
340
437
|
"description": "URL or local path to the OpenAPI definition."
|
|
341
438
|
},
|
|
@@ -394,7 +491,7 @@
|
|
|
394
491
|
},
|
|
395
492
|
"examples": [
|
|
396
493
|
{
|
|
397
|
-
"
|
|
494
|
+
"descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
|
|
398
495
|
}
|
|
399
496
|
]
|
|
400
497
|
},
|
|
@@ -649,7 +746,7 @@
|
|
|
649
746
|
{
|
|
650
747
|
"action": "httpRequest",
|
|
651
748
|
"openApi": {
|
|
652
|
-
"
|
|
749
|
+
"descriptionPath": "https://api.example.com/openapi.json",
|
|
653
750
|
"operationId": "getUserById"
|
|
654
751
|
},
|
|
655
752
|
"requestParams": {
|
|
@@ -659,7 +756,7 @@
|
|
|
659
756
|
{
|
|
660
757
|
"action": "httpRequest",
|
|
661
758
|
"openApi": {
|
|
662
|
-
"
|
|
759
|
+
"descriptionPath": "https://api.example.com/openapi.json",
|
|
663
760
|
"operationId": "createUser",
|
|
664
761
|
"useExample": "both"
|
|
665
762
|
}
|
|
@@ -667,7 +764,7 @@
|
|
|
667
764
|
{
|
|
668
765
|
"action": "httpRequest",
|
|
669
766
|
"openApi": {
|
|
670
|
-
"
|
|
767
|
+
"descriptionPath": "https://api.example.com/openapi.json",
|
|
671
768
|
"operationId": "updateUser",
|
|
672
769
|
"useExample": "request",
|
|
673
770
|
"exampleKey": "acme"
|
|
@@ -676,7 +773,7 @@
|
|
|
676
773
|
{
|
|
677
774
|
"action": "httpRequest",
|
|
678
775
|
"openApi": {
|
|
679
|
-
"
|
|
776
|
+
"descriptionPath": "https://api.example.com/openapi.json",
|
|
680
777
|
"operationId": "updateUser",
|
|
681
778
|
"useExample": "request",
|
|
682
779
|
"exampleKey": "acme",
|
|
@@ -1535,6 +1632,26 @@
|
|
|
1535
1632
|
"action": "saveScreenshot"
|
|
1536
1633
|
}
|
|
1537
1634
|
]
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"openApi": [
|
|
1638
|
+
{
|
|
1639
|
+
"name": "Acme",
|
|
1640
|
+
"descriptionPath": "https://www.acme.com/openapi.json",
|
|
1641
|
+
"server": "https://api.acme.com"
|
|
1642
|
+
}
|
|
1643
|
+
],
|
|
1644
|
+
"steps": [
|
|
1645
|
+
{
|
|
1646
|
+
"action": "httpRequest",
|
|
1647
|
+
"openApi": {
|
|
1648
|
+
"operationId": "getUserById"
|
|
1649
|
+
},
|
|
1650
|
+
"requestParams": {
|
|
1651
|
+
"id": 123
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
]
|
|
1538
1655
|
}
|
|
1539
1656
|
]
|
|
1540
1657
|
}
|