2023-01-05 11:57:53 +01:00
|
|
|
/**
|
|
|
|
* How to generate OpenAPI client
|
|
|
|
*
|
|
|
|
* For now we only use generated types (src/openapi/models).
|
2024-09-02 15:14:48 +02:00
|
|
|
* Run `yarn gen:api` to generate the client.
|
|
|
|
* We may use methods (src/openapi/apis) for new features in the future.
|
2023-01-05 11:57:53 +01:00
|
|
|
*/
|
|
|
|
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',
|
|
|
|
},
|
2023-03-15 13:29:18 +01:00
|
|
|
header: () => [
|
|
|
|
'Generated by Orval',
|
|
|
|
'Do not edit manually.',
|
|
|
|
'See `gen:api` script in package.json',
|
|
|
|
],
|
2023-01-05 11:57:53 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
input: {
|
|
|
|
target:
|
|
|
|
process.env.UNLEASH_OPENAPI_URL ||
|
|
|
|
'http://localhost:4242/docs/openapi.json',
|
|
|
|
},
|
2024-09-02 15:14:48 +02:00
|
|
|
hooks: {
|
|
|
|
afterAllFilesWrite: './scripts/clean_orval_generated.sh',
|
|
|
|
},
|
2023-01-05 11:57:53 +01:00
|
|
|
},
|
|
|
|
};
|