mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: Change default value of per to operation
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': minor
|
||||
---
|
||||
|
||||
Change default value of `per` to `operation`
|
||||
@@ -46,7 +46,7 @@ void generateFiles({
|
||||
|
||||
### Per
|
||||
|
||||
Customise how the page is generated, default to `file`.
|
||||
Customise how the page is generated, default to `operation`.
|
||||
|
||||
| mode | Generate a page for |
|
||||
| --------- | ----------------------------------- |
|
||||
@@ -185,7 +185,7 @@ import { createOpenAPI } from 'fumadocs-openapi/server';
|
||||
|
||||
export const openapi = createOpenAPI({
|
||||
renderer: {
|
||||
Root(props, child) {
|
||||
Root(props) {
|
||||
// your own (server) component
|
||||
},
|
||||
},
|
||||
|
||||
@@ -17,10 +17,10 @@ export interface Config extends GenerateOptions {
|
||||
|
||||
/**
|
||||
* tag: Generate a page for each tag
|
||||
*
|
||||
* file: Generate a page for each schema
|
||||
* operation: Generate a page for each API endpoint/operation
|
||||
*
|
||||
* @defaultValue file
|
||||
* @defaultValue 'operation'
|
||||
*/
|
||||
per?: 'tag' | 'file' | 'operation';
|
||||
|
||||
@@ -50,7 +50,7 @@ export async function generateFiles(options: Config): Promise<void> {
|
||||
input,
|
||||
output,
|
||||
name: nameFn,
|
||||
per = 'file',
|
||||
per = 'operation',
|
||||
groupBy = 'none',
|
||||
cwd = process.cwd(),
|
||||
} = options;
|
||||
|
||||
@@ -66,6 +66,7 @@ describe('Generate documents', () => {
|
||||
await generateFiles({
|
||||
input: ['./fixtures/*.yaml'],
|
||||
output: './out',
|
||||
per: 'file',
|
||||
cwd,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user