mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
parent
ea328e5b43
commit
0b2479517f
@ -2,10 +2,8 @@
|
|||||||
* How to generate OpenAPI client
|
* How to generate OpenAPI client
|
||||||
*
|
*
|
||||||
* For now we only use generated types (src/openapi/models).
|
* For now we only use generated types (src/openapi/models).
|
||||||
* We will use methods (src/openapi/apis) for new features soon.
|
* Run `yarn gen:api` to generate the client.
|
||||||
* 1. `yarn gen:api` to generate the client
|
* We may use methods (src/openapi/apis) for new features in the future.
|
||||||
* 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 = {
|
module.exports = {
|
||||||
unleashApi: {
|
unleashApi: {
|
||||||
@ -34,5 +32,8 @@ module.exports = {
|
|||||||
process.env.UNLEASH_OPENAPI_URL ||
|
process.env.UNLEASH_OPENAPI_URL ||
|
||||||
'http://localhost:4242/docs/openapi.json',
|
'http://localhost:4242/docs/openapi.json',
|
||||||
},
|
},
|
||||||
|
hooks: {
|
||||||
|
afterAllFilesWrite: './scripts/clean_orval_generated.sh',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -5,9 +5,8 @@ rm -rf src/openapi/apis
|
|||||||
|
|
||||||
# Remove all but last line from index.ts
|
# Remove all but last line from index.ts
|
||||||
echo "Cleaning index.ts..."
|
echo "Cleaning index.ts..."
|
||||||
tail -1 src/openapi/index.ts > index_tmp ;
|
echo "export * from './models';" > src/openapi/index.ts
|
||||||
cat index_tmp > src/openapi/index.ts ;
|
echo '' >> src/openapi/index.ts
|
||||||
rm index_tmp
|
|
||||||
|
|
||||||
echo "Formatting..."
|
echo "Formatting..."
|
||||||
yarn fmt
|
yarn fmt
|
||||||
|
Loading…
Reference in New Issue
Block a user