-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorval.config.ts
More file actions
42 lines (41 loc) · 1.03 KB
/
orval.config.ts
File metadata and controls
42 lines (41 loc) · 1.03 KB
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
38
39
40
41
42
import { defineConfig } from 'orval'
export default defineConfig({
nexo: {
input: {
target: './spec/openapi.yaml',
override: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
transformer: (spec: Record<string, any>) => {
const s = spec
// Fix Go time.Time mapped as empty object — should be a date-time string
if (s.components?.schemas?.Time) {
s.components.schemas.Time = {
type: 'string',
format: 'date-time',
}
}
return s
},
},
},
output: {
mode: 'tags-split',
target: './src/api/generated',
schemas: './src/api/generated/model',
client: 'react-query',
httpClient: 'axios',
override: {
mutator: {
path: './src/api/mutator.ts',
name: 'customInstance',
},
query: {
useQuery: true,
useMutation: true,
version: 5,
signal: true,
},
},
},
},
})