JSPM

@maaspiar/oats

0.0.1-dev.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q33597F
  • License GNU3.0

Generate Express (Typescript) server stubs from OAS3.0

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.yaml

Contents

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-name

Note: 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