A modern cli tool that auto generate typescript api code from swagger 2 and openapi 3
pnpm i -D @jawilx/gen-api
- update package.json
{
// ...
"scripts": {
// ...
"genapi:init": "gen-api init",
"genapi": "gen-api now"
}
}
- init api.config.ts
pnpm genapi:init
-
set api.config.ts apiList swaggerUrl (How to get swaggerUrl)
-
generate
pnpm genapi