Frequently asked questions

Can't find your answer? Email routeman@swastik.ai or call +91 76545 31678.

How do I generate a Postman collection from my API code?

Python (Django, DRF, Flask, FastAPI): install routeman in the virtualenv your project runs in, then run pip install routeman and routeman generate from the project folder. Node.js, Bun or Deno (Express, NestJS, Fastify, Next.js and more): run npx routeman-cli in the project folder. Both write postman/<name>.postman_collection.json and a local environment file. Import both in Postman with File → Import.

Do I need OpenAPI, Swagger, drf-spectacular or @nestjs/swagger?

No. routeman reads your application's real routes and its serializers, DTOs, schemas and models directly. You don't need an OpenAPI schema or any documentation library: no drf-spectacular, drf-yasg, flasgger, swagger-jsdoc or @nestjs/swagger. For FastAPI it uses the OpenAPI document that FastAPI already builds in memory, and it also picks up routes hidden with include_in_schema=False. If you do have a spec, routeman-cli --openapi can build from it.

Is routeman free?

Yes. routeman is open source under the MIT licence and free for personal and commercial use. It is published on PyPI as routeman and on npm as routeman-cli.

Does routeman send requests to my API or touch my database?

No. The Python edition imports your app to read its URL configuration, the same way manage.py or your WSGI/ASGI server does. The Node.js edition doesn't run your code at all: it parses the source files. Neither runs queries or migrations or sends HTTP requests. The output is JSON files on disk.

Which frameworks and versions are supported?

Python (routeman, Python 3.9+): Django 3.2 to 6, Django REST framework 3.12+, Flask 2.0 to 3.x (including blueprints, MethodView, Flask-RESTful and flask-smorest) and FastAPI 0.95+ with Pydantic v1 or v2. Node.js (routeman-cli, Node.js 18.3+, Bun or Deno): Express 4/5, Fastify 4/5, NestJS, Koa, Hono, Elysia, Hapi, AdonisJS 6, Next.js, Nuxt/Nitro, SvelteKit, Astro, Remix, routing-controllers, tsoa, LoopBack 4 and more. See all frameworks.

Does routeman work with Express, NestJS, Fastify or Next.js?

Yes, through routeman-cli on npm. Run npx routeman-cli in the project folder (or pnpm dlx, yarn dlx, bunx, deno run -A npm:routeman-cli). It follows routers, mounts, plugins, controllers and file-based routes, and reads zod, Joi, yup, TypeBox, class-validator and other schemas. See the Express, NestJS, Fastify and Next.js guides.

Does routeman-cli need node_modules, a build or a running server?

No. routeman-cli parses JavaScript and TypeScript (including JSX and decorators) with a vendored Babel parser and follows imports, tsconfig paths and package.json imports itself. It works on a fresh clone without npm install, with no tsc build, no database and no secrets.

What is the difference between routeman and routeman-cli?

They are the same tool for two ecosystems. routeman on PyPI covers Python APIs and imports your app read-only to read its routes. routeman-cli on npm covers Node.js, Bun and Deno APIs and reads the source statically, without running it. Both produce the same Postman Collection v2.1 output with auth, a login script, environments and smoke tests. Once installed, both commands are called routeman.

How does routeman handle authentication like JWT or DRF tokens?

It detects the scheme from your code: Bearer/JWT (SimpleJWT, flask-jwt-extended, FastAPI OAuth2, jwt.verify, Passport, @fastify/jwt, NestJS guards), DRF Token and Knox, Basic, API key headers and session auth. It sets collection-level auth, marks public endpoints as No Auth and adds a test script to the login request that saves access_token and refresh_token into the environment automatically.

Which Postman collection format does routeman produce?

Postman Collection Format v2.1 (collection.json schema), the format Postman, Newman, Insomnia and most API clients import. Environment files use Postman's environment format with secrets such as access_token and password marked as secret.

Can I regenerate the collection when my API changes without duplicating it in Postman?

Yes. Collection and request ids are stable (derived from the project and route), so importing a regenerated file replaces the previous version instead of creating a copy. Many teams run routeman generate in CI and commit the postman/ folder.

Can I use the generated collection with Newman in CI?

Yes. Every request includes a test that fails when the server answers with a 5xx status, so newman run postman/<name>.postman_collection.json -e postman/<name>.local.postman_environment.json works as an instant smoke test of the whole API.

Can I use the collection in Swastik Codes or with an AI coding assistant?

Yes. The output is standard Postman Collection v2.1 JSON, so it imports into Swastik Codes, the API platform from the same team. To let Claude Code, Cursor or VS Code use your API, serve the collection with the Swastik Codes CLI: swc mcp postman/<name>.postman_collection.json -e postman/<name>.local.postman_environment.json. It runs locally, redacts secrets and only sends GET requests unless you add --allow-write. See the docs.

What if my view or handler has no serializer, DTO or schema?

routeman reads the handler's source code and looks for the fields it uses, for example request.data.get('email'), request.args.get('page', type=int) or json.loads(request.body) in Python, and const { email, password } = req.body, req.query.page or await request.json() in JavaScript. Requests built this way are marked as inferred so you know to double-check them.

My settings need environment variables. Will routeman still load the project?

Yes. routeman reads .env from the project folder automatically. The Python edition loads it before importing your app. The Node.js edition uses it for values such as PORT and path prefixes, falling back to .env.example. Use --env-file path/to/file for a different file.

How do I add staging and production environments?

Pass -e once per server, for example routeman generate -e staging=https://staging.example.com -e production=https://api.example.com. You can also list them under [routeman.environments] in routeman.toml (Python) or "environments" in routeman.config.json (Node.js). routeman writes one Postman environment file per server.

Can I leave internal or admin endpoints out?

Admin, static-file and 404 catch-all routes are left out automatically. Exclude anything else with a regular expression: routeman generate -x '^/internal/' -x '^/health', or exclude in the config file.

Does it work with Django Channels or FastAPI WebSockets?

WebSocket routes from Django Channels and FastAPI are found and listed in the collection description, so they are documented alongside your HTTP endpoints.

Is routeman an official Postman product?

No. routeman is an independent open-source project by Swastik Tech Solutions Pvt Ltd, built by Divakar. Postman is a trademark of Postman, Inc.

How can I report a bug or request a feature?

Email routeman@swastik.ai with your framework and version, the command you ran and its output (routeman routes output helps a lot), or use the contact page.