doc-detective-common 3.0.4-dev.0 → 3.0.4-dev.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-detective-common",
3
- "version": "3.0.4-dev.0",
3
+ "version": "3.0.4-dev.2",
4
4
  "description": "Shared components for Doc Detective projects.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -32,6 +32,6 @@
32
32
  "ajv-keywords": "^5.1.0",
33
33
  "axios": "^1.9.0",
34
34
  "uuid": "^11.1.0",
35
- "yaml": "^2.7.1"
35
+ "yaml": "^2.8.0"
36
36
  }
37
37
  }
@@ -2196,6 +2196,12 @@
2196
2196
  "type": "string",
2197
2197
  "description": "URL or local path to the OpenAPI description."
2198
2198
  },
2199
+ "definition": {
2200
+ "type": "object",
2201
+ "readOnly": true,
2202
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
2203
+ "additionalProperties": true
2204
+ },
2199
2205
  "operationId": {
2200
2206
  "type": "string",
2201
2207
  "description": "ID of the operation to use for the request."
@@ -2550,6 +2556,12 @@
2550
2556
  "type": "string",
2551
2557
  "description": "URL or local path to the OpenAPI description."
2552
2558
  },
2559
+ "definition": {
2560
+ "type": "object",
2561
+ "readOnly": true,
2562
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
2563
+ "additionalProperties": true
2564
+ },
2553
2565
  "operationId": {
2554
2566
  "type": "string",
2555
2567
  "description": "ID of the operation to use for the request."
@@ -5138,6 +5150,12 @@
5138
5150
  "type": "string",
5139
5151
  "description": "URL or local path to the OpenAPI description."
5140
5152
  },
5153
+ "definition": {
5154
+ "type": "object",
5155
+ "readOnly": true,
5156
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
5157
+ "additionalProperties": true
5158
+ },
5141
5159
  "operationId": {
5142
5160
  "type": "string",
5143
5161
  "description": "ID of the operation to use for the request."
@@ -6913,6 +6931,12 @@
6913
6931
  "type": "string",
6914
6932
  "description": "URL or local path to the OpenAPI description."
6915
6933
  },
6934
+ "definition": {
6935
+ "type": "object",
6936
+ "readOnly": true,
6937
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
6938
+ "additionalProperties": true
6939
+ },
6916
6940
  "operationId": {
6917
6941
  "type": "string",
6918
6942
  "description": "ID of the operation to use for the request."
@@ -7267,6 +7291,12 @@
7267
7291
  "type": "string",
7268
7292
  "description": "URL or local path to the OpenAPI description."
7269
7293
  },
7294
+ "definition": {
7295
+ "type": "object",
7296
+ "readOnly": true,
7297
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
7298
+ "additionalProperties": true
7299
+ },
7270
7300
  "operationId": {
7271
7301
  "type": "string",
7272
7302
  "description": "ID of the operation to use for the request."
@@ -81,6 +81,12 @@
81
81
  "type": "string",
82
82
  "description": "URL or local path to the OpenAPI description."
83
83
  },
84
+ "definition": {
85
+ "type": "object",
86
+ "readOnly": true,
87
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
88
+ "additionalProperties": true
89
+ },
84
90
  "operationId": {
85
91
  "type": "string",
86
92
  "description": "ID of the operation to use for the request."
@@ -435,6 +441,12 @@
435
441
  "type": "string",
436
442
  "description": "URL or local path to the OpenAPI description."
437
443
  },
444
+ "definition": {
445
+ "type": "object",
446
+ "readOnly": true,
447
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
448
+ "additionalProperties": true
449
+ },
438
450
  "operationId": {
439
451
  "type": "string",
440
452
  "description": "ID of the operation to use for the request."
@@ -26,6 +26,12 @@
26
26
  "type": "string",
27
27
  "description": "URL or local path to the OpenAPI description."
28
28
  },
