10 — API Documentation Tools: OpenAPI, Postman, Stoplight, ReadMe
I used to write API documentation by hand at the end of a project, and it was stale before it shipped. The frame that fixed the whole workflow: good API documentation is generated from a single machine-readable contract (the OpenAPI spec), and the tools differ in which part of the lifecycle they help with — authoring the spec, testing against it, mocking it, or rendering it into docs humans can read. [1] The documentation isn't a separate artifact maintained by hand; it's a projection of the contract, and the contract is the source of truth.
The reason this framing matters is that it tells you what each tool is for. Swagger renders. Postman tests. Stoplight designs. ReadMe hosts. They're not competitors so much as tools that operate on the same OpenAPI file from different angles. Picking tools is really picking which lifecycle stages you want help with.
The contract: OpenAPI (née Swagger)
The foundation of the whole stack is the OpenAPI Specification — a standardized, machine-readable format for describing an API's endpoints, parameters, request/response shapes, auth, and status codes [2]. It started life as Swagger; the spec was donated to the Linux Foundation's OpenAPI Initiative and renamed, so "Swagger" and "OpenAPI" refer to the same lineage — Swagger is now the tooling brand, OpenAPI is the spec [2][3].
The reason OpenAPI is the foundation is that a single spec file can drive every downstream activity. The same openapi.yaml can be rendered into reference docs (Swagger UI), used to generate client SDKs, mocked for testing, validated against in contract tests, and imported into Postman collections. The contract becomes the single source of truth; the documentation stops being a hand-maintained website that drifts from the code.
# a single OpenAPI fragment drives docs, mocks, clients, and tests
paths:
/orders/{id}:
get:
parameters:
- name: id
in: path
required: true
schema: { type: string }
responses:
'200':
description: an order
'404':
description: not foundThe discipline this enables is design-first: write the spec before the implementation, share it with consumers, mock against it, and only then build the server. The spec is the contract; the code is one implementation of it.
Swagger UI: rendering the reference
Swagger UI is the most visible face of OpenAPI — the interactive reference page that renders a spec into a browsable list of endpoints, each with a "Try it out" button [3]. It's the zero-effort way to turn an OpenAPI file into usable documentation, and it's what most teams ship as their first API docs. Its strength is that it's free, generated, and never out of sync with the spec (because it is the spec, rendered). Its limitation is that it's a reference, not a tutorial — it tells you what each endpoint does, not how to string them together to accomplish a task.
Postman: testing, mocking, exploring
Postman started as a graphical HTTP client and grew into a full API platform [4]. For documentation-adjacent work, its roles are: exploring an API interactively (build requests, inspect responses), maintaining collections of saved requests that double as executable examples, mocking an API from a spec so consumers can develop against it before it exists, and running automated tests against endpoints.
The thing I use Postman for most is the collection-as-documentation pattern: a shared, versioned set of real requests that a new consumer can run with one click. It's more hands-on than a reference page — the consumer sees actual request bodies, headers, and responses — which makes it a good complement to Swagger-style reference docs. Postman's weakness is that collections can drift from the spec if maintained separately; importing from OpenAPI keeps them aligned.
Stoplight: designing the spec visually
Stoplight sits at the authoring end [5]. Writing OpenAPI YAML by hand is verbose and error-prone; Stoplight provides a visual editor for designing APIs — you describe endpoints, schemas, and responses in forms, and it generates valid OpenAPI underneath. It also bakes in linting (style enforcement), mocking, and documentation hosting, all driven from the same spec.
The pitch is the design-first workflow made practical: a team can design, review, and iterate on an API's contract in a tool that validates as you go, before any server code is written. For organizations serious about API consistency across many teams, a design tool like Stoplight (or equivalent) is what makes "we follow these API standards" actually enforceable rather than aspirational.
ReadMe: hosted, interactive docs
ReadMe is the polished end of the spectrum — a hosted documentation platform that turns an OpenAPI spec into a beautiful, interactive developer portal [6]. Beyond reference rendering, it adds log-in-to-try-it functionality (every example runs with the reader's own API key), guides and tutorials alongside the reference, and versioned docs.
The differentiator from Swagger UI is the experience: ReadMe is built for the API consumer's onboarding journey, not just their lookup journey. The tradeoff is that it's a product you pay for and host with. For a public API whose success depends on developer adoption, that investment pays off; for an internal API, Swagger UI plus a README is usually enough.
Choosing among them
The selection logic I use:
- Every API with more than one consumer should have an OpenAPI spec. Non-negotiable; the spec is the contract.
- Swagger UI for zero-cost reference docs rendered from the spec. Default starting point.
- Postman for exploration, mocking, and executable example collections. Useful from day one.
- Stoplight (or a similar design tool) when the team is large enough that visual authoring and linting pay for themselves, or when API standards need enforcing.
- ReadMe (or equivalent) for public APIs where developer onboarding is a business concern.
The anti-pattern to avoid: hand-writing docs that drift from the code, or maintaining a Postman collection separate from an OpenAPI spec. Either way the documentation lies, and a lying API doc is worse than none.
How I use this
For any API I ship, I start with the OpenAPI spec and treat it as the source of truth — I write it before (or alongside) the implementation, render it with Swagger UI as the baseline reference, and use Postman collections imported from it for exploration and testing. When the API is public-facing and adoption matters, that's when I reach for a hosted docs product like ReadMe. The unifying rule: documentation is generated from the contract, never handwritten alongside it. The contract is the thing I maintain; the docs are a view.
References
[1] Swagger, "API Documentation Tools," 2024. [Online]. Available: https://swagger.io/
[2] OpenAPI Initiative, "OpenAPI Specification," 2024. [Online]. Available: https://www.openapis.org/
[3] HubSpot, "What is Swagger?," 2024. [Online]. Available: https://blog.hubspot.com/website/what-is-swagger
[4] Postman, "Postman API Platform," 2024. [Online]. Available: https://www.postman.com/
[5] Stoplight, "Stoplight — API Design Platform," 2024. [Online]. Available: https://stoplight.io/
[6] ReadMe, "ReadMe — Interactive API Documentation," 2024. [Online]. Available: https://readme.com
Knowledge check · Question 1 of 5
What is the relationship between Swagger and OpenAPI?
Comments
Leave a Comment
You must be signed in to comment
0 Comments
No comments yet. Be the first to comment!