components.schemas stores reusable, named JSON Schemas independently of individual operations. This separates complete resource models from their uses, improving consistency, maintainability, and the API’s subject-matter view. section 7.3.1 section 7.8
A reusable Product model
Define Product once under components.schemas, then reference it from request and response schemas with $ref: #/components/schemas/Product. This avoids copied definitions and unwanted variations. section 7.3.2 section 7.8
Listing 7.1 Reusable schema
openapi: 3.1.0
info: ...
paths: ...
components: #1
schemas: #2
Product: {} #3
The minimal structure places schemas inside components; Product is a named, initially empty Schema object. section 7.3.2
