OpenAPI Specification (OAS 3.x) is a standard for describing REST APIs in JSON/YAML. Benefits: interactive documentation (Swagger UI, Redoc), client SDK generation (openapi-generator), server stub generation, request/response validation (middleware), and contract testing. Schema-first approach: define the OpenAPI spec before implementing. This enables frontend teams to work against mock servers while the backend is being built.
Design the spec first, implement second.
API design decisions are cheapest to change in a YAML file. Once endpoints are in production with clients depending on them, changes are expensive. Spec-first enables parallel frontend/backend with mock servers.
Hand-written API clients go stale immediately. openapi-generator generates fully typed clients in any language from the live spec. Regenerate on every spec change — always in sync.
Documentation says field X is required but code makes it optional. Schemathesis automatically tests your API against the spec and catches these inconsistencies. Run in CI on every PR.
Sign in to share your feedback and join the discussion.