OpenAPI Paths, Operations and Schemas
An OpenAPI document normally contains metadata, servers, paths, operations, parameters, request bodies, responses, reusable schemas, security schemes, and examples.
Schemas can define reusable resource models. Operations describe the HTTP method and expected behavior.
The specification can become the source for interactive documentation, client generation, mock servers, validation middleware, and automated compatibility checks.
Reusable Schema
components:
schemas:
User:
type: object
required:
- id
- name
properties:
id:
type: string
name:
type: string
email:
type: string
format: email💡 Reusable schemas reduce duplication and make the API contract machine-readable.