OpenAPI: fix inconsistency in option names

This commit is contained in:
Fuma Nama
2026-04-27 20:39:30 +08:00
parent 2eff8e99c9
commit 970b1bffd0
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-openapi': patch
---
fix inconsistency in option names
+4 -2
View File
@@ -75,7 +75,9 @@ interface GenerateFilesConfig extends PagesToTextOptions {
}
interface MetaOptions {
/** @deprecated use `folderStyle` instead */
groupStyle?: 'folder' | 'separator';
folderStyle?: 'folder' | 'separator';
}
export type Config = SchemaToPagesOptions &
@@ -177,7 +179,7 @@ export async function generateFilesOnly(
function generateMeta(context: BeforeWriteContext, options: MetaOptions): OutputFile[] {
const files: OutputFile[] = [];
const { groupStyle = 'folder' } = options;
const folderStyle = options.folderStyle ?? options.groupStyle ?? 'folder';
function scan(entries: OutputEntry[], parent?: OutputGroup) {
const pages: string[] = [];
@@ -190,7 +192,7 @@ function generateMeta(context: BeforeWriteContext, options: MetaOptions): Output
if (entry.type === 'group') {
scan(entry.entries, entry);
if (groupStyle === 'folder') {
if (folderStyle === 'folder') {
pages.push(relativePath);
} else {
pages.push(`---${entry.info.title}---`, `...${relativePath}`);