← Back to nodox

Why Developers Switch from
swagger-autogen to nodox-cli

swagger-autogen requires JSDoc comments on every route. nodox-cli reads your existing validator schemas automatically, no comments, no YAML, no extra files to maintain.

Try nodox-cli free →

Feature comparison

Feature nodox-cli swagger-autogen
Requires JSDoc comments on routes ✗ No ✓ Yes — required
Reads Zod schemas automatically ✓ Yes ✗ No
Reads Joi schemas automatically ✓ Yes ✗ No
Reads express-validator chains ✓ Yes ✗ No
Zero config setup ✓ Yes — one middleware line ✗ No — requires build step + config
Live, real-time UI (no rebuild) ✓ Yes — WebSocket powered ✗ No — static file generation
Interactive request playground ✓ Yes — built-in ~ Via Swagger UI only
Test suite seeding (Jest / Vitest) ✓ Yes ✗ No
API chain builder ✓ Yes ✗ No
OpenAPI 3.1 export (JSON + YAML) ✓ Yes ✓ Yes

The JSDoc problem

swagger-autogen's core mechanic is scanning your source files for JSDoc comments that describe your API. That means every route needs a comment block like this:

swagger-autogen — what you have to write per route

/**
 * #swagger.tags = ['Users']
 * #swagger.description = 'Create a new user'
 * #swagger.parameters['body'] = {
 *   in: 'body',
 *   description: 'User data',
 *   required: true,
 *   schema: {
 *     $name: 'Alice',
 *     $email: 'alice@example.com',
 *     age: 28
 *   }
 * }
 * #swagger.responses[201] = {
 *   description: 'User created',
 *   schema: { $id: 1, $name: 'Alice', $email: 'alice@example.com' }
 * }
 */
app.post('/users', handler)

nodox-cli — what you write

app.use(nodox(app))   // ← this is it

app.post('/users', validate(CreateUserSchema), handler)
// Swagger docs appear at /__nodox automatically.

Migration from swagger-autogen

If you're already using swagger-autogen, switching takes about 5 minutes:

  1. Run npm install nodox-cli
  2. Add app.use(nodox(app)) before your routes
  3. Wrap any inline validators with validate(schema) for confirmed schemas
  4. Remove your swagger-autogen JSDoc comments (or leave them; nodox ignores them)
  5. Delete your swagger-autogen build script and generated swagger-output.json

Your docs are now live at /__nodox with zero build step.

Get started

npm install nodox-cli npx nodox-cli init Full setup guide →