bootgs-openapi

Installation
SKILL.md

Bootgs OpenAPI

Available scripts

  • scripts/generate-openapi.ts — walks the TS AST and writes an OpenAPI 3.0 openapi.json. Run npx tsx scripts/generate-openapi.ts --help for the full flag reference.

Why static analysis, not runtime reflection

bootgs's own routing metadata (via reflect-metadata) only exists once a controller class is instantiated inside a live Apps Script execution — there's no server process you can query for its route table from a build machine. Generating a spec at build time means walking the TypeScript AST directly with the typescript compiler API, before any of it runs. scripts/generate-openapi.ts in this skill does exactly that: it loads your tsconfig, finds every class decorated with @RestController/@Controller, and reads its routes, parameters, and JSDoc straight off the syntax tree.

DTO-first contract workflow

  1. Define or change one request/response DTO per file under domain/dto/, exported through a barrel index.ts. Never share a TS type directly between frontend and backend build targets — openapi.json is the only contract boundary; the two sides may not even share a tsconfig.
  2. Add or change the controller method. Type its parameters and return value with the DTO, and give the method a JSDoc comment — the generator lifts it verbatim into the operation's description.
  3. Run the generator (see Usage below).
  4. Diff-review the produced openapi.json before committing — an unexpected diff (a route disappearing, a schema losing a field) usually means a decorator or type the generator can't see, not a real API change.
  5. Regenerate/update the frontend client from the spec (see the bootgs-client skill for the transport layer the client must speak).

How the generator resolves a route

Installs
4
Repository
bootgs/skills
GitHub Stars
1
First Seen
2 days ago
bootgs-openapi — bootgs/skills