swagger.io/docs/specification/api-host-and-base-path/
API Server and Base Path
OAS 3 This page applies to OpenAPI 3 – the latest version of the OpenAPI Specification. If you use OpenAPI 2 (fka Swagger), visit OpenAPI 2 pages. API Server and Base URL All API endpoints are relative to the base URL. For example, assuming the base URL
swagger.io
swagger.io/docs/specification/basic-structure/
Basic Structure
OAS 3 This page applies to OpenAPI 3 – the latest version of the OpenAPI Specification. If you use OpenAPI 2 (fka Swagger), visit OpenAPI 2 pages. Basic Structure You can write OpenAPI definitions in YAML or JSON. In this guide, we use only YAML examples
swagger.io
OpenAPI Specification - Version 3.0.3 | Swagger
OpenAPI Specification Version 3.0.3 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 RF
swagger.io
Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.Fixed Fields
Field NameTypeDescription
schemas | Map[string, Schema Object | Reference Object] | An object to hold reusable Schema Objects. |
responses | Map[string, Response Object | Reference Object] | An object to hold reusable Response Objects. |
parameters | Map[string, Parameter Object | Reference Object] | An object to hold reusable Parameter Objects. |
examples | Map[string, Example Object | Reference Object] | An object to hold reusable Example Objects. |
requestBodies | Map[string, Request Body Object | Reference Object] | An object to hold reusable Request Body Objects. |
headers | Map[string, Header Object | Reference Object] | An object to hold reusable Header Objects. |
securitySchemes | Map[string, Security Scheme Object | Reference Object] | An object to hold reusable Security Scheme Objects. |
links | Map[string, Link Object | Reference Object] | An object to hold reusable Link Objects. |
callbacks | Map[string, Callback Object | Reference Object] | An object to hold reusable Callback Objects. |
This object MAY be extended with Specification Extensions.
All the fixed fields declared above are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9\.\-_]+$.
Field Name Examples:
Components Object Example