Package Exports
- @maaspiar/oats
Readme
maaspiar/oats
OpenApi Typescript Server generator
Interactive CLI to scaffold server-stubs (express-typescript) using OAS3.0 spec file
Usage
npx @maaspiar/oats api.yamlContents
Generated server-stub is an ExpressJs app which comes with:
- Request/Responses Valdiation
- Typescript interfaces
- Routing (only methods need to written)
- Mongoose models Generation (opt-in)
- VS-Code debugging setup (to be expanded to other IDEs)
- Deployment Scripts (AWS/GCP)
Update mode
This generator can accomodate updates in your api-spec. Run the following command and all the required types, models and routes will be implemented for you:
npx @maaspiar/oats api.yaml --update project-nameNote: Models and interfaces are expected to be overwritten. But as they're autogenerated by the package itself no apparent difference would be observed
Credits
This wouldn't be possible without the following projects:
Special thanks to team@create-t3-app