-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathorval.config.ts
37 lines (36 loc) · 1.05 KB
/
orval.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from 'orval'
export default defineConfig({
baca: {
input: './scripts/data/swagger-spec.json',
output: {
mode: 'tags-split',
target: 'src/api/query/model.ts',
schemas: 'src/api/types',
client: 'react-query',
// solution for not working mocked data on mobile - it removes automatically added "*" to address url at the beginning
mock: {
baseUrl: '',
type: 'msw',
},
clean: true,
prettier: true,
override: {
header: (info) => [
`eslint-disable @typescript-eslint/no-explicit-any`,
`Generated by orval 🍺`,
`Do not edit manually.`,
...(info.title ? [info.title] : []),
...(info.description ? [info.description] : []),
...(info.version ? [`OpenAPI spec version: ${info.version}`] : []),
],
mutator: {
path: './src/api/axios/custom-instance.ts',
name: 'customInstance',
},
},
},
hooks: {
afterAllFilesWrite: 'yarn lint:fix',
},
},
})