29
+ "definition": {
30
+ "type": "object",
31
+ "readOnly": true,
32
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
33
+ "additionalProperties": true
34
+ },
29
35
  "operationId": {
30
36
  "type": "string",
31
37
  "description": "ID of the operation to use for the request."
@@ -438,6 +438,12 @@
438
438
  "type": "string",
439
439
  "description": "URL or local path to the OpenAPI description."
440
440
  },
441
+ "definition": {
442
+ "type": "object",
443
+ "readOnly": true,
444
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
445
+ "additionalProperties": true
446
+ },
441
447
  "operationId": {
442
448
  "type": "string",
443
449
  "description": "ID of the operation to use for the request."
@@ -1006,6 +1012,12 @@
1006
1012
  "type": "string",
1007
1013
  "description": "URL or local path to the OpenAPI description."
1008
1014
  },
1015
+ "definition": {
1016
+ "type": "object",
1017
+ "readOnly": true,
1018
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
1019
+ "additionalProperties": true
1020
+ },
1009
1021
  "operationId": {
1010
1022
  "type": "string",
1011
1023
  "description": "ID of the operation to use for the request."
@@ -2624,6 +2636,12 @@
2624
2636
  "type": "string",
2625
2637
  "description": "URL or local path to the OpenAPI description."
2626
2638
  },
2639
+ "definition": {
2640
+ "type": "object",
2641
+ "readOnly": true,
2642
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
2643
+ "additionalProperties": true
2644
+ },
2627
2645
  "operationId": {
2628
2646
  "type": "string",
2629
2647
  "description": "ID of the operation to use for the request."
@@ -2978,6 +2996,12 @@
2978
2996
  "type": "string",
2979
2997
  "description": "URL or local path to the OpenAPI description."
2980
2998
  },
2999
+ "definition": {
3000
+ "type": "object",
3001
+ "readOnly": true,
3002
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
3003
+ "additionalProperties": true
3004
+ },
2981
3005
  "operationId": {
2982
3006
  "type": "string",
2983
3007
  "description": "ID of the operation to use for the request."
@@ -5252,7 +5276,8 @@
5252
5276
  }
5253
5277
  },
5254
5278
  "contexts": {
5255
- "array": "array",
5279
+ "title": "Resolved contexts",
5280
+ "type": "array",
5256
5281
  "readOnly": true,
5257
5282
  "description": "Resolved contexts to run the test in. This is a resolved version of the `runOn` property. It is not user-defined and should not be used in test specifications.",
5258
5283
  "items": {
@@ -5318,6 +5343,185 @@
5318
5343
  }
5319
5344
  }
5320
5345
  },
