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

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.1",
4
4
  "description": "Shared components for Doc Detective projects.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -5252,6 +5252,7 @@
5252
5252
  }
5253
5253
  },
5254
5254
  "contexts": {
5255
+ "title": "Resolved contexts",
5255
5256
  "array": "array",
5256
5257
  "readOnly": true,
5257
5258
  "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.",
@@ -5318,6 +5319,179 @@
5318
5319
  }
5319
5320
  }
5320
5321
  },
5322
+ "openApi": {
5323
+ "type": "array",
5324
+ "items": {
5325
+ "allOf": [
5326
+ {
5327
+ "version": "1.0.0",
5328
+ "$schema": "http://json-schema.org/draft-07/schema#",
5329
+ "title": "openApi",
5330
+ "type": "object",
5331
+ "description": "OpenAPI description and configuration.",
5332
+ "additionalProperties": false,
5333
+ "anyOf": [
5334
+ {
5335
+ "required": [
5336
+ "descriptionPath"
5337
+ ]
5338
+ },
5339
+ {
5340
+ "required": [
5341
+ "operationId"
5342
+ ]
5343
+ }
5344
+ ],
5345
+ "properties": {
5346
+ "name": {
5347
+ "type": "string",
5348
+ "description": "Name of the OpenAPI description, as defined in your configuration."
5349
+ },
5350
+ "descriptionPath": {
5351
+ "type": "string",
5352
+ "description": "URL or local path to the OpenAPI description."
5353
+ },
5354
+ "operationId": {
5355
+ "type": "string",
5356
+ "description": "ID of the operation to use for the request."
5357
+ },
5358
+ "server": {
5359
+ "type": "string",
5360
+ "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."
5361
+ },
5362
+ "validateAgainstSchema": {
5363
+ "type": "string",
5364
+ "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.",
5365
+ "enum": [
5366
+ "request",
5367
+ "response",
5368
+ "both",
5369
+ "none"
5370
+ ],
5371
+ "default": "both"
5372
+ },
5373
+ "mockResponse": {
5374
+ "type": "boolean",
5375
+ "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."
5376
+ },
5377
+ "statusCode": {
5378
+ "type": "integer",
5379
+ "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."
5380
+ },
5381
+ "useExample": {
5382
+ "type": [
5383
+ "string"
5384
+ ],
5385
+ "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.",
5386
+ "enum": [
5387
+ "request",
5388
+ "response",
5389
+ "both",
5390
+ "none"
5391
+ ],
5392
+ "default": "none"
5393
+ },
5394
+ "exampleKey": {
5395
+ "type": "string",
5396
+ "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.",
5397
+ "default": ""
5398
+ },
5399
+ "headers": {
5400
+ "type": "object",
5401
+ "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.",
5402
+ "additionalProperties": {
5403
+ "type": "string"
5404
+ }
5405
+ }
5406
+ },
5407
+ "components": {
5408
+ "schemas": {
5409
+ "operationId": {
5410
+ "type": "string",
5411
+ "description": "ID of the operation to use for the request."
5412
+ },
5413
+ "descriptionPath": {
5414
+ "type": "string",
5415
+ "description": "URL or local path to the OpenAPI description."
5416
+ }
5417
+ }
5418
+ },
5419
+ "examples": [
5420
+ {
5421
+ "descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
5422
+ },
5423
+ {
5424
+ "name": "Reqres",
5425
+ "operationId": "getUserById"
5426
+ },
5427
+ {
5428
+ "descriptionPath": "https://api.example.com/openapi.json",
5429
+ "operationId": "getUserById"
5430
+ },
5431
+ {
5432
+ "descriptionPath": "https://api.example.com/openapi.json",
5433
+ "operationId": "createUser",
5434
+ "useExample": "both"
5435
+ },
5436
+ {
5437
+ "descriptionPath": "https://api.example.com/openapi.json",
5438
+ "operationId": "createUser",
5439
+ "useExample": "both",
5440
+ "exampleKey": "example1"
5441
+ },
5442
+ {
5443
+ "descriptionPath": "https://api.example.com/openapi.json",
5444
+ "operationId": "createUser",
5445
+ "useExample": "both",
5446
+ "exampleKey": "example1",
5447
+ "statusCode": 201
5448
+ },
5449
+ {
5450
+ "descriptionPath": "https://api.example.com/openapi.json",
5451
+ "operationId": "createUser",
5452
+ "useExample": "both",
5453
+ "exampleKey": "example1",
5454
+ "statusCode": 201,
5455
+ "validateAgainstSchema": "none"
5456
+ },
5457
+ {
5458
+ "descriptionPath": "https://api.example.com/openapi.json",
5459
+ "operationId": "createUser",
5460
+ "useExample": "both",
5461
+ "exampleKey": "example1",
5462
+ "statusCode": 201,
5463
+ "validateAgainstSchema": "none",
5464
+ "mockResponse": true
5465
+ },
5466
+ {
5467
+ "descriptionPath": "https://api.example.com/openapi.json",
5468
+ "operationId": "createUser",
5469
+ "useExample": "both",
5470
+ "exampleKey": "example1",
5471
+ "statusCode": 201,
5472
+ "validateAgainstSchema": "none",
5473
+ "mockResponse": true,
5474
+ "headers": {
5475
+ "Authorization": "Bearer 12345"
5476
+ }
5477
+ }
5478
+ ]
5479
+ },
5480
+ {
5481
+ "type": "object",
5482
+ "not": {
5483
+ "required": [
5484
+ "operationId"
5485
+ ]
5486
+ },
5487
+ "required": [
5488
+ "name",
5489
+ "descriptionPath"
5490
+ ]
5491
+ }
5492
+ ]
5493
+ }
5494
+ },
5321
5495
  "steps": {
5322
5496
  "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
5497
  "type": "array",
@@ -9434,6 +9608,183 @@
9434
9608
  }
