Skip to content

How to create a spec

Course: OpenAPI Spec - chapter 4

  1. Write it by hand (bad, but still happens)
  2. Auto generate it from your code
  3. Easy in languages that have deep types like Rust
  4. Slightly harder in languages like Go/Rust
  5. Node.js has some libraries/codebases that let you do it 1. With express - https://www.npmjs.com/package/express-openapi (highly verbose) 2. Without express - https://github.com/lukeautry/tsoa (Cohort 1 video)
  6. Hono has a native implementation with zod - https://hono.dev/snippets/zod-openapi

We’ll be going through d, but we’ve covered c.ii in Cohort 1