5346
+ "openApi": {
5347
+ "type": "array",
5348
+ "items": {
5349
+ "allOf": [
5350
+ {
5351
+ "version": "1.0.0",
5352
+ "$schema": "http://json-schema.org/draft-07/schema#",
5353
+ "title": "openApi",
5354
+ "type": "object",
5355
+ "description": "OpenAPI description and configuration.",
5356
+ "additionalProperties": false,
5357
+ "anyOf": [
5358
+ {
5359
+ "required": [
5360
+ "descriptionPath"
5361
+ ]
5362
+ },
5363
+ {
5364
+ "required": [
5365
+ "operationId"
5366
+ ]
5367
+ }
5368
+ ],
5369
+ "properties": {
5370
+ "name": {
5371
+ "type": "string",
5372
+ "description": "Name of the OpenAPI description, as defined in your configuration."
5373
+ },
5374
+ "descriptionPath": {
5375
+ "type": "string",
5376
+ "description": "URL or local path to the OpenAPI description."
5377
+ },
5378
+ "definition": {
5379
+ "type": "object",
5380
+ "readOnly": true,
5381
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
5382
+ "additionalProperties": true
5383
+ },
5384
+ "operationId": {
5385
+ "type": "string",
5386
+ "description": "ID of the operation to use for the request."
5387
+ },
5388
+ "server": {
5389
+ "type": "string",
5390
+ "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 description."
5391
+ },
5392
+ "validateAgainstSchema": {
5393
+ "type": "string",
5394
+ "description": "Validates the request and/or response against the schema in the OpenAPI description. If the request or response doesn't match the schema, the step fails.",
5395
+ "enum": [
5396
+ "request",
5397
+ "response",
5398
+ "both",
5399
+ "none"
5400
+ ],
5401
+ "default": "both"
5402
+ },
5403
+ "mockResponse": {
5404
+ "type": "boolean",
5405
+ "description": "If `true`, doesn't make the HTTP request, but instead uses the response example or schema from the OpenAPI description 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."
5406
+ },
5407
+ "statusCode": {
5408
+ "type": "integer",
5409
+ "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."
5410
+ },
5411
+ "useExample": {
5412
+ "type": [
5413
+ "string"
5414
+ ],
5415
+ "description": "Uses the example from the OpenAPI description 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.",
5416
+ "enum": [
5417
+ "request",
5418
+ "response",
5419
+ "both",
5420
+ "none"
5421
+ ],
5422
+ "default": "none"
5423
+ },
5424
+ "exampleKey": {
5425
+ "type": "string",
5426
+ "description": "Key of the example to use from the `examples` property in the OpenAPI description. If an `examples` key isn't specified or isn't available for a given parameter or object, the `example` property value is used.",
5427
+ "default": ""
5428
+ },
5429
+ "headers": {
5430
+ "type": "object",
5431
+ "description": "Request headers to add to requests. For example, to set `Authorization` headers for all requests from the specified OpenAPI document. If specified in both a config and a step, the step value overrides the config value.",
5432
+ "additionalProperties": {
5433
+ "type": "string"
5434
+ }
5435
+ }
5436
+ },
5437
+ "components": {
5438
+ "schemas": {
5439
+ "operationId": {
5440
+ "type": "string",
5441
+ "description": "ID of the operation to use for the request."
5442
+ },
5443
+ "descriptionPath": {
5444
+ "type": "string",
5445
+ "description": "URL or local path to the OpenAPI description."
5446
+ }
5447
+ }
5448
+ },
5449
+ "examples": [
5450
+ {
5451
+ "descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
5452
+ },
5453
+ {
5454
+ "name": "Reqres",
5455
+ "operationId": "getUserById"
5456
+ },
5457
+ {
5458
+ "descriptionPath": "https://api.example.com/openapi.json",
5459
+ "operationId": "getUserById"
5460
+ },
5461
+ {
5462
+ "descriptionPath": "https://api.example.com/openapi.json",
5463
+ "operationId": "createUser",
5464
+ "useExample": "both"
5465
+ },
5466
+ {
5467
+ "descriptionPath": "https://api.example.com/openapi.json",
5468
+ "operationId": "createUser",
5469
+ "useExample": "both",
5470
+ "exampleKey": "example1"
5471
+ },
5472
+ {
5473
+ "descriptionPath": "https://api.example.com/openapi.json",
5474
+ "operationId": "createUser",
5475
+ "useExample": "both",
5476
+ "exampleKey": "example1",
5477
+ "statusCode": 201
5478
+ },
5479
+ {
5480
+ "descriptionPath": "https://api.example.com/openapi.json",
5481
+ "operationId": "createUser",
5482
+ "useExample": "both",
5483
+ "exampleKey": "example1",
5484
+ "statusCode": 201,
5485
+ "validateAgainstSchema": "none"
5486
+ },
5487
+ {
5488
+ "descriptionPath": "https://api.example.com/openapi.json",
5489
+ "operationId": "createUser",
5490
+ "useExample": "both",
5491
+ "exampleKey": "example1",
5492
+ "statusCode": 201,
5493
+ "validateAgainstSchema": "none",
5494
+ "mockResponse": true
5495
+ },
5496
+ {
5497
+ "descriptionPath": "https://api.example.com/openapi.json",
5498
+ "operationId": "createUser",
5499
+ "useExample": "both",
5500
+ "exampleKey": "example1",
5501
+ "statusCode": 201,
5502
+ "validateAgainstSchema": "none",
5503
+ "mockResponse": true,
5504
+ "headers": {
5505
+ "Authorization": "Bearer 12345"
5506
+ }
5507
+ }
5508
+ ]
5509
+ },
5510
+ {
5511
+ "type": "object",
5512
+ "not": {
5513
+ "required": [
5514
+ "operationId"
5515
+ ]
5516
+ },
5517
+ "required": [
5518
+ "name",
5519
+ "descriptionPath"
5520
+ ]
5521
+ }
5522
+ ]
5523
+ }
5524
+ },
5321
5525
  "steps": {
5322
5526
  "description": "Steps to perform as part of the test. Performed in the sequence defined. If one or more actions fail, the test fails. By default, if a step fails, the test stops and the remaining steps are not executed.",
5323
5527
  "type": "array",
@@ -6787,6 +6991,12 @@
6787
6991
  "type": "string",
6788
6992
  "description": "URL or local path to the OpenAPI description."
6789
6993
  },
