serverless-openapi-documenter 0.0.124-beta.1 → 0.1.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 +2 -2
- package/package.json +5 -1
- package/src/definitionGenerator.js +3 -2
- package/openapi.json +0 -1222
- package/test.js +0 -204
- package/test2.js +0 -146
- package/test3.js +0 -29
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
</a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
-
This will generate an OpenAPI V3 (up to v3.
|
|
15
|
+
This will generate an OpenAPI V3 (up to v3.1.2) Document file for you from your serverless file. It can optionally generate a [Postman Collection V2](https://github.com/postmanlabs/openapi-to-postman) or (as of 0.0.120) [Bruno Collection](https://docs.usebruno.com/) from the OpenAPI file. This currently works for `http` and `httpApi` configurations.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
As of version 0.1.0, you can now create [OpenAPI V3.1 (3.1.x)](https://spec.openapis.org/oas/v3.1.2.html) Documents, should you run the command `serverless openapi generate -o openapi.json -f json -a 3.1.2 -p postman.json`. Please see this [guide on migrating to V3.1](https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0). Whilst I perosnally use this plugin all the time, please do open and report bugs, and I will do my best to fix them.
|
|
18
18
|
|
|
19
19
|
Originally based off of: https://github.com/temando/serverless-openapi-documentation
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serverless-openapi-documenter",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Generate OpenAPI v3 documentation and Postman Collections from your Serverless Config",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
"swagger",
|
|
18
18
|
"openAPI",
|
|
19
19
|
"openAPIv3",
|
|
20
|
+
"openAPIv3.1",
|
|
20
21
|
"openAPI3",
|
|
22
|
+
"openAPI3.1",
|
|
23
|
+
"OpenAPI 3",
|
|
24
|
+
"OpenAPI 3.1",
|
|
21
25
|
"Postman",
|
|
22
26
|
"PostmanCollections",
|
|
23
27
|
"Postman-Collections",
|
|
@@ -713,7 +713,6 @@ class DefinitionGenerator {
|
|
|
713
713
|
}
|
|
714
714
|
|
|
715
715
|
if (contentKey) {
|
|
716
|
-
|
|
717
716
|
const obj = {};
|
|
718
717
|
let schema;
|
|
719
718
|
if (mediaTypeDocumentation.content) {
|
|
@@ -734,7 +733,9 @@ class DefinitionGenerator {
|
|
|
734
733
|
}
|
|
735
734
|
|
|
736
735
|
if (mediaTypeDocumentation.examples) {
|
|
737
|
-
obj.
|
|
736
|
+
obj.examples = this.createExamples(
|
|
737
|
+
mediaTypeDocumentation.examples
|
|
738
|
+
);
|
|
738
739
|
}
|
|
739
740
|
|
|
740
741
|
schema = mediaTypeDocumentation.schema;
|