serverless-openapi-documenter 0.0.82 → 0.0.83
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 +0 -2
- package/package.json +1 -1
- package/src/definitionGenerator.js +18 -14
package/README.md
CHANGED
|
@@ -96,8 +96,6 @@ Options:
|
|
|
96
96
|
| tags[].externalDocs.url | custom.documentation.tags.externalDocumentation.url |
|
|
97
97
|
| tags[].externalDocs.description | custom.documentation.tags.externalDocumentation.description |
|
|
98
98
|
| path[path] | functions.functions.events.[http OR httpApi].path |
|
|
99
|
-
| path[path].summary | functions.functions.summary |
|
|
100
|
-
| path[path].description | functions.functions.description |
|
|
101
99
|
| path[path].servers[].description | functions.functions.servers.description |
|
|
102
100
|
| path[path].servers[].url | functions.functions.servers.url |
|
|
103
101
|
| path[path].[operation] | functions.functions.[http OR httpApi].method |
|
package/package.json
CHANGED
|
@@ -179,11 +179,11 @@ class DefinitionGenerator {
|
|
|
179
179
|
throw err;
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
if (httpFunction.functionInfo?.summary)
|
|
183
|
-
|
|
182
|
+
// if (httpFunction.functionInfo?.summary)
|
|
183
|
+
// path.summary = httpFunction.functionInfo.summary;
|
|
184
184
|
|
|
185
|
-
if (httpFunction.functionInfo?.description)
|
|
186
|
-
|
|
185
|
+
// if (httpFunction.functionInfo?.description)
|
|
186
|
+
// path.description = httpFunction.functionInfo.description;
|
|
187
187
|
|
|
188
188
|
if (httpFunction.functionInfo?.servers) {
|
|
189
189
|
const servers = this.createServers(
|
|
@@ -910,16 +910,20 @@ class DefinitionGenerator {
|
|
|
910
910
|
cleanupLinks() {
|
|
911
911
|
for (const path of Object.keys(this.openAPI.paths)) {
|
|
912
912
|
for (const [name, value] of Object.entries(this.openAPI.paths[path])) {
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
)
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
)
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
|
|
913
|
+
if (
|
|
914
|
+
RegExp(/(get|put|post|delete|options|head|patch|trace)/i).test(name)
|
|
915
|
+
) {
|
|
916
|
+
for (const [statusCode, responseObj] of Object.entries(
|
|
917
|
+
value?.responses
|
|
918
|
+
)) {
|
|
919
|
+
if (responseObj.links) {
|
|
920
|
+
for (const [linkName, linkObj] of Object.entries(
|
|
921
|
+
responseObj.links
|
|
922
|
+
)) {
|
|
923
|
+
const opId = linkObj.operationId;
|
|
924
|
+
if (this.functionMap[opId]) {
|
|
925
|
+
linkObj.operationId = this.functionMap[opId][0];
|
|
926
|
+
}
|
|
923
927
|
}
|
|
924
928
|
}
|
|
925
929
|
}
|