Dependencies
yarn add --dev typescript openapi-typescript
Scripts to Compile schemas of Swagger-UI
yarn openapi-typescript http://localhost:4000/api -o src/types/api.ts
Note that the script can be executed only when a swagger doc is running.
Result
Now the results are saved in src/types/api.ts
: