We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3f8d52 commit 322e194Copy full SHA for 322e194
packages/serverless-openapi/src/lib/generator.ts
@@ -212,11 +212,17 @@ export class Generator {
212
}
213
214
private handleResponses(
215
- responseSchemas: { [key: string]: { 'application/json': Schema } },
+ responseSchemas:
216
+ | { [key: string]: { 'application/json': Schema } }
217
+ | undefined,
218
openApi: OpenAPIV3.Document
- ): OpenAPIV3.ResponsesObject {
219
+ ): OpenAPIV3.ResponsesObject | undefined {
220
const responses: OpenAPIV3.ResponsesObject = {};
221
222
+ if (!responseSchemas) {
223
+ return undefined;
224
+ }
225
+
226
for (const code of Object.keys(responseSchemas)) {
227
const schemaJSON = responseSchemas[code]['application/json'];
228
responses[code] = {
0 commit comments