Comparison · as of November 2026
Swastik Codes docs vs Swagger UI
Both turn your OpenAPI document into a page your server serves. How they differ in size, layout, sending requests and setup, including where Swagger UI is the better choice.
Swagger UI is the page most developers first see for an API: FastAPI serves it at /docs by default, and swagger-ui-express, @nestjs/swagger and @fastify/swagger-ui add it to Node.js servers. The Swastik Codes docs packages (swastik-codes on PyPI and @swastik-codes/docs on npm) do the same job: your server reads its OpenAPI document and serves a page for it. This page compares the two as of November 2026. Swagger UI facts come from its documentation and the swagger-ui-dist 5.17 package; Swastik Codes facts come from the packages themselves.
Short verdict. Choose Swagger UI if you rely on its plugin system or OAuth 2 login flows, need it to be open source (Apache 2.0), or your team already knows it well. Choose Swastik Codes if you want a much smaller page, documentation that reads like a guide (introduction, sections, code samples in five languages), a separate page for sending requests that works like an API client, and an easy way to edit names, descriptions and grouping without changing your code.
At a glance
| Swastik Codes docs | Swagger UI | |
|---|---|---|
| Install | pip install swastik-codes or npm install @swastik-codes/docs, then one line | Built into FastAPI; swagger-ui-express, @nestjs/swagger or @fastify/swagger-ui for Node.js; or swagger-ui-dist |
| Downloaded by the browser | 22 KB (compressed) in our measurement | About 427 KB (compressed) for 5.17 in the same measurement |
| Pages | Documentation at /swc/docs and a request collection at /swc/collection | One page: operations listed by tag, each with Try it out |
| Code samples | cURL, JavaScript, Python, Go and PHP for every request | cURL for the request you just ran; more through plugins |
| Sending requests | Collection page with params, auth, headers, JSON, form and file bodies, response viewer with status, time and size | Try it out inside each operation, with the response below it |
| Auth | Bearer, Basic and API key (header or query), kept for the browser tab | Bearer, Basic, API key, and OAuth 2 flows with a login popup |
| Editing the page | A swastik-codes.json file: title, introduction, servers, colours, sections, names, hidden paths, extra pages | Your OpenAPI document and Swagger UI's configuration options (layout, plugins, deep linking and others) |
| Extending | No plugin system | Plugins and custom layouts |
| Frameworks | FastAPI, Starlette, Flask, Django, ASGI and WSGI apps; Express, NestJS, Fastify, Hono, Koa and Node.js | Any: a static page that loads a spec URL |
| Licence | Free to use; proprietary | Open source (Apache 2.0) |
| Branding | Swastik Codes logo, credit and Run in Swastik Codes button stay on the pages | No vendor branding required |
Page size
We loaded the files each page needs on 5 November 2026 and measured what the browser downloads.
| Compressed | Unpacked | |
|---|---|---|
| Swastik Codes docs 0.1.0 | 22 KB | 74 KB |
Swagger UI 5.17 (swagger-ui-bundle.js + swagger-ui.css) | about 427 KB | about 1.6 MB |
ReDoc 2.1 (redoc.standalone.js), for reference | about 232 KB | about 908 KB |
The difference matters most on phones and slow connections, and for an API that is opened often by people inside a company. Both are cached after the first visit.
Documentation
Swagger UI lists operations under their tags. Each operation expands to show its parameters, request body (as an example or a schema model) and responses. The OpenAPI info.description sits at the top. It is a reference: compact and complete, and familiar to anyone who has used an API before.
Swastik Codes writes a documentation page. An introduction with the base URL and how to authenticate comes first, then sections and folders in the order you choose, then one section per request: what it does, its parameters and body fields as tables (nested fields indented), its responses, a code sample in the reader's language and an example response beside it. Extra Markdown pages (errors, pagination, webhooks) sit under the introduction. It reads more like documentation people write by hand, generated from the same OpenAPI document.
Sending requests
Swagger UI puts Try it out inside each operation: fill in fields, press Execute, and the response appears under the operation with a cURL command for what was sent.
Swastik Codes gives sending requests a page of its own at /swc/collection, laid out like an API client: every request in a folder tree on the left, a URL bar with Send, tabs for params, authorization, headers and body (JSON with beautify, form fields, file uploads), and a response panel with pretty JSON, headers, status, time and size. Each request keeps its edits while you move between requests, and Code shows the request as you have it in five languages. Run in Swastik Codes opens the whole API as a collection in the full app, where you can save requests, write tests and run them.
Both send requests from the reader's browser, so requests to another origin need that server to allow CORS.
Setup and configuration
FastAPI has Swagger UI built in, which is hard to beat: no install at all. In Node.js both need a package and a few lines.
Swagger UI is configured with options in code (swagger_ui_parameters in FastAPI, swaggerOptions in swagger-ui-express), and what the page says comes from your OpenAPI document, so changing a description means changing your code.
Swastik Codes reads an optional swastik-codes.json next to your app. It can rename the API, write the introduction in Markdown, list sandbox and production servers, set an accent colour, group tags into sections, rename or hide individual requests and add Markdown pages, all without touching your routes. The file is re-read when it changes, so you edit it and reload.
Where Swagger UI is the better choice
- OAuth 2 flows. Swagger UI can run an OAuth 2 authorization-code or implicit login in a popup and fill in the token. In Swastik Codes docs you paste a token you already have.
- Plugins. Swagger UI can be extended with plugins and custom layouts. Swastik Codes docs has no plugin system.
- Open source. Swagger UI is Apache 2.0, and you can change it as you like. The Swastik Codes packages are free but proprietary, and their branding stays.
- Zero install in FastAPI. Swagger UI is already there.
Using both
You don't have to choose. In FastAPI, mount(app) adds /swc/docs and /swc/collection and leaves /docs and /redoc alone, so you can try the Swastik Codes pages next to the ones you have. The same is true in Express or NestJS: both packages can be mounted at different paths.
Frequently asked questions
Is Swastik Codes docs a fork of Swagger UI?
No. It is written from scratch: plain TypeScript with no framework, which is why it is about a twentieth of the size. It reads the same OpenAPI 3.0, 3.1 and Swagger 2.0 documents.
Will my existing OpenAPI document work?
Yes. Nothing in your document has to change. Tags become folders, summary becomes the request's name, and descriptions, examples, enums, defaults, $refs and security schemes are all used.
Can I serve the Swastik Codes pages at /docs?
Yes. In FastAPI, create the app with docs_url=None and call mount(app, prefix=""); the pages are then at /docs and /collection. In Node.js pass prefix: '/'.
Spotted something out of date? Email support@swastik.codes and we will correct it.