OpenAPI as an Executable Contract
OpenAPI describes HTTP APIs using a machine-readable document. It can describe paths, operations, parameters, request bodies, responses, schemas, authentication schemes, and examples.
The specification can power documentation, client generation, server stubs, validation, testing, and API governance.
For teams, OpenAPI can become the central contract from which frontend clients and automated tests are generated.
OpenAPI Endpoint Fragment
paths:
/users/{id}:
get:
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: User returned
'404':
description: User not found💡 OpenAPI describes the endpoint contract independently from the server implementation.