OpenAPI: handle undefined description in index.md generation (#2380)

* OpenAPI: handle undefined description in index.md generation

* Create chilled-bikes-think.md

---------

Co-authored-by: Fuma Nama <[email protected]>
This commit is contained in:
wjsoj
2025-09-20 17:12:10 +08:00
committed by GitHub
co-authored by Fuma Nama
parent db21ce22ed
commit 3e7e178cff
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"fumadocs-openapi": patch
---
OpenAPI: handle undefined description in index.md generation
+2 -1
View File
@@ -481,8 +481,9 @@ function writeIndexFiles(context: HookContext, options: Config) {
const { data } = matter(file.content);
if (typeof data.title !== 'string') continue;
const descriptionAttr = data.description ? `description=${JSON.stringify(data.description)} ` : '';
content.push(
`<Card href="${urlFn(file.path)}" title=${JSON.stringify(data.title)} description=${JSON.stringify(data.description)} />`,
`<Card href="${urlFn(file.path)}" title=${JSON.stringify(data.title)} ${descriptionAttr}/>`,
);
}