Skip to content
Clone
e40c667
25 lines 756 B
import { defineConfig } from 'orval'
// 唯一的 OpenAPI 文档由 `cargo run -p app -- openapi` 生成到仓库根目录,
// 这里只把登录前端真正使用的 auth 标签生成为 packages/apiclient 下的 fetch 客户端;
// 其余业务操作不进入客户端,调用方也就看不到。
export default defineConfig({
apiclient: {
input: {
target: './openapi.json',
filters: { mode: 'include', tags: ['auth'] },
},
output: {
target: './packages/apiclient/index.ts',
mode: 'tags-operations-split',
client: 'fetch',
httpClient: 'fetch',
clean: true,
formatter: 'prettier',
baseUrl: '/api/v1',
override: {
enumGenerationType: 'union',
},
},
},
})