-
Notifications
You must be signed in to change notification settings - Fork 0
OpenAPIAsSingleSourceOfTruth
title: OpenAPI as Single Source of Truth radar_quadrant: Techniques radar_ring: Assess radar_position: center
OpenAPI as Single Source of Truth is the practice of treating an OpenAPI specification file as the sole authoritative definition of an API, and generating all derivative artifacts — server stubs, client SDKs, request validation middleware, and documentation — from that one file. Changes to the API are made in the spec first; code and docs follow via code generation tooling such as openapi-generator, Speakeasy, or similar.
APIs maintained without a single source of truth tend to drift: the server implementation diverges from the documentation, client libraries fall behind, and validation logic is duplicated in multiple places. The OpenAPI-first pattern addresses this by inverting the relationship — the spec drives the implementation rather than documenting it after the fact.
Placed in Assess at center position because the approach is well-supported by tooling, addresses a well-known pain point, and is applicable to any team building or maintaining HTTP APIs. The center position reflects that the technique requires upfront investment in spec discipline and generator configuration; teams with small or stable APIs may not feel sufficient pain to justify the setup cost, while teams with multiple consumers or frequent API changes are likely to benefit immediately.
The technique is distinct from simply writing an OpenAPI spec alongside code; the key criterion is that generated artifacts replace hand-maintained ones and the spec is treated as the only source of change.