mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
fix(openapi): ensure getSchema uses cached schemas (#2919)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fumadocs-openapi": minor
|
||||
---
|
||||
|
||||
Fixed a performance issue where getSchema() would bypass the internal cache and re-parse the OpenAPI spec on every call. This was caused by calling the internal getSchemas() function instead of the cached method.
|
||||
@@ -61,7 +61,7 @@ export function createOpenAPI(options: OpenAPIOptions = {}): OpenAPIServer {
|
||||
options,
|
||||
createProxy,
|
||||
async getSchema(document) {
|
||||
const schemas = await getSchemas();
|
||||
const schemas = await this.getSchemas();
|
||||
if (document in schemas) return schemas[document];
|
||||
|
||||
console.warn(
|
||||
|
||||
Reference in New Issue
Block a user