We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75e8448 commit 7f6b1aaCopy full SHA for 7f6b1aa
src/types/OpenAPI3.ts
@@ -43,7 +43,7 @@ export interface OpenAPI3ResponseObject {
43
44
export interface OpenAPI3RequestBody {
45
description?: string;
46
- content: {
+ content?: {
47
[contentType: string]: { schema: OpenAPI3SchemaObject | { $ref: string } };
48
};
49
}
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