OpenAPI: Support x-displayName

This commit is contained in:
fuma-nama
2024-09-19 17:47:56 +08:00
parent 8608780f29
commit 61a3d14322
2 changed files with 13 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-openapi': patch
---
Support `x-displayName` on tags
+8 -1
View File
@@ -187,6 +187,13 @@ export async function generateTags(
}
}
const displayName =
info &&
'x-displayName' in info &&
typeof info['x-displayName'] === 'string'
? info['x-displayName']
: idToTitle(tag);
return {
tag,
content: generateDocument({
@@ -197,7 +204,7 @@ export async function generateTags(
hasHead: true,
},
dereferenced: document,
title: idToTitle(tag),
title: displayName,
description: info?.description,
context: {
type: 'tag',