🔌OpenAPI Specification
Also known as OpenAPI, Swagger, OAS, openapi.yaml
One file that lists each path of a REST API and what it sends back.
Think of it like
Think of it like a full menu. It lists every dish and what comes with it.
Example
Emma writes an openapi.yaml for her shop API. A tool turns it into a docs site where partners can try every endpoint.
Why it matters
One file can drive the docs, the tests and the client code, so they never drift apart.
Definition
Example code
yaml
openapi: 3.1.0
paths:
/books/{id}:
get:
summary: Get one bookCommon mistake
Key takeaways
- 1Describes a REST API. Every endpoint and field.
- 2YAML or JSON. Read by tools.
- 3Formerly Swagger. Same idea, new name.