forked from Unleash/unleash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
orval.config.js
38 lines (38 loc) · 1.13 KB
/
orval.config.js
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
/**
* How to generate OpenAPI client
*
* For now we only use generated types (src/openapi/models).
* We will use methods (src/openapi/apis) for new features soon.
* 1. `yarn gen:api` to generate the client
* 2. `rm -rf src/openapi/apis` to remove methods (! except if you want to use some of those)
* 3. clean up `src/openapi/index.ts` imports
*/
module.exports = {
unleashApi: {
output: {
mode: 'tags',
workspace: 'src/openapi',
target: 'apis',
schemas: 'models',
client: 'swr',
clean: true,
// mock: true,
override: {
mutator: {
path: './fetcher.ts',
name: 'fetcher',
},
header: () => [
'Generated by Orval',
'Do not edit manually.',
'See `gen:api` script in package.json',
],
},
},
input: {
target:
process.env.UNLEASH_OPENAPI_URL ||
'http://localhost:4242/docs/openapi.json',
},
},
};