OpenAPI
ELI5 — The Vibe Check
OpenAPI is a standard way to describe your REST API in a YAML or JSON file. Once you have the spec, tools can auto-generate documentation, client libraries, mock servers, and tests. FastAPI generates it automatically. It's like a blueprint for your API that machines can read.
Real Talk
OpenAPI (formerly Swagger) is a specification for describing RESTful APIs in a machine-readable format (YAML/JSON). It defines endpoints, request/response schemas, authentication, and error codes. The specification enables automated documentation generation, client SDK generation, server stub generation, and API testing tools.
Show Me The Code
openapi: 3.0.0
paths:
/users:
get:
summary: List users
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
When You'll Hear This
"FastAPI generates the OpenAPI spec automatically from your type hints." / "We use the OpenAPI spec to auto-generate our TypeScript client."
Related Terms
API Documentation
API documentation is the instruction manual for your API. It tells other developers what endpoints exist, what data to send, and what they'll get back.
FastAPI
FastAPI is a Python framework that's both blazing fast and auto-generates documentation for your API.
REST (Representational State Transfer)
REST is a set of rules for how APIs should behave. Think of it as the etiquette guide for servers and clients talking to each other.
Swagger
Swagger is the old name for OpenAPI, plus the suite of tools around it.