Lesson 4.1

Documenting with OpenAPI

An OpenAPI description covers paths, parameters, schemas, and responses in a machine-readable form, which means clients, mocks, and documentation pages can all be generated from…

5mBeginner11.5k students

Overview

Documentation that cannot lie

An OpenAPI description covers paths, parameters, schemas, and responses in a machine-readable form, which means clients, mocks, and documentation pages can all be generated from it.

Hand-written documentation drifts within weeks. Deriving the specification from the same schemas your validation uses keeps them aligned by construction.

Document error responses too. An API that only describes its happy path leaves every client to discover failure modes in production.

In this lesson you will:

  • Describe endpoints, schemas, and errors
  • Generate documentation from the source of truth
  • Keep the spec honest with tests

Resources

Previous Lesson
Next Lesson
Documenting with OpenAPI — API Design with Node.js — Vertex