9435
9609
  ],
9436
9610
  "additionalProperties": false,
9611
+ "components": {
9612
+ "schemas": {
9613
+ "openApi": {
9614
+ "type": "array",
9615
+ "items": {
9616
+ "allOf": [
9617
+ {
9618
+ "version": "1.0.0",
9619
+ "$schema": "http://json-schema.org/draft-07/schema#",
9620
+ "title": "openApi",
9621
+ "type": "object",
9622
+ "description": "OpenAPI description and configuration.",
9623
+ "additionalProperties": false,
9624
+ "anyOf": [
9625
+ {
9626
+ "required": [
9627
+ "descriptionPath"
9628
+ ]
9629
+ },
9630
+ {
9631
+ "required": [
9632
+ "operationId"
9633
+ ]
9634
+ }
9635
+ ],
9636
+ "properties": {
9637
+ "name": {
9638
+ "type": "string",
9639
+ "description": "Name of the OpenAPI description, as defined in your configuration."
9640
+ },
9641
+ "descriptionPath": {
9642
+ "type": "string",
9643
+ "description": "URL or local path to the OpenAPI description."
9644
+ },
9645
+ "operationId": {
9646
+ "type": "string",
9647
+ "description": "ID of the operation to use for the request."
9648
+ },
9649
+ "server": {
9650
+ "type": "string",
9651
+ "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."
9652
+ },
9653
+ "validateAgainstSchema": {
9654
+ "type": "string",
9655
+ "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.",
9656
+ "enum": [
9657
+ "request",
9658
+ "response",
9659
+ "both",
9660
+ "none"
9661
+ ],
9662
+ "default": "both"
9663
+ },
9664
+ "mockResponse": {
9665
+ "type": "boolean",
9666
+ "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."
9667
+ },
9668
+ "statusCode": {
9669
+ "type": "integer",
9670
+ "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."
9671
+ },
9672
+ "useExample": {
9673
+ "type": [
9674
+ "string"
9675
+ ],
9676
+ "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.",
9677
+ "enum": [
9678
+ "request",
9679
+ "response",
9680
+ "both",
9681
+ "none"
9682
+ ],
9683
+ "default": "none"
9684
+ },
9685
+ "exampleKey": {
9686
+ "type": "string",
9687
+ "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.",
9688
+ "default": ""
9689
+ },
9690
+ "headers": {
9691
+ "type": "object",
9692
+ "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.",
9693
+ "additionalProperties": {
9694
+ "type": "string"
9695
+ }
9696
+ }
9697
+ },
9698
+ "components": {
9699
+ "schemas": {
9700
+ "operationId": {
9701
+ "type": "string",
9702
+ "description": "ID of the operation to use for the request."
9703
+ },
9704
+ "descriptionPath": {
9705
+ "type": "string",
9706
+ "description": "URL or local path to the OpenAPI description."
9707
+ }
9708
+ }
9709
+ },
9710
+ "examples": [
9711
+ {
9712
+ "descriptionPath": "https://petstore.swagger.io/v2/swagger.json"
9713
+ },
9714
+ {
9715
+ "name": "Reqres",
9716
+ "operationId": "getUserById"
9717
+ },
9718
+ {
9719
+ "descriptionPath": "https://api.example.com/openapi.json",
9720
+ "operationId": "getUserById"
9721
+ },
9722
+ {
9723
+ "descriptionPath": "https://api.example.com/openapi.json",
9724
+ "operationId": "createUser",
9725
+ "useExample": "both"
9726
+ },
9727
+ {
9728
+ "descriptionPath": "https://api.example.com/openapi.json",
9729
+ "operationId": "createUser",
9730
+ "useExample": "both",
9731
+ "exampleKey": "example1"
9732
+ },
9733
+ {
9734
+ "descriptionPath": "https://api.example.com/openapi.json",
9735
+ "operationId": "createUser",
9736
+ "useExample": "both",
9737
+ "exampleKey": "example1",
9738
+ "statusCode": 201
9739
+ },
9740
+ {
9741
+ "descriptionPath": "https://api.example.com/openapi.json",
9742
+ "operationId": "createUser",
9743
+ "useExample": "both",
9744
+ "exampleKey": "example1",
9745
+ "statusCode": 201,
9746
+ "validateAgainstSchema": "none"
9747
+ },
9748
+ {
9749
+ "descriptionPath": "https://api.example.com/openapi.json",
9750
+ "operationId": "createUser",
9751
+ "useExample": "both",
9752
+ "exampleKey": "example1",
9753
+ "statusCode": 201,
9754
+ "validateAgainstSchema": "none",
9755
+ "mockResponse": true
9756
+ },
9757
+ {
9758
+ "descriptionPath": "https://api.example.com/openapi.json",
9759
+ "operationId": "createUser",
9760
+ "useExample": "both",
9761
+ "exampleKey": "example1",
9762
+ "statusCode": 201,
9763
+ "validateAgainstSchema": "none",
9764
+ "mockResponse": true,
9765
+ "headers": {
9766
+ "Authorization": "Bearer 12345"
9767
+ }
9768
+ }
9769
+ ]
9770
+ },
9771
+ {
9772
+ "type": "object",
9773
+ "not": {
9774
+ "required": [
9775
+ "operationId"
9776
+ ]
9777
+ },
9778
+ "required": [
9779
+ "name",
9780
+ "descriptionPath"
9781
+ ]
9782
+ }
9783
+ ]
9784
+ }
9785
+ }
9786
+ }
9787
+ },
9437
9788
  "examples": [
9438
9789
  {
9439
9790
  "steps": [