Feature · swagger

Swagger API Documentation

Answer Yes to Swagger during scaffolding and your API ships with interactive OpenAPI 3.0 docs — pre-wired auth, and JSDoc annotations generated for every module you create.

What you get

  • Interactive UI — mounted automatically at /docs (e.g. http://localhost:5000/docs).
  • Config file — src/app/config/swagger.ts, built on swagger-jsdoc + swagger-ui-express.
  • Pre-configured auth — OpenAPI 3.0 bearerAuth security definitions for JWT, out of the box.
  • Automatic JSDoc — every module created with cem add module includes @openapi annotations for the full CRUD surface: GET, POST, GET /:id, PATCH /:id, DELETE /:id.
  • Auth endpoints spec — full specs for /auth/login, /auth/logout, and /auth/profile.
  • Config tracking — the toggle is recorded in cem-cli.json under features.swagger.

Enabling it

bash
? Include Swagger API documentation (OpenAPI 3.0)? Yes

# or non-interactively — Swagger is on by default with -y
cem my-api -y

Where it lives

my-api/
└── src/app/config/
    ├── index.ts       # typed env config
    └── swagger.ts     # OpenAPI 3.0 spec generator