We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c49fc0f commit 90c60fcCopy full SHA for 90c60fc
src/types/OpenAPI3.ts
@@ -57,7 +57,7 @@ export interface OpenAPI3ResponseObject {
57
58
export interface OpenAPI3RequestBody {
59
description?: string;
60
- content: {
+ content?: {
61
[contentType: string]: { schema: OpenAPI3SchemaObject | { $ref: string } };
62
};
63
}
src/v3.ts
@@ -225,7 +225,7 @@ export default function generateTypesV3(
225
// handle requestBody
226
if (operation.requestBody) {
227
output += `requestBody: {\n`;
228
- Object.entries(operation.requestBody.content).forEach(
+ Object.entries(operation.requestBody.content || {}).forEach(
229
([contentType, { schema }]) => {
230
output += `"${contentType}": ${transform(schema)};\n`;
231
0 commit comments