serverless-openapi-documenter 0.0.109 → 0.0.111

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 CHANGED
@@ -12,13 +12,13 @@
12
12
  </a>
13
13
  </p>
14
14
 
15
- This will generate an OpenAPI V3 (up to v3.0.3) file for you from your serverless file. It can optionally generate a [Postman Collection V2](https://github.com/postmanlabs/openapi-to-postman) from the OpenAPI file for you too. This currently works for `http` and `httpApi` configurations.
15
+ This will generate an OpenAPI V3 (up to v3.0.4) file for you from your serverless file. It can optionally generate a [Postman Collection V2](https://github.com/postmanlabs/openapi-to-postman) from the OpenAPI file for you too. This currently works for `http` and `httpApi` configurations.
16
16
 
17
17
  Originally based off of: https://github.com/temando/serverless-openapi-documentation
18
18
 
19
19
  ## Install
20
20
 
21
- This plugin works for Serverless (2.x, 3.x and 4.x) and only supports node.js 14 and up.
21
+ This plugin works for Serverless (2.x, 3.x and 4.x) and only supports node.js 20 and up.
22
22
 
23
23
  To add this plugin to your package.json:
24
24
 
@@ -39,7 +39,7 @@ plugins:
39
39
 
40
40
  ## Adding documentation to serverless
41
41
 
42
- To Run: `serverless openapi generate -o openapi.json -f json -a 3.0.3 -p postman.json`
42
+ To Run: `serverless openapi generate -o openapi.json -f json -a 3.0.4 -p postman.json`
43
43
 
44
44
  Options:
45
45
 
@@ -316,7 +316,7 @@ custom:
316
316
  in: header
317
317
  ```
318
318
 
319
- It accepts all available Security Schemes and follows the specification: https://spec.openapis.org/oas/v3.0.3#security-scheme-object
319
+ It accepts all available Security Schemes and follows the specification: https://spec.openapis.org/oas/v3.0.4#security-scheme-object
320
320
 
321
321
  #### Security on each operation
322
322
 
@@ -904,7 +904,7 @@ getContent:
904
904
 
905
905
  You can refer to the `operationId` that you created.
906
906
 
907
- You can read more about [links](https://swagger.io/docs/specification/links/) on the swagger.io site and in the [OpenAPI](https://spec.openapis.org/oas/v3.0.3#link-object) specification. They don't seem widely supported just yet, but perhaps they'll improve your documentation.
907
+ You can read more about [links](https://swagger.io/docs/specification/links/) on the swagger.io site and in the [OpenAPI](https://spec.openapis.org/oas/v3.0.4#link-object) specification. They don't seem widely supported just yet, but perhaps they'll improve your documentation.
908
908
 
909
909
  ##### `responseHeaders`
910
910
 
@@ -1009,18 +1009,18 @@ I am making use of https://www.npmjs.com/package/@redocly/openapi-core, which I
1009
1009
 
1010
1010
  I have configured the validator to use these Rules:
1011
1011
 
1012
- - [spec](https://redocly.com/docs/cli/rules/spec/)
1013
- - [path-parameters-defined](https://redocly.com/docs/cli/rules/path-parameters-defined/)
1014
- - [operation-2xx-response](https://redocly.com/docs/cli/rules/operation-2xx-response/)
1015
- - [operation-4xx-response](https://redocly.com/docs/cli/rules/operation-4xx-response/)
1016
- - [operation-operationId-unique](https://redocly.com/docs/cli/rules/operation-operationid-unique/)
1017
- - [path-declaration-must-exist](https://redocly.com/docs/cli/rules/path-declaration-must-exist/)
1012
+ - [struct](https://redocly.com/docs/cli/rules/oas/struct)
1013
+ - [path-parameters-defined](https://redocly.com/docs/cli/rules/oas/path-parameters-defined)
1014
+ - [operation-2xx-response](https://redocly.com/docs/cli/rules/oas/operation-2xx-response)
1015
+ - [operation-4xx-response](https://redocly.com/docs/cli/rules/oas/operation-4xx-response)
1016
+ - [operation-operationId-unique](https://redocly.com/docs/cli/rules/oas/operation-operationId-unique)
1017
+ - [path-declaration-must-exist](https://redocly.com/docs/cli/rules/oas/path-declaration-must-exist)
1018
1018
 
1019
1019
  However, you can configure your own rules from the [ruleset available on the Redocly site](https://redocly.com/docs/cli/rules/built-in-rules/). To do this, you will need to create a `redocly.json` file within an `options` folder. The file should look like:
1020
1020
 
1021
1021
  ```json
1022
1022
  {
1023
- "spec": "error",
1023
+ "struct": "error",
1024
1024
  "path-parameters-defined": "error",
1025
1025
  "operation-2xx-response": "error",
1026
1026
  "operation-4xx-response": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverless-openapi-documenter",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "description": "Generate OpenAPI v3 documentation and Postman Collections from your Serverless Config",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -51,17 +51,16 @@
51
51
  "js-yaml": "^4.1.0",
52
52
  "json-schema-for-openapi": "^0.5.0",
53
53
  "lodash.isequal": "^4.5.0",
54
- "openapi-to-postmanv2": "^4.24.0",
55
- "swagger2openapi": "^7.0.8",
56
- "uuid": "^10.0.0"
54
+ "openapi-to-postmanv2": "^5.0.0",
55
+ "uuid": "^11.1.0"
57
56
  },
58
57
  "engines": {
59
- "node": ">=16"
58
+ "node": ">=20"
60
59
  },
61
60
  "devDependencies": {
62
61
  "chai": "^4.5.0",
63
- "mocha": "^10.7.3",
64
- "nock": "^13.5.5",
65
- "sinon": "^19.0.2"
62
+ "mocha": "^11.1.0",
63
+ "nock": "^14.0.2",
64
+ "sinon": "^20.0.0"
66
65
  }
67
66
  }
@@ -81,7 +81,7 @@ class DefinitionGenerator {
81
81
  this.REDOCLY_RULES = require(path.resolve("options", "redocly.json"));
82
82
  } catch (err) {
83
83
  this.REDOCLY_RULES = {
84
- spec: "error",
84
+ struct: "error",
85
85
  "path-parameters-defined": "error",
86
86
  "operation-2xx-response": "error",
87
87
  "operation-4xx-response": "error",
@@ -1,4 +1,4 @@
1
1
  {
2
- "spec": "error",
2
+ "struct": "error",
3
3
  "operation-2xx-response": "warn"
4
4
  }
@@ -237,7 +237,9 @@ describe("OpenAPIGenerator", () => {
237
237
  it("should throw an error when writing a file fails", function () {
238
238
  const errStub = sinon.stub(logOutput.log, "error").returns("");
239
239
  const succSpy = sinon.spy(logOutput.log, "success");
240
- const fsStub = sinon.stub(fs, "writeFileSync").throws(new Error());
240
+ const fsStub = sinon
241
+ .stub(fs, "writeFileSync")
242
+ .throws(new Error("throwing an error from writeFileSync"));
241
243
  const openAPIGenerator = new OpenAPIGenerator(sls, {}, logOutput);
242
244
  openAPIGenerator.processCliInput();
243
245
 
@@ -258,7 +260,7 @@ describe("OpenAPIGenerator", () => {
258
260
  const errStub = sinon.spy(logOutput.log, "error");
259
261
  const succSpy = sinon.spy(logOutput.log, "success");
260
262
  const pgStub = sinon.stub(PostmanGenerator, "convert");
261
- pgStub.yields(new Error());
263
+ pgStub.yields(new Error("throwing an error from PostmanGenerator"));
262
264
 
263
265
  const openAPIGenerator = new OpenAPIGenerator(sls, {}, logOutput);
264
266
  openAPIGenerator.processCliInput();