Skip to content

Category · 1 tool · 1 guide

OpenAPI and Swagger tools

OpenAPI, formerly known as Swagger, is the standard way to describe an HTTP API in a machine-readable file. One document lists every endpoint, parameter, request body, response and authentication scheme. From it, teams generate interactive documentation, client SDKs, server stubs, mock servers and contract tests, so the spec becomes the single source of truth for the API.

That only works if the spec is correct. A broken $ref, a path parameter that is not declared, two operations with the same operationId or a response without a description might render fine in one viewer and then crash a code generator or produce a client with missing methods. Large specs written by several people drift quickly, and mistakes are hard to spot by reading YAML.

The tools here check OpenAPI and Swagger documents for structural errors and common mistakes, with messages that point to the exact location in the spec. Specs often describe unreleased or internal APIs, so validation happens entirely in your browser.

Tools in this category

Common tasks

Key concepts

OpenAPI vs Swagger
Swagger 2.0 was the original specification. It was renamed OpenAPI with version 3.0, and Swagger is now the name of a set of tools. Version 3.1 aligns schemas fully with JSON Schema.
$ref
A JSON Reference such as #/components/schemas/User that points to a definition elsewhere. It keeps specs DRY, but a typo in the path breaks every place that uses it.
operationId
A unique name for an operation. Code generators use it as the method name, so duplicates or missing values produce broken or awkward clients.
Components
The section that holds reusable schemas, parameters, responses and security schemes, referenced from operations to avoid repeating definitions.
Contract-first design
Writing the OpenAPI spec before the implementation, reviewing it with API consumers, then generating code from it, so the spec and the API cannot drift apart.

Best practices

  1. Validate the spec in CI on every pull request so broken references never reach generated docs or clients.
  2. Give every operation a unique, descriptive operationId such as listOrders or createInvoice.
  3. Define shared request and response shapes once in components and reference them with $ref.
  4. Document error responses, not just 200, including the error body schema clients should expect.
  5. Version the spec alongside the code in the same repository so changes are reviewed together.

Guides