kindergarten_java/reading-platform-frontend/orval.config.ts
tonytech 076d832a42 chore(api): 将 OpenAPI 规范文件改为 YAML 格式
- api-spec.json → api-spec.yml(内容相同,YAML 更易读)
- api:fetch 脚本自动转换 JSON→YAML 后删除 json 临时文件

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 11:11:53 +08:00

26 lines
736 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'orval'
export default defineConfig({
readingPlatform: {
input: {
// 本地开发:使用下载的规范文件(运行 npm run api:update 更新)
// 服务器直连时改为:'http://8.148.151.56:3002/v3/api-docs'
target: './api-spec.yml',
},
output: {
// 自动生成到这个目录,不要手动修改这里的文件
target: 'src/api/generated/api.ts',
schemas: 'src/api/generated/model',
client: 'axios',
// 复用项目里已有的 axios 实例(带 token、错误处理
override: {
mutator: {
path: 'src/api/request.ts',
name: 'request',
},
},
prettier: true,
},
},
})