### Basic Authentication Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of how to configure basic HTTP authentication. ```APIDOC ## Basic Authentication Example ### Description Example of how to configure basic HTTP authentication. ### Method Not applicable (configuration example) ### Endpoint Not applicable (configuration example) ### Parameters Not applicable ### Request Example Not applicable ### Response Not applicable ```yaml type: http scheme: basic ``` ``` -------------------------------- ### Binary Examples Source: https://spec.openapis.org/oas/latest.html Illustrates how to reference binary data using `externalValue` for examples. ```APIDOC ## Binary Examples Fully binary data is shown using `externalValue`: ```yaml content: image/png: schema: {} examples: Red: externalValue: ./examples/2-by-2-red-pixels.png ``` ``` -------------------------------- ### API Key Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of how to configure an API key for authentication. ```APIDOC ## API Key Example ### Description Example of how to configure an API key for authentication, specifying its name and location. ### Method Not applicable (configuration example) ### Endpoint Not applicable (configuration example) ### Parameters Not applicable ### Request Example Not applicable ### Response Not applicable ```yaml type: apiKey name: api-key in: header ``` ``` -------------------------------- ### Define Object with Examples Source: https://spec.openapis.org/oas/v3.2.0.html Include example instances of an object directly within its schema definition using the `examples` keyword. ```yaml type: object properties: id: type: integer format: int64 name: type: string required: - name examples: - name: Puma id: 1 ``` -------------------------------- ### Path Item Object Example Source: https://spec.openapis.org/oas/latest.html An example demonstrating the Path Item Object for a 'get' operation on the '/pets' path. ```APIDOC ## /pets ### Description Returns all pets from the system that the user has access to ### Method GET ### Endpoint /pets ### Response #### Success Response (200) - **description** (string) - A list of pets. - **content** (object) - **application/json** (object) - **schema** (object) - **type** (string) - array - **items** (object) - **$ref** (string) - #/components/schemas/pet ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Server Object Example Source: https://spec.openapis.org/oas/latest.html Examples of how to define one or multiple servers, including the use of variables. ```APIDOC ## Server Object Examples ### Single Server Example ```yaml url: https://development.gigantic-server.com/v1 description: Development server name: dev ``` ### Multiple Servers Example ```yaml servers: - url: https://development.gigantic-server.com/v1 description: Development server name: dev - url: https://staging.gigantic-server.com/v1 description: Staging server name: staging - url: https://api.gigantic-server.com/v1 description: Production server name: prod ``` ### Server with Variables Example ```yaml servers: - url: https://{username}.gigantic-server.com:{port}/{basePath} description: The production API server name: prod variables: username: default: demo description: A user-specific subdomain. Use `demo` for a free sandbox environment. port: enum: - '8443' - '443' default: '8443' basePath: default: v2 ``` ``` -------------------------------- ### Paths Object Example Source: https://spec.openapis.org/oas/v3.2.0.html An example demonstrating the structure of the Paths object, defining a '/pets' path with a GET operation. This includes response schemas and content types. ```yaml /pets: get: description: Returns all pets from the system that the user has access to responses: '200': description: A list of pets. content: application/json: schema: type: array items: $ref: '#/components/schemas/pet' ``` -------------------------------- ### Path Item Object Example Source: https://spec.openapis.org/oas/v3.2.0.html This example demonstrates the structure of a Path Item Object, including GET and COPY operations, path parameters, and response definitions. ```yaml get: description: Returns pets based on ID summary: Find pets by ID operationId: getPetsById responses: '200': description: pet response content: '*/*': schema: type: array items: $ref: '#/components/schemas/Pet' default: description: error payload content: text/html: schema: $ref: '#/components/schemas/ErrorModel' parameters: - name: id in: path description: ID of pet to use required: true schema: type: array items: type: string style: simple additionalOperations: COPY: description: Copies pet information based on ID summary: Copies pets by ID operationId: copyPetsById responses: '200': description: pet response content: '*/*': schema: type: array items: $ref: '#/components/schemas/Pet' default: description: error payload content: text/html: schema: $ref: '#/components/schemas/ErrorModel' ``` -------------------------------- ### Path Item Object Example Source: https://spec.openapis.org/oas/v3.2.0.html An example demonstrating the structure of a Path Item Object, including GET, PATH parameters, and additional operations like COPY. ```APIDOC ## Path Item Object Example ### Description This example shows a Path Item Object with a GET operation, path parameters, and an additional COPY operation. ### Example ```yaml get: description: Returns pets based on ID summary: Find pets by ID operationId: getPetsById responses: '200': description: pet response content: '*/*': schema: type: array items: $ref: '#/components/schemas/Pet' default: description: error payload content: text/html: schema: $ref: '#/components/schemas/ErrorModel' parameters: - name: id in: path description: ID of pet to use required: true schema: type: array items: type: string style: simple additionalOperations: COPY: description: Copies pet information based on ID summary: Copies pets by ID operationId: copyPetsById responses: '200': description: pet response content: '*/*': schema: type: array items: $ref: '#/components/schemas/Pet' default: description: error payload content: text/html: schema: $ref: '#/components/schemas/ErrorModel' ``` ``` -------------------------------- ### String Serialization Examples Source: https://spec.openapis.org/oas/v3.2.0.html Examples of how a string value is serialized based on different styles and explode configurations. ```text string -> "blue" ``` -------------------------------- ### Tag Object Examples Source: https://spec.openapis.org/oas/v3.2.0.html Examples demonstrating the structure of Tag Objects for organizing API operations. ```yaml tags: - name: account-updates summary: Account Updates description: Account update operations kind: nav - name: partner summary: Partner description: Operations available to the partners network parent: external kind: audience - name: external summary: External description: Operations available to external consumers kind: audience ``` -------------------------------- ### JSON Examples Source: https://spec.openapis.org/oas/latest.html Demonstrates how to define JSON examples for schema properties, including 'dataValue' and 'serializedValue'. ```APIDOC ## JSON Examples When writing in YAML, JSON syntax can be used for `dataValue` (as shown in the `noRating` example) but is not required. While this example shows the behavior of both `dataValue` and `serializedValue` for JSON (in the 'withRating` example), in most cases only the data form is needed. ```yaml content: application/json: schema: type: object required: - author - title properties: author: type: string title: type: string rating: type: number minimum: 1 maximum: 5 multipleOf: 0.5 examples: noRating: summary: A not-yet-rated work dataValue: author: A. Writer title: The Newest Book withRating: summary: A work with an average rating of 4.5 stars dataValue: author: A. Writer title: An Older Book rating: 4.5 serializedValue: | { "author": "A. Writer", "title": "An Older Book", "rating": 4.5 } ``` ``` -------------------------------- ### JSON Examples Source: https://spec.openapis.org/oas/v3.2.0.html Demonstrates how to represent JSON data within OpenAPI, including examples with and without a rating. ```APIDOC ## JSON Examples When writing in YAML, JSON syntax can be used for `dataValue` (as shown in the `noRating` example) but is not required. While this example shows the behavior of both `dataValue` and `serializedValue` for JSON (in the 'withRating` example), in most cases only the data form is needed. ```yaml content: application/json: schema: type: object required: - author - title properties: author: type: string title: type: string rating: type: number minimum: 1 maximum: 5 multipleOf: 0.5 examples: noRating: summary: A not-yet-rated work dataValue: author: A. Writer title: The Newest Book withRating: summary: A work with an average rating of 4.5 stars dataValue: author: A. Writer title: An Older Book rating: 4.5 serializedValue: | { "author": "A. Writer", "title": "An Older Book", "rating": 4.5 } ``` ``` -------------------------------- ### Implicit OAuth2 Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of configuring the implicit OAuth2 flow. ```APIDOC ## Implicit OAuth2 Example ### Description Example of configuring the implicit OAuth2 flow, including the authorization URL and available scopes. ### Method Not applicable (configuration example) ### Endpoint Not applicable (configuration example) ### Parameters Not applicable ### Request Example Not applicable ### Response Not applicable ```yaml type: oauth2 flows: implicit: authorizationUrl: https://example.com/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets ``` ``` -------------------------------- ### Path Item Object Example Source: https://spec.openapis.org/oas/latest.html This example demonstrates a Path Item Object with a GET operation, path parameters, and an additional custom operation (COPY). ```APIDOC ## GET /pets/{id} ### Description Returns pets based on ID. ### Method GET ### Endpoint /pets/{id} ### Parameters #### Path Parameters - **id** (string) - Required - ID of pet to use ### Response #### Success Response (200) - **Pet** (array) - Description of the pet response #### Response Example ```json { "example": "pet response" } ``` #### Error Response (default) - **ErrorModel** (object) - Description of the error payload #### Response Example ```json { "example": "error payload" } ``` ## COPY /pets/{id} ### Description Copies pet information based on ID. ### Method COPY ### Endpoint /pets/{id} ### Parameters #### Path Parameters - **id** (string) - Required - ID of pet to use ### Response #### Success Response (200) - **Pet** (array) - Description of the pet response #### Response Example ```json { "example": "pet response" } ``` #### Error Response (default) - **ErrorModel** (object) - Description of the error payload #### Response Example ```json { "example": "error payload" } ``` ``` -------------------------------- ### Header Object Example Source: https://spec.openapis.org/oas/v3.2.0.html Examples of Header objects, demonstrating how to define headers with specific types and constraints. ```APIDOC ## Header Object Example A simple header of type `integer`: ```yaml X-Rate-Limit-Limit: description: The number of allowed requests in the current period schema: type: integer ``` Requiring that a strong `ETag` header (with a value starting with `"` rather than `W/`) is present. ```yaml ETag: required: true schema: type: string # Note that quotation marks are part of the # ETag value, unlike many other headers that # use a quoted string purely for managing # reserved characters. pattern: ^" example: '"xyzzy"' ``` ``` -------------------------------- ### Object Serialization Examples Source: https://spec.openapis.org/oas/v3.2.0.html Examples of how an object value is serialized based on different styles and explode configurations. ```text object -> { "R": 100, "G": 200, "B": 150 } ``` -------------------------------- ### Paths Object Example Source: https://spec.openapis.org/oas/latest.html An example of a Paths Object defining operations for a specific path, including a GET operation to retrieve pets. ```yaml /pets: get: description: Returns all pets from the system that the user has access to responses: '200': description: A list of pets. content: application/json: schema: type: array items: $ref: '#/components/schemas/pet' ``` -------------------------------- ### Simple Style Serialization Examples Source: https://spec.openapis.org/oas/latest.html Demonstrates serialized examples for the 'simple' style with 'false' and 'true' explode configurations for string, array, and object types. ```text style | explode | undefined | string | array | object ---|---|---|---|---|--- simple | false | _empty_ | blue | blue,black,brown | R,100,G,200,B,150 simple | true | _empty_ | blue | blue,black,brown | R=100,G=200,B=150 ``` -------------------------------- ### Array Serialization Examples Source: https://spec.openapis.org/oas/v3.2.0.html Examples of how an array value is serialized based on different styles and explode configurations. ```text array -> ["blue", "black", "brown"] ``` -------------------------------- ### Example Log Entries (JSON-SEQ) Source: https://spec.openapis.org/oas/v3.2.0.html Example of log entries formatted as JSON Text Sequences. ```APIDOC ## Example Log Entries (JSON-SEQ) ### External Value (Content provided in a separate file due to YAML limitations) ``` 0x1E{ "timestamp": "1985-04-12T23:20:50.52Z", "level": 1, "message": "Hi!" } 0x1E{ "timestamp": "1985-04-12T23:20:51.37Z", "level": 1, "message": "Bye!" } ``` ``` -------------------------------- ### Responses Object Example (Success and Default) Source: https://spec.openapis.org/oas/latest.html Example demonstrating a 200 response for a successful operation and a default response for errors. ```APIDOC ## Responses Object Example (Success and Default) ### Description A 200 response for a successful operation and a default response for others (implying an error). ### Code Example ```yaml '200': description: a pet to be returned content: application/json: schema: $ref: '#/components/schemas/Pet' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/ErrorModel' ``` ``` -------------------------------- ### JSON Schema with YAML Examples Source: https://spec.openapis.org/oas/v3.2.0.html Defines a JSON schema for a 'Pet' object and includes examples for 'cat', 'dog', and a reference to 'frog-example'. The example values are provided in YAML format, which is directly convertible to JSON. ```yaml application/json: schema: $ref: '#/components/schemas/Pet' examples: cat: summary: An example of a cat value: name: Fluffy petType: Cat color: White gender: male breed: Persian dog: summary: An example of a dog with a cat's name value: name: Puma petType: Dog color: Black gender: Female breed: Mixed frog: $ref: '#/components/examples/frog-example' ``` -------------------------------- ### Reference Object Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of a Reference Object pointing to a schema component. ```yaml $ref: '#/components/schemas/Pet' ``` -------------------------------- ### Matrix Style Serialization Examples Source: https://spec.openapis.org/oas/latest.html Shows serialized examples for the 'matrix' style with both 'false' and 'true' explode configurations for string, array, and object types. ```text style | explode | undefined | string | array | object ---|---|---|---|---|--- matrix | false | ;color | ;color=blue | ;color=blue,black,brown | ;color=R,100,G,200,B,150 matrix | true | ;color | ;color=blue | ;color=blue;color=black;color=brown | ;R=100;G=200;B=150 ``` -------------------------------- ### Example Log Entries (JSONL/NDJSON) Source: https://spec.openapis.org/oas/v3.2.0.html Example of log entries formatted as JSON Lines or NDJSON. ```APIDOC ## Example Log Entries (JSONL/NDJSON) ### Value ```json {"timestamp": "1985-04-12T23:20:50.52Z", "level": 1, "message": "Hi!"} {"timestamp": "1985-04-12T23:20:51.37Z", "level": 1, "message": "Bye!"} ``` ``` -------------------------------- ### Request Body Examples Source: https://spec.openapis.org/oas/v3.2.0.html Illustrates how to define examples for a request body, supporting various media types and referencing schema definitions. ```APIDOC ## Request Body Examples A request body with a referenced schema definition. ```yaml description: user to add to the system content: application/json: schema: $ref: '#/components/schemas/User' examples: user: summary: User example externalValue: https://foo.bar/examples/user-example.json application/xml: schema: $ref: '#/components/schemas/User' examples: user: summary: User example in XML externalValue: https://foo.bar/examples/user-example.xml text/plain: examples: user: summary: User example in plain text externalValue: https://foo.bar/examples/user-example.txt '*/*': examples: user: summary: User example in other format externalValue: https://foo.bar/examples/user-example.whatever ``` ``` -------------------------------- ### Path Item Object Example Source: https://spec.openapis.org/oas/v3.2.0.html An example demonstrating the structure of a Path Item Object, including HTTP methods and responses. ```APIDOC ## GET /pets ### Description Returns all pets from the system that the user has access to ### Method GET ### Endpoint /pets ### Responses #### Success Response (200) - **description** (string) - A list of pets. #### Response Example ```json [ { "id": 1, "name": "Fido", "tag": "dog" } ] ``` ``` -------------------------------- ### Security Scheme Object Examples Source: https://spec.openapis.org/oas/latest.html Provides examples of how to define different types of security schemes in OpenAPI. ```APIDOC ## Security Scheme Object Examples ### Basic Authentication Example ```yaml type: http scheme: basic ``` ### API Key Example ```yaml type: apiKey name: api-key in: header ``` ### JWT Bearer Example ```yaml type: http scheme: bearer bearerFormat: JWT ``` ### MutualTLS Example ```yaml type: mutualTLS description: Cert must be signed by example.com CA ``` ### Implicit OAuth2 Example ```yaml type: oauth2 flows: implicit: authorizationUrl: https://example.com/api/oauth/dialog scopes: write:pets: modify pets in your account read:pets: read your pets ``` ``` -------------------------------- ### Response Object Examples Source: https://spec.openapis.org/oas/v3.2.0.html Examples illustrating different Response Object configurations, including complex types, simple strings, and responses with headers. ```APIDOC ## Response Object Examples Response of an array of a complex type: ```yaml description: A complex object array response content: application/json: schema: type: array items: $ref: '#/components/schemas/VeryComplexType' ``` Response with a string type: ```yaml description: A simple string response content: text/plain: schema: type: string ``` Plain text response with headers: ```yaml description: A simple string response content: text/plain: schema: type: string example: 'whoa!' headers: X-Rate-Limit-Limit: description: The number of allowed requests in the current period schema: type: integer X-Rate-Limit-Remaining: description: The number of remaining requests in the current period schema: type: integer X-Rate-Limit-Reset: description: The number of seconds left in the current period schema: type: integer ``` Response with no return value: ```yaml description: object created ``` ``` -------------------------------- ### Ordered, Unnamed Multipart Example Source: https://spec.openapis.org/oas/v3.2.0.html This example shows a `multipart/mixed` payload with a JSON metadata document followed by an image. ```APIDOC ## Multipart: multipart/mixed ### Description Defines a multipart/mixed payload with a JSON metadata object and an image. ### Schema ```yaml multipart/mixed: schema: type: array prefixItems: - type: object properties: author: type: string created: type: string format: datetime copyright: type: string license: type: string - {} prefixEncoding: - {} - contentType: image/* ``` ``` -------------------------------- ### Form Style Serialization Examples Source: https://spec.openapis.org/oas/latest.html Illustrates serialized examples for the 'form' style with 'false' and 'true' explode settings for string, array, and object types. ```text style | explode | undefined | string | array | object ---|---|---|---|---|--- form | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150 form | true | color= | color=blue | color=blue&color=black&color=brown | R=100&G=200&B=150 ``` -------------------------------- ### Request Body Example Source: https://spec.openapis.org/oas/latest.html An example illustrating how to define a Request Body Object with different media types and referenced schemas. ```APIDOC ## Request Body Example A request body with a referenced schema definition. ```yaml description: user to add to the system content: application/json: schema: $ref: '#/components/schemas/User' examples: user: summary: User example externalValue: https://foo.bar/examples/user-example.json application/xml: schema: $ref: '#/components/schemas/User' examples: user: summary: User example in XML externalValue: https://foo.bar/examples/user-example.xml text/plain: examples: user: summary: User example in plain text externalValue: https://foo.bar/examples/user-example.txt '*/*': examples: user: summary: User example in other format externalValue: https://foo.bar/examples/user-example.whatever ``` ``` -------------------------------- ### Label Style Serialization Examples Source: https://spec.openapis.org/oas/latest.html Provides serialized examples for the 'label' style with 'false' and 'true' explode settings for string, array, and object types. ```text style | explode | undefined | string | array | object ---|---|---|---|---|--- label | false | . | .blue | .blue,black,brown | .R,100,G,200,B,150 label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150 ``` -------------------------------- ### Cookie Style Serialization Examples Source: https://spec.openapis.org/oas/latest.html Shows serialized examples for the 'cookie' style with 'false' and 'true' explode configurations for string, array, and object types. ```text style | explode | undefined | string | array | object ---|---|---|---|---|--- cookie | false | color= | color=blue | color=blue,black,brown | color=R,100,G,200,B,150 cookie | true | color= | color=blue | color=blue; color=black; color=brown | R=100; G=200; B=150 ``` -------------------------------- ### DeepObject Style Serialization Example Source: https://spec.openapis.org/oas/latest.html Illustrates the serialized example for the 'deepObject' style for object types. Other styles and explode configurations are undefined or not applicable. ```text style | explode | undefined | string | array | object ---|---|---|---|---|--- deepObject | _n/a_ | _n/a_ | _n/a_ | _n/a_ | color%5BR%5D=100&color%5BG%5D=200&color%5BB%5D=150 ``` -------------------------------- ### Basic Serialization Examples Source: https://spec.openapis.org/oas/latest.html Illustrates the direct serialized values for string, array, and object types before applying specific styles. ```text string -> "blue" array -> ["blue", "black", "brown"] object -> { "R": 100, "G": 200, "B": 150 } ``` -------------------------------- ### Schema with Named Element and CDATA Source: https://spec.openapis.org/oas/v3.2.0.html Demonstrates overriding the default node type to 'element' and specifying a 'name' for the root XML element when referencing a schema. This example shows how to use the same schema with different root element names for GET and PUT operations. ```yaml paths: /docs: get: responses: "200": content: application/xml: schema: xml: nodeType: element name: StoredDocument $ref: "#/components/schemas/Documentation" examples: stored: dataValue: content: Awesome Docs externalValue: ./examples/stored.xml put: requestBody: required: true content: application/xml: schema: xml: nodeType: element name: UpdatedDocument $ref: "#/components/schemas/Documentation" examples: updated: dataValue: content: Awesome Docs externalValue: ./examples/updated.xml responses: "201": {} components: schemas: Documentation: xml: nodeType: none type: object properties: content: type: string contentMediaType: text/html xml: nodeType: cdata ``` ```xml Awesome Docs]]> ``` ```xml Awesome Docs]]> ``` -------------------------------- ### MutualTLS Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of configuring mutual TLS authentication. ```APIDOC ## MutualTLS Example ### Description Example of configuring mutual TLS authentication, including a description for the required certificate. ### Method Not applicable (configuration example) ### Endpoint Not applicable (configuration example) ### Parameters Not applicable ### Request Example Not applicable ### Response Not applicable ```yaml type: mutualTLS description: Cert must be signed by example.com CA ``` ``` -------------------------------- ### Binary Examples Source: https://spec.openapis.org/oas/v3.2.0.html Shows how to reference binary data using `externalValue` for content types like images. ```APIDOC ## Binary Examples Fully binary data is shown using `externalValue`: ```yaml content: image/png: schema: {} examples: Red: externalValue: ./examples/2-by-2-red-pixels.png ``` ``` -------------------------------- ### Server Object with Variables Example Source: https://spec.openapis.org/oas/v3.2.0.html Demonstrates using variables within a server URL for dynamic configuration. ```APIDOC ## Server Object with Variables Example ### Example with Variables ```yaml servers: - url: https://{username}.gigantic-server.com:{port}/{basePath} description: The production API server name: prod variables: username: default: demo description: A user-specific subdomain. Use `demo` for a free sandbox environment. port: enum: - '8443' - '443' default: '8443' basePath: default: v2 ``` ``` -------------------------------- ### JWT Bearer Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of configuring HTTP bearer authentication with JWT. ```APIDOC ## JWT Bearer Example ### Description Example of configuring HTTP bearer authentication, specifying the bearer token format as JWT. ### Method Not applicable (configuration example) ### Endpoint Not applicable (configuration example) ### Parameters Not applicable ### Request Example Not applicable ### Response Not applicable ```yaml type: http scheme: bearer bearerFormat: JWT ``` ``` -------------------------------- ### Server Object Example Source: https://spec.openapis.org/oas/v3.2.0.html Illustrates how to define a single server or multiple servers within an OpenAPI document. ```APIDOC ## Server Object Example ### Single Server Example ```yaml url: https://development.gigantic-server.com/v1 description: Development server name: dev ``` ### Multiple Servers Example ```yaml servers: - url: https://development.gigantic-server.com/v1 description: Development server name: dev - url: https://staging.gigantic-server.com/v1 description: Staging server name: staging - url: https://api.gigantic-server.com/v1 description: Production server name: prod ``` ``` -------------------------------- ### Simple Style Serialization (Explode: true) Source: https://spec.openapis.org/oas/v3.2.0.html Serialized examples for the 'simple' style with 'explode' set to true, demonstrating string, array, and object serialization. ```text simple | true | _empty_ | blue | blue,black,brown | R=100,G=200,B=150 ``` -------------------------------- ### Server Object with URL Variables Source: https://spec.openapis.org/oas/v3.2.0.html Demonstrates using variables within a server URL for dynamic configuration. Includes default values and enums for variables. ```yaml servers: - url: https://{username}.gigantic-server.com:{port}/{basePath} description: The production API server name: prod variables: username: # note! no enum here means it is an open value default: demo description: A user-specific subdomain. Use `demo` for a free sandbox environment. port: enum: - '8443' - '443' default: '8443' basePath: # open meaning there is the opportunity to use special base paths as assigned by the provider, default is "v2" default: v2 ``` -------------------------------- ### JSON Schema with JSON Examples in YAML Source: https://spec.openapis.org/oas/v3.2.0.html Demonstrates defining a JSON schema for a 'Pet' object within a YAML document, where the example values for 'cat' and 'dog' are provided using JSON syntax. A reference to 'frog-example' is also included. ```yaml application/json: schema: $ref: '#/components/schemas/Pet' examples: cat: summary: An example of a cat value: { "name": "Fluffy", "petType": "Cat", "color": "White", "gender": "male", "breed": "Persian" } dog: summary: An example of a dog with a cat's name value: { "name": "Puma", "petType": "Dog", "color": "Black", "gender": "Female", "breed": "Mixed" } frog: $ref: '#/components/examples/frog-example' ``` -------------------------------- ### External Documentation Object Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of an External Documentation Object, used for referencing additional resources. ```yaml description: Find more info here url: https://example.com ``` -------------------------------- ### Path Templating Matching Example Source: https://spec.openapis.org/oas/latest.html Illustrates how concrete paths are matched before templated paths. Ensure unique templated path names within the same hierarchy. ```plaintext /pets/{petId} /pets/mine ``` -------------------------------- ### Ambiguous Path Templating Example Source: https://spec.openapis.org/oas/latest.html Shows a scenario that may lead to ambiguous path resolution due to similar templated path structures. ```plaintext /{entity}/me /books/{id} ``` -------------------------------- ### Operation Object Example Source: https://spec.openapis.org/oas/v3.2.0.html This example demonstrates the structure of an Operation Object, including details for an 'updatePetWithForm' operation. ```yaml tags: - pet summary: Updates a pet in the store with form data operationId: updatePetWithForm parameters: - name: petId in: path description: ID of pet that needs to be updated required: true schema: type: string requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: name: description: Updated name of the pet type: string status: description: Updated status of the pet type: string required: - status responses: '200': description: Pet updated. content: application/json: {} application/xml: {} '405': description: Method Not Allowed content: application/json: {} application/xml: {} security: - petstore_auth: - write:pets - read:pets ``` -------------------------------- ### Relative Schema Document Reference Example Source: https://spec.openapis.org/oas/v3.2.0.html Example of a Reference Object using a relative path to a schema document. ```yaml $ref: Pet.yaml ``` -------------------------------- ### Responses Object Example Source: https://spec.openapis.org/oas/v3.2.0.html An example of a Responses Object defining a 200 success response and a default error response. ```APIDOC ## Responses Object Example A 200 response for a successful operation and a default response for others (implying an error): ```yaml '200': description: a pet to be returned content: application/json: schema: $ref: '#/components/schemas/Pet' default: description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/ErrorModel' ``` ```