diff --git a/generator/gen-client.ts b/generator/gen-client.ts index 914bf7a..25d4a67 100644 --- a/generator/gen-client.ts +++ b/generator/gen-client.ts @@ -153,7 +153,7 @@ function schemaToType(schema: Schema, opts: SchemaToTypeOpts = {}) { function contentRef(o: Schema | OpenAPIV3.RequestBodyObject | undefined) { return o && "content" in o && - o.content?.["application/json"].schema && + o.content?.["application/json"]?.schema && "$ref" in o.content["application/json"].schema ? o.content["application/json"].schema.$ref : null;