Docs: improve OpenAPI section

This commit is contained in:
Fuma Nama
2026-03-25 20:17:47 +08:00
parent 2c8d5c09ef
commit 6849807f15
3 changed files with 29 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@fumadocs/base-ui': patch
'fumadocs-ui': patch
---
Fix `shiki.css` padding
@@ -118,6 +118,7 @@ void generateFiles({
},
items: [
{
// output path
path: 'index.mdx',
// optional: restrict the input files (identical to the `input` field in server)
only: ['petstore.yaml'],
@@ -129,6 +130,25 @@ void generateFiles({
});
```
### `meta`
Generate [`meta.json`](/docs/page-conventions#meta) files automatically.
You can always define the `meta.json` files manually for maximal flexibility.
```ts
import { generateFiles } from 'fumadocs-openapi';
void generateFiles({
meta: true,
// or customise how folders are represented:
meta: {
folderStyle: 'separator',
},
});
```
### `imports`
Add custom imports to generated MDX files. This is useful for including components, utilities, or other dependencies in your generated documentation.
@@ -5,9 +5,7 @@ description: Generating docs for OpenAPI schema
<Callout type="warning" title="Before Reading">
- Only OpenAPI 3.0 and 3.1 are supported.
- It only works under RSC
environments.
It only works under RSC environments.
</Callout>
@@ -59,6 +57,8 @@ export const source = loader({
});
```
See [`createOpenAPI()`](/docs/integrations/openapi/server) for available options.
Create a `APIPage` component:
```tsx tab="components/api-page.tsx"