bootgs-openapi
Installation
SKILL.md
Bootgs OpenAPI
Available scripts
scripts/generate-openapi.ts— walks the TS AST and writes an OpenAPI 3.0openapi.json. Runnpx tsx scripts/generate-openapi.ts --helpfor 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
- Define or change one request/response DTO per file under
domain/dto/, exported through a barrelindex.ts. Never share a TS type directly between frontend and backend build targets —openapi.jsonis the only contract boundary; the two sides may not even share atsconfig. - 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. - Run the generator (see Usage below).
- Diff-review the produced
openapi.jsonbefore 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. - Regenerate/update the frontend client from the spec (see the
bootgs-clientskill for the transport layer the client must speak).