1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-28 19:06:12 +01:00
unleash.unleash/frontend/orval.config.js
Tymoteusz Czech 0b2479517f
feat: update Orval config (#8038)
Simplify running frontend `gen:api`
2024-09-02 15:14:48 +02:00

40 lines
1.1 KiB
JavaScript

/**
* How to generate OpenAPI client
*
* For now we only use generated types (src/openapi/models).
* Run `yarn gen:api` to generate the client.
* We may use methods (src/openapi/apis) for new features in the future.
*/
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',
},
hooks: {
afterAllFilesWrite: './scripts/clean_orval_generated.sh',
},
},
};