6994
+ "definition": {
6995
+ "type": "object",
6996
+ "readOnly": true,
6997
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
6998
+ "additionalProperties": true
6999
+ },
6790
7000
  "operationId": {
6791
7001
  "type": "string",
6792
7002
  "description": "ID of the operation to use for the request."
@@ -7141,6 +7351,12 @@
7141
7351
  "type": "string",
7142
7352
  "description": "URL or local path to the OpenAPI description."
7143
7353
  },
7354
+ "definition": {
7355
+ "type": "object",
7356
+ "readOnly": true,
7357
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
7358
+ "additionalProperties": true
7359
+ },
7144
7360
  "operationId": {
7145
7361
  "type": "string",
7146
7362
  "description": "ID of the operation to use for the request."
@@ -9434,6 +9650,189 @@
9434
9650
  }
9435
9651
  ],
9436
9652
  "additionalProperties": false,
9653
+ "components": {
9654
+ "schemas": {
9655
+ "openApi": {
9656
+ "type": "array",
9657
+ "items": {
9658
+ "allOf": [
9659
+ {
9660
+ "version": "1.0.0",
9661
+ "$schema": "http://json-schema.org/draft-07/schema#",
9662
+ "title": "openApi",
9663
+ "type": "object",
9664
+ "description": "OpenAPI description and configuration.",
9665
+ "additionalProperties": false,
9666
+ "anyOf": [
9667
+ {
9668
+ "required": [
9669
+ "descriptionPath"
9670
+ ]
9671
+ },
9672
+ {
9673
+ "required": [
9674
+ "operationId"
9675
+ ]
9676
+ }
9677
+ ],
9678
+ "properties": {
9679
+ "name": {
9680
+ "type": "string",
9681
+ "description": "Name of the OpenAPI description, as defined in your configuration."
9682
+ },
9683
+ "descriptionPath": {
9684
+ "type": "string",
9685
+ "description": "URL or local path to the OpenAPI description."
9686
+ },
9687
+ "definition": {
9688
+ "type": "object",
9689
+ "readOnly": true,
9690
+ "description": "OpenAPI definition object loaded from the `descriptionPath`. This is a resolved version of the OpenAPI description and should not be user-defined.",
9691
+ "additionalProperties": true
9692
+ },
9693
+ "operationId": {
9694
+ "type": "string",
9695
+ "description": "ID of the operation to use for the request."
9696
+ },
9697
+ "server": {
9698
+ "type": "string",
9699
+ "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 description."
9700
+ },
9701
+ "validateAgainstSchema": {
9702
+ "type": "string",
9703
+ "description": "Validates the request and/or response against the schema in the OpenAPI description. If the request or response doesn't match the schema, the step fails.",
9704
+ "enum": [
9705
+ "request",
9706
+ "response",
9707
+ "both",
9708
+ "none"
9709
+ ],
9710
+ "default": "both"
9711
+ },
9712
+ "mockResponse": {
9713
+ "type": "boolean",
9714
+ "description": "If `true`, doesn't make the HTTP request, but instead uses the response example or schema from the OpenAPI description 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."
9715
+ },
9716
+ "statusCode": {
9717
+ "type": "integer",
9718
+ "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."
9719
+ },
9720
+ "useExample": {
9721
+ "type": [
9722
+ "string"
9723
+ ],
9724
+ "description": "Uses the example from the OpenAPI description 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.",
9725
+ "enum": [
9726
+ "request",
9727
+ "response",
9728
+ "both",
9729
+ "none"
9730
+ ],
9731
+ "default": "none"
9732
+ },
9733
+ "exampleKey": {
9734
+ "type": "string",
9735
+ "description": "Key of the example to use from the `examples` property in the OpenAPI description. If an `examples` key isn't specified or isn't available for a given parameter or object, the `example` property value is used.",
9736
+ "default": ""
9737
+ },
9738
+ "headers": {
9739
+ "type": "object",
9740
+ "description": "Request headers to add to requests. For example, to set `Authorization` headers for all requests from the specified OpenAPI document. If specified in both a config and a step, the step value overrides the config value.",
9741
+ "additionalProperties": {
9742
+ "type": "string"
9743
+ }
9744
+ }
9745
+ },
9746
+ "components": {
9747
+ "schemas": {
9748
+ "operationId": {
9749
+ "type": "string",
9750
+ "description": "ID of the operation to use for the request."
9751
+ },
9752
+ "descriptionPath": {
9753
+ "type": "string",
9754
+ "description": "URL or local path to the OpenAPI description."
9755
+ }
9756
+ }
9757
+ },
9758
+ "examples": [
9759
+ {
9760
+ "descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
9761
+ },
9762
+ {
9763
+ "name": "Reqres",
9764
+ "operationId": "getUserById"
9765
+ },
9766
+ {
9767
+ "descriptionPath": "https://api.example.com/openapi.json",
9768
+ "operationId": "getUserById"
9769
+ },
9770
+ {
9771
+ "descriptionPath": "https://api.example.com/openapi.json",
9772
+ "operationId": "createUser",
9773
+ "useExample": "both"
9774
+ },
9775
+ {
9776
+ "descriptionPath": "https://api.example.com/openapi.json",
9777
+ "operationId": "createUser",
9778
+ "useExample": "both",
9779
+ "exampleKey": "example1"
9780
+ },
9781
+ {
9782
+ "descriptionPath": "https://api.example.com/openapi.json",
9783
+ "operationId": "createUser",
9784
+ "useExample": "both",
9785
+ "exampleKey": "example1",
9786
+ "statusCode": 201
9787
+ },
9788
+ {
9789
+ "descriptionPath": "https://api.example.com/openapi.json",
9790
+ "operationId": "createUser",
9791
+ "useExample": "both",
9792
+ "exampleKey": "example1",
9793
+ "statusCode": 201,
9794
+ "validateAgainstSchema": "none"
9795
+ },
9796
+ {
9797
+ "descriptionPath": "https://api.example.com/openapi.json",
9798
+ "operationId": "createUser",
9799
+ "useExample": "both",
9800
+ "exampleKey": "example1",
9801
+ "statusCode": 201,
9802
+ "validateAgainstSchema": "none",
9803
+ "mockResponse": true
9804
+ },
9805
+ {
9806
+ "descriptionPath": "https://api.example.com/openapi.json",
9807
+ "operationId": "createUser",
9808
+ "useExample": "both",
9809
+ "exampleKey": "example1",
9810
+ "statusCode": 201,
9811
+ "validateAgainstSchema": "none",
9812
+ "mockResponse": true,
9813
+ "headers": {
9814
+ "Authorization": "Bearer 12345"
9815
+ }
9816
+ }
9817
+ ]
9818
+ },
9819
+ {
9820
+ "type": "object",
9821
+ "not": {
9822
+ "required": [
9823
+ "operationId"
9824
+ ]
9825
+ },
9826
+ "required": [
9827
+ "name",
9828
+ "descriptionPath"
9829
+ ]
9830
+ }
9831
+ ]
9832
+ }
9833
+ }
9834
+ }
9835
+ },
9437
9836
  "examples": [
9438
9837
  {
9439
9838
  "steps": [