mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Docs: improve OpenAPI section
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user