LintDrift
← Back to blog

Catch outdated API docs in the pull request

Outdated API documentation is cheap to fix in the pull request that caused it and expensive to fix after customers have copied the old example. That gap between the code and the reference is API documentation drift, and the change and the correction belong in the same review.

Why after-the-fact audits stall

A quarterly docs audit produces a spreadsheet. The person who renamed the parameter has moved on. The page has been quoted in a changelog, an SDK readme, and two support macros. The audit is accurate and already late.

A pull-request check runs while the diff is open. The author still knows why id became userId. The reviewer is already looking at that file.

What the check should contain

Each finding needs enough to act without leaving GitHub:

  • Severity, and whether that severity fails the check.
  • File and line in the documentation.
  • The documented value and the actual value.
  • The evidence: the route, the schema property, or the missing operation.
  • A suggested correction, marked as a suggestion.

Three concrete failures cover most of the pain on an API change:

  1. The documented path does not match the route.
  2. A response property in code is absent from the documented schema.
  3. The page links to a guide that this pull request deleted.

The first two are contract failures. The third is a broken reference. They need different checks, which is why OpenAPI validation is not a link checker. A new public operation with no page at all is a fourth case, a documentation coverage gap, and it belongs in the same report.

Other pages can pass. Say so. A check that only shouts is harder to trust than one that also reports what held.

What not to ask the author to do

Do not add a separate docs workflow. Install the GitHub App, select the repositories, and let the check run when the pull request touches the API or the docs. Authors keep opening pull requests the way they already do.

LintDrift posts that check as a GitHub Check Run. The deterministic comparison is the finding. An explanation of the rename is optional help, and it does not replace the comparison. We explain that split in deterministic checks versus an AI documentation review.

LintDrift works on GitHub repositories with TypeScript/Node code, OpenAPI specs, and Markdown or MDX docs. The Free plan covers one repository, and Pro ($29/month) adds pull-request annotations and suggested fixes. Compare the plans or start free on one repository.

Catch the next outdated endpoint before it merges.