serverless-openapi-documenter 0.0.93 → 0.0.94
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
|
@@ -443,12 +443,14 @@ class DefinitionGenerator {
|
|
|
443
443
|
|
|
444
444
|
this.currentStatusCode = response.statusCode;
|
|
445
445
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
446
|
+
if (Object.keys(response.responseModels).length) {
|
|
447
|
+
obj.content = await this.createMediaTypeObject(
|
|
448
|
+
response.responseModels,
|
|
449
|
+
"responses"
|
|
450
|
+
).catch((err) => {
|
|
451
|
+
throw err;
|
|
452
|
+
});
|
|
453
|
+
}
|
|
452
454
|
|
|
453
455
|
if (response.responseHeaders) {
|
|
454
456
|
obj.headers = await this.createResponseHeaders(
|
|
@@ -596,6 +598,7 @@ class DefinitionGenerator {
|
|
|
596
598
|
|
|
597
599
|
async createMediaTypeObject(models, type) {
|
|
598
600
|
const mediaTypeObj = {};
|
|
601
|
+
|
|
599
602
|
for (const mediaTypeDocumentation of this.schemaHandler.models) {
|
|
600
603
|
if (models === undefined || models === null) {
|
|
601
604
|
throw new Error(
|
|
@@ -90,7 +90,7 @@ describe("OpenAPIGenerator", () => {
|
|
|
90
90
|
getFuncStub.reset();
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
xit("should throw an error when trying to generate an invalid openAPI document", async function () {
|
|
94
94
|
const succSpy = sinon.spy(logOutput.log, "success");
|
|
95
95
|
const errSpy = sinon.spy(logOutput.log, "error");
|
|
96
96
|
|