API Design
OpenAPI 3.1 Specification (JSON) JSON Example
An OpenAPI 3.1 specification JSON example — info, a path operation with parameters, responses, and a component schema. Copy-ready reference for documenting and validating REST APIs.
Field Reference
openapirequiredstringSpec version — '3.1.0' aligns OpenAPI with JSON SchemainforequiredobjectAPI metadata: title and version (required), plus description, contact, licensepathsrequiredobjectMap of URL path → operations (get, post, put, delete, …)components.schemasoptionalobjectReusable JSON Schemas referenced via $ref to avoid duplication$refoptionalstringJSON Reference pointer to a reusable component, e.g. #/components/schemas/OrderVariants
POST operation with request bodyA create endpoint with a JSON request body schema.
Common Use Cases
- →Documenting a REST API so tools can generate docs and client SDKs
- →Validating requests and responses against a contract
- →Designing an API contract-first before writing code
openapiswaggerapi specrest apiapi documentationschema
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
API DesignREST API ResponseGeneric REST API response wrapper with data payload, status, and pagination meta.API DesignError ResponseREST API error JSON with status code, machine-readable error code, and validation details.AI & LLMMCP Message (Model Context Protocol)Model Context Protocol (MCP) JSON-RPC 2.0 message: tools/list and tools/call.