frontend
frontend copied to clipboard
[Feature] Generate API TS types from OpenAPI/Swagger
Is your feature request related to a problem? Please describe. Supporting and maintaining types manually on the frontend is troublesome and leads to runtime errors
Describe the solution you'd like Generate the typescript types based on the swagger/openapi spec that we automatically export from the API
Consider the following tools:
- https://github.com/drwpow/openapi-typescript
Describe alternatives you've considered Generate types based on Prisma schema - not consistent with the actual API responses, just provides DB schema
npx openapi-typescript http://localhost:5010/docs-json --output defs.ts
npx openapi-typescript https://dev.podkrepi.bg/docs-json --output defs.ts
Sample output: https://gist.github.com/kachar/500d1d018a0e2d0c2e58733b5285be89
cc @dimitur2204