Major Changes
-
bdef238: Redesign
generateFiles
This redesign will finalize the behaviour of
generateFiles
to make it simpler, consistent across different versions of Fumadocs OpenAPI.- Abandoned
groupByFolder
, it's deprecated long time ago and can be replaced withgroupBy
. - Improved type safety,
groupBy
is now only available withper
set tooperation
. name
usage changed (see below).
The
name
option was supposed to designate a output path for generated page. SincegroupBy
was introduced,name
became somehow useless because its design doesn't work well withgroupBy
.New
name
Design:It now accepts a function:
generateFiles({ input: ['./content/docs/openapi/museum.yaml'], output: './content/docs/openapi/(generated)', per: 'operation', name: (output, document) => { // page info output.item; // parsed OpenAPI schema document; return 'dir/my-file'; }, });
You can set
algorithm
tov1
to keep the behaviour of Fumadocs OpenAPI v8:generateFiles({ input: ['./content/docs/openapi/museum.yaml'], output: './content/docs/openapi/(generated)', per: 'operation', name: { algorithm: 'v1', }, });
per: operation
:File name will be identical with your
operationId
if defined, otherwise fallback to endpoint path or webhook name.generateFiles({ input: ['./content/docs/openapi/museum.yaml'], output: './content/docs/openapi/(generated)', per: 'operation', });
With
per: operation
, you can usegroupBy
to group pages:- tag:
{tag}/{file}
- route:
{endpoint}/{method}
(it will ignore thename
option) - none:
{file}
(default)
per: tag | file
:They are unchanged.
- Abandoned