mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: fix typescript schema generation
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': patch
|
||||
---
|
||||
|
||||
fix typescript schema generation
|
||||
@@ -12,8 +12,8 @@ export function createAPIPage(server: OpenAPIServer, options: CreateAPIPageOptio
|
||||
...options,
|
||||
shiki: configDefault,
|
||||
generateTypeScriptSchema(method, statusCode, contentType, ctx) {
|
||||
const schema = method.responses?.[statusCode]?.content?.[contentType];
|
||||
if (!schema) return;
|
||||
const schema = method.responses?.[statusCode]?.content?.[contentType].schema;
|
||||
if (!schema || typeof schema !== 'object') return;
|
||||
return getTypescriptSchema(schema, ctx);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user