OpenAPI: fix groupBy: route ignoring curly braces

This commit is contained in:
Fuma Nama
2025-07-19 21:29:10 +08:00
parent 2961c2ab7f
commit d449bb193e
2 changed files with 11 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-openapi': patch
---
fix `groupBy: route` ignoring curly braces
+6 -5
View File
@@ -213,17 +213,18 @@ async function generateFromDocument(pathOrUrl: string, options: Config) {
groupBy: OperationConfig['groupBy'] = 'none',
result: GeneratePageOutput,
): string[] {
const file = nameFn(result, document.document);
if (groupBy === 'route') {
return [
path.join(
result.type === 'operation' ? result.item.path : result.item.name,
result.item.method,
) + '.mdx',
getOutputPathFromRoute(
result.type === 'operation' ? result.item.path : result.item.name,
),
`${result.item.method.toLowerCase()}.mdx`,
),
];
}
const file = nameFn(result, document.document);
if (groupBy === 'tag') {
let tags =
result.type === 'operation'