OpenAPI is the standard machine-readable contract for REST APIs. Write once — generate docs, SDKs, mock servers, and test suites automatically.
Minimal OpenAPI spec
openapi: "3.1.0"
info:
title: Product API
version: "1.0.0"
paths:
/products/{id}:
get:
summary: Get a product by ID
parameters:
- name: id
in: path
required: true
schema: { type: string }
responses:
"200": { description: Product found }
"404": { description: Not found }