diff --git a/src/schemas/validation/README.md b/src/schemas/validation/README.md
deleted file mode 100644
index 57501dfc51..0000000000
--- a/src/schemas/validation/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# OpenAPI 3.X.Y JSON Schema
-
-This directory contains the YAML sources for generating the JSON Schemas for validating OpenAPI definitions of versions 3.X.Y, which are published on [https://spec.openapis.org](https://spec.openapis.org).
-
-Due to limitations of GitHub pages, the schemas on the spec site are served with `Content-Type: application/octet-stream`, but should be interpreted as `application/schema+json`.
-
-The sources in this directory, which have `WORK-IN-PROGRESS` in their `$id`s, are _not intended for direct use_.
-
-## Schema `$id` dates
-
-The published schemas on the spec site have an _iteration date_ in their `id`s.
-This allows the schemas for a release line to be updated independent of the spec patch release cycle.
-
-The iteration version of the JSON Schema can be found in the `$id` field.
-For example, the value of `$id: https://spec.openapis.org/oas/3.1/schema/2021-03-02` means this iteration was created on March 2nd, 2021.
-
-We are [working on](https://github.com/OAI/OpenAPI-Specification/issues/4152) how to best provide programmatic access for determining the latest date for each schema.
-
-## Choosing which schema to use
-
-There are two schemas to choose from for versions 3.1 and greater, both of which have an `$id` that starts with `https://spec.openapis.org/oas/3.X/` and ends with the iteration date:
-
-* `https://spec.openapis.org/oas/3.X/schema/{date}`, source: `schema.yaml` — A self-contained schema that _does not_ validate Schema Objects beyond `type: [object, boolean]`
-* `https://spec.openapis.org/oas/3.1/schema-base/{date}`, source: `schema-base.yaml` — A schema that combines the self-contained schema and the "base" dialect schema to validate Schema Objects with the dialect; this schema does not allow changing `$schema` or `jsonSchemaDialect` to other dialects
-
-Two metaschemas define the OAS "base" dialect:
-
-* `https://spec.openapis.org/oas/3.X/meta/{date}`, source: `meta.yaml` — The vocabulary metaschema for OAS 3.X's extensions to draft 2020-12
-* `https://spec.openapis.org/oas/3.X/dialect/{date}`, source: `dialect.yaml` — The dialect metaschema that extends the standard `draft/2020-12` metaschema by adding the OAS "base" vocabulary
-
-The name "base" for the dialect was intended to indicate that the OAS dialect could be further extended.
-
-~~~mermaid
-flowchart LR
- schema_base
- schema
- dialect
- meta
- schema --> |default| dialect
- schema_base --> |$ref| schema
- schema_base --> |$ref| dialect
- dialect --> |$ref| meta
-~~~
-
-An additional schema that validates the Schema Object with the OAS 3.X dialect but does not restrict changing `$schema` is [under consideration](https://github.com/OAI/OpenAPI-Specification/issues/4147).
-
-## Improving the schemas
-
-As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance.
-
-The schema only validates the mandatory aspects of the OAS.
-Validating requirements that are optional, or field usage that has undefined or ignored behavior are not within the scope of this schema.
-Schemas to perform additional optional validation are [under consideration](https://github.com/OAI/OpenAPI-Specification/issues/4141).
-
-Improvements can be submitted by opening a PR against the `vX.Y-dev` branch of the respective specification version.
-
-Modify the `schema.yaml` file and add test cases for your changes.
-
-The TSC will then:
-- Run tests on the updated schema
-- Update the iteration version
-- Publish the new version
-
-The [test suite](../../../tests/schema) is part of this package.
-
-```bash
-npm install
-npm test
-```
diff --git a/src/schemas/validation/dialect.yaml b/src/schemas/validation/dialect.yaml
deleted file mode 100644
index d300d94feb..0000000000
--- a/src/schemas/validation/dialect.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-$id: https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS
-$schema: https://json-schema.org/draft/2020-12/schema
-
-title: OpenAPI 3.1 Schema Object Dialect
-description: A JSON Schema dialect describing schemas found in OpenAPI v3.1 Descriptions
-
-$dynamicAnchor: meta
-
-$vocabulary:
- https://json-schema.org/draft/2020-12/vocab/applicator: true
- https://json-schema.org/draft/2020-12/vocab/content: true
- https://json-schema.org/draft/2020-12/vocab/core: true
- https://json-schema.org/draft/2020-12/vocab/format-annotation: true
- https://json-schema.org/draft/2020-12/vocab/meta-data: true
- https://json-schema.org/draft/2020-12/vocab/unevaluated: true
- https://json-schema.org/draft/2020-12/vocab/validation: true
- https://spec.openapis.org/oas/3.1/vocab/base: false
-
-allOf:
- - $ref: https://json-schema.org/draft/2020-12/schema
- - $ref: https://spec.openapis.org/oas/3.1/meta/WORK-IN-PROGRESS
diff --git a/src/schemas/validation/meta.yaml b/src/schemas/validation/meta.yaml
deleted file mode 100644
index 6cfce4976d..0000000000
--- a/src/schemas/validation/meta.yaml
+++ /dev/null
@@ -1,70 +0,0 @@
-$id: https://spec.openapis.org/oas/3.1/meta/WORK-IN-PROGRESS
-$schema: https://json-schema.org/draft/2020-12/schema
-
-title: OAS Base Vocabulary
-description: A JSON Schema Vocabulary used in the OpenAPI Schema Dialect
-
-$dynamicAnchor: meta
-
-$vocabulary:
- https://spec.openapis.org/oas/3.1/vocab/base: true
-
-type:
- - object
- - boolean
-properties:
- discriminator:
- $ref: '#/$defs/discriminator'
- example: true
- externalDocs:
- $ref: '#/$defs/external-docs'
- xml:
- $ref: '#/$defs/xml'
-
-$defs:
- discriminator:
- $ref: '#/$defs/extensible'
- properties:
- mapping:
- additionalProperties:
- type: string
- type: object
- propertyName:
- type: string
- required:
- - propertyName
- type: object
- unevaluatedProperties: false
-
- extensible:
- patternProperties:
- ^x-: true
- external-docs:
- $ref: '#/$defs/extensible'
- properties:
- description:
- type: string
- url:
- format: uri-reference
- type: string
- required:
- - url
- type: object
- unevaluatedProperties: false
-
- xml:
- $ref: '#/$defs/extensible'
- properties:
- attribute:
- type: boolean
- name:
- type: string
- namespace:
- format: uri
- type: string
- prefix:
- type: string
- wrapped:
- type: boolean
- type: object
- unevaluatedProperties: false
diff --git a/src/schemas/validation/schema-base.yaml b/src/schemas/validation/schema-base.yaml
deleted file mode 100644
index ea239c03e9..0000000000
--- a/src/schemas/validation/schema-base.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-$id: 'https://spec.openapis.org/oas/3.1/schema-base/WORK-IN-PROGRESS'
-$schema: 'https://json-schema.org/draft/2020-12/schema'
-
-description: The description of OpenAPI v3.1.x Documents using the OpenAPI JSON Schema dialect
-
-$ref: 'https://spec.openapis.org/oas/3.1/schema/WORK-IN-PROGRESS'
-properties:
- jsonSchemaDialect:
- $ref: '#/$defs/dialect'
-
-$defs:
- dialect:
- const: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'
-
- schema:
- $dynamicAnchor: meta
- $ref: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'
- properties:
- $schema:
- $ref: '#/$defs/dialect'
diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml
deleted file mode 100644
index 54c49a2f97..0000000000
--- a/src/schemas/validation/schema.yaml
+++ /dev/null
@@ -1,974 +0,0 @@
-$id: 'https://spec.openapis.org/oas/3.1/schema/WORK-IN-PROGRESS'
-$schema: 'https://json-schema.org/draft/2020-12/schema'
-
-description: The description of OpenAPI v3.1.x Documents without Schema Object validation
-
-type: object
-properties:
- openapi:
- type: string
- pattern: '^3\.1\.\d+(-.+)?$'
- info:
- $ref: '#/$defs/info'
- jsonSchemaDialect:
- type: string
- format: uri
- default: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'
- servers:
- type: array
- items:
- $ref: '#/$defs/server'
- default:
- - url: /
- paths:
- $ref: '#/$defs/paths'
- webhooks:
- type: object
- additionalProperties:
- $ref: '#/$defs/path-item'
- components:
- $ref: '#/$defs/components'
- security:
- type: array
- items:
- $ref: '#/$defs/security-requirement'
- tags:
- type: array
- items:
- $ref: '#/$defs/tag'
- externalDocs:
- $ref: '#/$defs/external-documentation'
-required:
- - openapi
- - info
-anyOf:
- - required:
- - paths
- - required:
- - components
- - required:
- - webhooks
-$ref: '#/$defs/specification-extensions'
-unevaluatedProperties: false
-
-$defs:
- info:
- $comment: https://spec.openapis.org/oas/v3.1#info-object
- type: object
- properties:
- title:
- type: string
- summary:
- type: string
- description:
- type: string
- termsOfService:
- type: string
- format: uri
- contact:
- $ref: '#/$defs/contact'
- license:
- $ref: '#/$defs/license'
- version:
- type: string
- required:
- - title
- - version
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- contact:
- $comment: https://spec.openapis.org/oas/v3.1#contact-object
- type: object
- properties:
- name:
- type: string
- url:
- type: string
- format: uri
- email:
- type: string
- format: email
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- license:
- $comment: https://spec.openapis.org/oas/v3.1#license-object
- type: object
- properties:
- name:
- type: string
- identifier:
- type: string
- url:
- type: string
- format: uri
- required:
- - name
- dependentSchemas:
- identifier:
- not:
- required:
- - url
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- server:
- $comment: https://spec.openapis.org/oas/v3.1#server-object
- type: object
- properties:
- url:
- type: string
- description:
- type: string
- variables:
- type: object
- additionalProperties:
- $ref: '#/$defs/server-variable'
- required:
- - url
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- server-variable:
- $comment: https://spec.openapis.org/oas/v3.1#server-variable-object
- type: object
- properties:
- enum:
- type: array
- items:
- type: string
- minItems: 1
- default:
- type: string
- description:
- type: string
- required:
- - default
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- components:
- $comment: https://spec.openapis.org/oas/v3.1#components-object
- type: object
- properties:
- schemas:
- type: object
- additionalProperties:
- $dynamicRef: '#meta'
- responses:
- type: object
- additionalProperties:
- $ref: '#/$defs/response-or-reference'
- parameters:
- type: object
- additionalProperties:
- $ref: '#/$defs/parameter-or-reference'
- examples:
- type: object
- additionalProperties:
- $ref: '#/$defs/example-or-reference'
- requestBodies:
- type: object
- additionalProperties:
- $ref: '#/$defs/request-body-or-reference'
- headers:
- type: object
- additionalProperties:
- $ref: '#/$defs/header-or-reference'
- securitySchemes:
- type: object
- additionalProperties:
- $ref: '#/$defs/security-scheme-or-reference'
- links:
- type: object
- additionalProperties:
- $ref: '#/$defs/link-or-reference'
- callbacks:
- type: object
- additionalProperties:
- $ref: '#/$defs/callbacks-or-reference'
- pathItems:
- type: object
- additionalProperties:
- $ref: '#/$defs/path-item'
- patternProperties:
- '^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$':
- $comment: Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected
- propertyNames:
- pattern: '^[a-zA-Z0-9._-]+$'
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- paths:
- $comment: https://spec.openapis.org/oas/v3.1#paths-object
- type: object
- patternProperties:
- '^/':
- $ref: '#/$defs/path-item'
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- path-item:
- $comment: https://spec.openapis.org/oas/v3.1#path-item-object
- type: object
- properties:
- $ref:
- type: string
- format: uri-reference
- summary:
- type: string
- description:
- type: string
- servers:
- type: array
- items:
- $ref: '#/$defs/server'
- parameters:
- type: array
- items:
- $ref: '#/$defs/parameter-or-reference'
- get:
- $ref: '#/$defs/operation'
- put:
- $ref: '#/$defs/operation'
- post:
- $ref: '#/$defs/operation'
- delete:
- $ref: '#/$defs/operation'
- options:
- $ref: '#/$defs/operation'
- head:
- $ref: '#/$defs/operation'
- patch:
- $ref: '#/$defs/operation'
- trace:
- $ref: '#/$defs/operation'
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- operation:
- $comment: https://spec.openapis.org/oas/v3.1#operation-object
- type: object
- properties:
- tags:
- type: array
- items:
- type: string
- summary:
- type: string
- description:
- type: string
- externalDocs:
- $ref: '#/$defs/external-documentation'
- operationId:
- type: string
- parameters:
- type: array
- items:
- $ref: '#/$defs/parameter-or-reference'
- requestBody:
- $ref: '#/$defs/request-body-or-reference'
- responses:
- $ref: '#/$defs/responses'
- callbacks:
- type: object
- additionalProperties:
- $ref: '#/$defs/callbacks-or-reference'
- deprecated:
- default: false
- type: boolean
- security:
- type: array
- items:
- $ref: '#/$defs/security-requirement'
- servers:
- type: array
- items:
- $ref: '#/$defs/server'
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- external-documentation:
- $comment: https://spec.openapis.org/oas/v3.1#external-documentation-object
- type: object
- properties:
- description:
- type: string
- url:
- type: string
- format: uri
- required:
- - url
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- parameter:
- $comment: https://spec.openapis.org/oas/v3.1#parameter-object
- type: object
- properties:
- name:
- type: string
- in:
- enum:
- - query
- - header
- - path
- - cookie
- description:
- type: string
- required:
- default: false
- type: boolean
- deprecated:
- default: false
- type: boolean
- schema:
- $dynamicRef: '#meta'
- content:
- $ref: '#/$defs/content'
- minProperties: 1
- maxProperties: 1
- required:
- - name
- - in
- oneOf:
- - required:
- - schema
- - required:
- - content
- if:
- properties:
- in:
- const: query
- required:
- - in
- then:
- properties:
- allowEmptyValue:
- default: false
- type: boolean
- dependentSchemas:
- schema:
- properties:
- style:
- type: string
- explode:
- type: boolean
- allOf:
- - $ref: '#/$defs/examples'
- - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
- - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header'
- - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query'
- - $ref: '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie'
- - $ref: '#/$defs/styles-for-form'
-
- $defs:
- styles-for-path:
- if:
- properties:
- in:
- const: path
- required:
- - in
- then:
- properties:
- style:
- default: simple
- enum:
- - matrix
- - label
- - simple
- required:
- const: true
- required:
- - required
-
- styles-for-header:
- if:
- properties:
- in:
- const: header
- required:
- - in
- then:
- properties:
- style:
- default: simple
- const: simple
-
- styles-for-query:
- if:
- properties:
- in:
- const: query
- required:
- - in
- then:
- properties:
- style:
- default: form
- enum:
- - form
- - spaceDelimited
- - pipeDelimited
- - deepObject
- allowReserved:
- default: false
- type: boolean
-
- styles-for-cookie:
- if:
- properties:
- in:
- const: cookie
- required:
- - in
- then:
- properties:
- style:
- default: form
- const: form
-
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- parameter-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/parameter'
-
- request-body:
- $comment: https://spec.openapis.org/oas/v3.1#request-body-object
- type: object
- properties:
- description:
- type: string
- content:
- $ref: '#/$defs/content'
- required:
- default: false
- type: boolean
- required:
- - content
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- request-body-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/request-body'
-
- content:
- $comment: https://spec.openapis.org/oas/v3.1#fixed-fields-10
- type: object
- additionalProperties:
- $ref: '#/$defs/media-type'
- propertyNames:
- format: media-range
-
- media-type:
- $comment: https://spec.openapis.org/oas/v3.1#media-type-object
- type: object
- properties:
- schema:
- $dynamicRef: '#meta'
- encoding:
- type: object
- additionalProperties:
- $ref: '#/$defs/encoding'
- allOf:
- - $ref: '#/$defs/specification-extensions'
- - $ref: '#/$defs/examples'
- unevaluatedProperties: false
-
- encoding:
- $comment: https://spec.openapis.org/oas/v3.1#encoding-object
- type: object
- properties:
- contentType:
- type: string
- format: media-range
- headers:
- type: object
- additionalProperties:
- $ref: '#/$defs/header-or-reference'
- style:
- default: form
- enum:
- - form
- - spaceDelimited
- - pipeDelimited
- - deepObject
- explode:
- type: boolean
- allowReserved:
- default: false
- type: boolean
- allOf:
- - $ref: '#/$defs/specification-extensions'
- - $ref: '#/$defs/styles-for-form'
- unevaluatedProperties: false
-
- responses:
- $comment: https://spec.openapis.org/oas/v3.1#responses-object
- type: object
- properties:
- default:
- $ref: '#/$defs/response-or-reference'
- patternProperties:
- '^[1-5](?:[0-9]{2}|XX)$':
- $ref: '#/$defs/response-or-reference'
- minProperties: 1
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
- if:
- $comment: either default, or at least one response code property must exist
- patternProperties:
- '^[1-5](?:[0-9]{2}|XX)$': false
- then:
- required: [default]
-
- response:
- $comment: https://spec.openapis.org/oas/v3.1#response-object
- type: object
- properties:
- description:
- type: string
- headers:
- type: object
- additionalProperties:
- $ref: '#/$defs/header-or-reference'
- content:
- $ref: '#/$defs/content'
- links:
- type: object
- additionalProperties:
- $ref: '#/$defs/link-or-reference'
- required:
- - description
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- response-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/response'
-
- callbacks:
- $comment: https://spec.openapis.org/oas/v3.1#callback-object
- type: object
- $ref: '#/$defs/specification-extensions'
- additionalProperties:
- $ref: '#/$defs/path-item'
-
- callbacks-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/callbacks'
-
- example:
- $comment: https://spec.openapis.org/oas/v3.1#example-object
- type: object
- properties:
- summary:
- type: string
- description:
- type: string
- value: true
- externalValue:
- type: string
- format: uri
- not:
- required:
- - value
- - externalValue
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- example-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/example'
-
- link:
- $comment: https://spec.openapis.org/oas/v3.1#link-object
- type: object
- properties:
- operationRef:
- type: string
- format: uri-reference
- operationId:
- type: string
- parameters:
- $ref: '#/$defs/map-of-strings'
- requestBody: true
- description:
- type: string
- body:
- $ref: '#/$defs/server'
- oneOf:
- - required:
- - operationRef
- - required:
- - operationId
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- link-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/link'
-
- header:
- $comment: https://spec.openapis.org/oas/v3.1#header-object
- type: object
- properties:
- description:
- type: string
- required:
- default: false
- type: boolean
- deprecated:
- default: false
- type: boolean
- schema:
- $dynamicRef: '#meta'
- content:
- $ref: '#/$defs/content'
- minProperties: 1
- maxProperties: 1
- oneOf:
- - required:
- - schema
- - required:
- - content
- dependentSchemas:
- schema:
- properties:
- style:
- default: simple
- const: simple
- explode:
- default: false
- type: boolean
- $ref: '#/$defs/examples'
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- header-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/header'
-
- tag:
- $comment: https://spec.openapis.org/oas/v3.1#tag-object
- type: object
- properties:
- name:
- type: string
- description:
- type: string
- externalDocs:
- $ref: '#/$defs/external-documentation'
- required:
- - name
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- reference:
- $comment: https://spec.openapis.org/oas/v3.1#reference-object
- type: object
- properties:
- $ref:
- type: string
- format: uri-reference
- summary:
- type: string
- description:
- type: string
-
- schema:
- $comment: https://spec.openapis.org/oas/v3.1#schema-object
- $dynamicAnchor: meta
- type:
- - object
- - boolean
-
- security-scheme:
- $comment: https://spec.openapis.org/oas/v3.1#security-scheme-object
- type: object
- properties:
- type:
- enum:
- - apiKey
- - http
- - mutualTLS
- - oauth2
- - openIdConnect
- description:
- type: string
- required:
- - type
- allOf:
- - $ref: '#/$defs/specification-extensions'
- - $ref: '#/$defs/security-scheme/$defs/type-apikey'
- - $ref: '#/$defs/security-scheme/$defs/type-http'
- - $ref: '#/$defs/security-scheme/$defs/type-http-bearer'
- - $ref: '#/$defs/security-scheme/$defs/type-oauth2'
- - $ref: '#/$defs/security-scheme/$defs/type-oidc'
- unevaluatedProperties: false
-
- $defs:
- type-apikey:
- if:
- properties:
- type:
- const: apiKey
- required:
- - type
- then:
- properties:
- name:
- type: string
- in:
- enum:
- - query
- - header
- - cookie
- required:
- - name
- - in
-
- type-http:
- if:
- properties:
- type:
- const: http
- required:
- - type
- then:
- properties:
- scheme:
- type: string
- required:
- - scheme
-
- type-http-bearer:
- if:
- properties:
- type:
- const: http
- scheme:
- type: string
- pattern: ^[Bb][Ee][Aa][Rr][Ee][Rr]$
- required:
- - type
- - scheme
- then:
- properties:
- bearerFormat:
- type: string
-
- type-oauth2:
- if:
- properties:
- type:
- const: oauth2
- required:
- - type
- then:
- properties:
- flows:
- $ref: '#/$defs/oauth-flows'
- required:
- - flows
-
- type-oidc:
- if:
- properties:
- type:
- const: openIdConnect
- required:
- - type
- then:
- properties:
- openIdConnectUrl:
- type: string
- format: uri
- required:
- - openIdConnectUrl
-
- security-scheme-or-reference:
- if:
- type: object
- required:
- - $ref
- then:
- $ref: '#/$defs/reference'
- else:
- $ref: '#/$defs/security-scheme'
-
- oauth-flows:
- type: object
- properties:
- implicit:
- $ref: '#/$defs/oauth-flows/$defs/implicit'
- password:
- $ref: '#/$defs/oauth-flows/$defs/password'
- clientCredentials:
- $ref: '#/$defs/oauth-flows/$defs/client-credentials'
- authorizationCode:
- $ref: '#/$defs/oauth-flows/$defs/authorization-code'
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- $defs:
- implicit:
- type: object
- properties:
- authorizationUrl:
- type: string
- format: uri
- refreshUrl:
- type: string
- format: uri
- scopes:
- $ref: '#/$defs/map-of-strings'
- required:
- - authorizationUrl
- - scopes
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- password:
- type: object
- properties:
- tokenUrl:
- type: string
- format: uri
- refreshUrl:
- type: string
- format: uri
- scopes:
- $ref: '#/$defs/map-of-strings'
- required:
- - tokenUrl
- - scopes
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- client-credentials:
- type: object
- properties:
- tokenUrl:
- type: string
- format: uri
- refreshUrl:
- type: string
- format: uri
- scopes:
- $ref: '#/$defs/map-of-strings'
- required:
- - tokenUrl
- - scopes
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- authorization-code:
- type: object
- properties:
- authorizationUrl:
- type: string
- format: uri
- tokenUrl:
- type: string
- format: uri
- refreshUrl:
- type: string
- format: uri
- scopes:
- $ref: '#/$defs/map-of-strings'
- required:
- - authorizationUrl
- - tokenUrl
- - scopes
- $ref: '#/$defs/specification-extensions'
- unevaluatedProperties: false
-
- security-requirement:
- $comment: https://spec.openapis.org/oas/v3.1#security-requirement-object
- type: object
- additionalProperties:
- type: array
- items:
- type: string
-
- specification-extensions:
- $comment: https://spec.openapis.org/oas/v3.1#specification-extensions
- patternProperties:
- '^x-': true
-
- examples:
- properties:
- example: true
- examples:
- type: object
- additionalProperties:
- $ref: '#/$defs/example-or-reference'
-
- map-of-strings:
- type: object
- additionalProperties:
- type: string
-
- styles-for-form:
- if:
- properties:
- style:
- const: form
- required:
- - style
- then:
- properties:
- explode:
- default: true
- else:
- properties:
- explode:
- default: false
diff --git a/tests/schema/fail/invalid_schema_types.yaml b/tests/schema/fail/invalid_schema_types.yaml
deleted file mode 100644
index d295b1f0ed..0000000000
--- a/tests/schema/fail/invalid_schema_types.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-openapi: 3.1.1
-
-# this example shows invalid types for the schemaObject
-
-info:
- title: API
- version: 1.0.0
-components:
- schemas:
- invalid_null: null
- invalid_number: 0
- invalid_array: []
-
diff --git a/tests/schema/fail/no_containers.yaml b/tests/schema/fail/no_containers.yaml
deleted file mode 100644
index c158bcb2b6..0000000000
--- a/tests/schema/fail/no_containers.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-openapi: 3.1.0
-
-# this example should fail as there are no paths, components or webhooks containers (at least one of which must be present)
-
-info:
- title: API
- version: 1.0.0
diff --git a/tests/schema/fail/server_enum_empty.yaml b/tests/schema/fail/server_enum_empty.yaml
deleted file mode 100644
index cd6d30eb3e..0000000000
--- a/tests/schema/fail/server_enum_empty.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-openapi: 3.1.0
-
-# this example should fail as the server variable enum is empty, and so does not contain the default value
-
-info:
- title: API
- version: 1.0.0
-servers:
- - url: https://example.com/{var}
- variables:
- var:
- enum: []
- default: a
-components: {}
diff --git a/tests/schema/fail/servers.yaml b/tests/schema/fail/servers.yaml
deleted file mode 100644
index 1470fe1ec8..0000000000
--- a/tests/schema/fail/servers.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-openapi: 3.1.0
-
-# this example should fail, as servers must be an array, not an object
-
-info:
- title: API
- version: 1.0.0
-paths: {}
-servers:
- url: /v1
- description: Run locally.
diff --git a/tests/schema/fail/unknown_container.yaml b/tests/schema/fail/unknown_container.yaml
deleted file mode 100644
index 7f31e86053..0000000000
--- a/tests/schema/fail/unknown_container.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-openapi: 3.1.0
-
-# this example should fail as overlays is not a valid top-level object/keyword
-
-info:
- title: API
- version: 1.0.0
-overlays: {}
diff --git a/tests/schema/pass/comp_pathitems.yaml b/tests/schema/pass/comp_pathitems.yaml
deleted file mode 100644
index 502ca1fca2..0000000000
--- a/tests/schema/pass/comp_pathitems.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-components:
- pathItems: {}
diff --git a/tests/schema/pass/info_summary.yaml b/tests/schema/pass/info_summary.yaml
deleted file mode 100644
index 30d224afc2..0000000000
--- a/tests/schema/pass/info_summary.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- summary: My lovely API
- version: 1.0.0
-components: {}
diff --git a/tests/schema/pass/json_schema_dialect.yaml b/tests/schema/pass/json_schema_dialect.yaml
deleted file mode 100644
index ae0ed863b3..0000000000
--- a/tests/schema/pass/json_schema_dialect.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-openapi: 3.1.0
-info:
- summary: Testing jsonSchemaDialect
- title: My API
- version: 1.0.0
- license:
- name: Apache 2.0
- identifier: Apache-2.0
-jsonSchemaDialect: https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS
-components:
- schemas:
- WithDollarSchema:
- $id: "locked-metaschema"
- $schema: https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS
-paths: {}
diff --git a/tests/schema/pass/license_identifier.yaml b/tests/schema/pass/license_identifier.yaml
deleted file mode 100644
index fbdba5efbe..0000000000
--- a/tests/schema/pass/license_identifier.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- summary: My lovely API
- version: 1.0.0
- license:
- name: Apache
- identifier: Apache-2.0
-components: {}
diff --git a/tests/schema/pass/mega.yaml b/tests/schema/pass/mega.yaml
deleted file mode 100644
index 98ce577dce..0000000000
--- a/tests/schema/pass/mega.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-openapi: 3.1.0
-info:
- summary: My API's summary
- title: My API
- version: 1.0.0
- license:
- name: Apache 2.0
- identifier: Apache-2.0
-paths:
- /:
- get:
- parameters: []
- /{pathTest}: {}
-webhooks:
- myWebhook:
- $ref: '#/components/pathItems/myPathItem'
- description: Overriding description
-components:
- securitySchemes:
- mtls:
- type: mutualTLS
- pathItems:
- myPathItem:
- post:
- requestBody:
- required: true
- content:
- 'application/json':
- schema:
- type: object
- properties:
- type:
- type: string
- int:
- type: integer
- exclusiveMaximum: 100
- exclusiveMinimum: 0
- none:
- type: 'null'
- arr:
- type: array
- $comment: Array without items keyword
- either:
- type: ['string','null']
- discriminator:
- propertyName: type
- x-extension: true
- myArbitraryKeyword: true
diff --git a/tests/schema/pass/minimal_comp.yaml b/tests/schema/pass/minimal_comp.yaml
deleted file mode 100644
index 4553689ab4..0000000000
--- a/tests/schema/pass/minimal_comp.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-components: {}
diff --git a/tests/schema/pass/minimal_hooks.yaml b/tests/schema/pass/minimal_hooks.yaml
deleted file mode 100644
index e67b2889de..0000000000
--- a/tests/schema/pass/minimal_hooks.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-webhooks: {}
diff --git a/tests/schema/pass/minimal_paths.yaml b/tests/schema/pass/minimal_paths.yaml
deleted file mode 100644
index 016e86796f..0000000000
--- a/tests/schema/pass/minimal_paths.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-paths: {}
diff --git a/tests/schema/pass/non-oauth-scopes.yaml b/tests/schema/pass/non-oauth-scopes.yaml
deleted file mode 100644
index e757452f38..0000000000
--- a/tests/schema/pass/non-oauth-scopes.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-openapi: 3.1.0
-info:
- title: Non-oAuth Scopes example
- version: 1.0.0
-paths:
- /users:
- get:
- security:
- - bearerAuth:
- - 'read:users'
- - 'public'
-components:
- securitySchemes:
- bearerAuth:
- type: http
- scheme: bearer
- bearerFormat: jwt
- description: 'note: non-oauth scopes are not defined at the securityScheme level'
-
diff --git a/tests/schema/pass/path_no_response.yaml b/tests/schema/pass/path_no_response.yaml
deleted file mode 100644
index 334608f111..0000000000
--- a/tests/schema/pass/path_no_response.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-paths:
- /:
- get: {}
diff --git a/tests/schema/pass/path_var_empty_pathitem.yaml b/tests/schema/pass/path_var_empty_pathitem.yaml
deleted file mode 100644
index ba92742f10..0000000000
--- a/tests/schema/pass/path_var_empty_pathitem.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-paths:
- /{var}: {}
diff --git a/tests/schema/pass/schema.yaml b/tests/schema/pass/schema.yaml
deleted file mode 100644
index e192529a68..0000000000
--- a/tests/schema/pass/schema.yaml
+++ /dev/null
@@ -1,55 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-paths: {}
-components:
- schemas:
- model:
- type: object
- properties:
- one:
- description: type array
- type:
- - integer
- - string
- two:
- description: type 'null'
- type: "null"
- three:
- description: type array including 'null'
- type:
- - string
- - "null"
- four:
- description: array with no items
- type: array
- five:
- description: singular example
- type: string
- examples:
- - exampleValue
- six:
- description: exclusiveMinimum true
- exclusiveMinimum: 10
- seven:
- description: exclusiveMinimum false
- minimum: 10
- eight:
- description: exclusiveMaximum true
- exclusiveMaximum: 20
- nine:
- description: exclusiveMaximum false
- maximum: 20
- ten:
- description: nullable string
- type:
- - string
- - "null"
- eleven:
- description: x-nullable string
- type:
- - string
- - "null"
- twelve:
- description: file/binary
diff --git a/tests/schema/pass/servers.yaml b/tests/schema/pass/servers.yaml
deleted file mode 100644
index 77a20498da..0000000000
--- a/tests/schema/pass/servers.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-openapi: 3.1.0
-info:
- title: API
- version: 1.0.0
-paths: {}
-servers:
- - url: /v1
- description: Run locally.
- - url: https://production.com/v1
- description: Run on production server.
diff --git a/tests/schema/pass/valid_schema_types.yaml b/tests/schema/pass/valid_schema_types.yaml
deleted file mode 100644
index 4431adcda5..0000000000
--- a/tests/schema/pass/valid_schema_types.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-openapi: 3.1.1
-
-# this example shows that top-level schemaObjects MAY be booleans
-
-info:
- title: API
- version: 1.0.0
-components:
- schemas:
- anything_boolean: true
- nothing_boolean: false
- anything_object: {}
- nothing_object: { not: {} }
-
diff --git a/tests/schema/pass/webhook-example.yaml b/tests/schema/pass/webhook-example.yaml
deleted file mode 100644
index 2ac1cda985..0000000000
--- a/tests/schema/pass/webhook-example.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-openapi: 3.1.0
-info:
- title: Webhook Example
- version: 1.0.0
-# Since OAS 3.1.0 the paths element isn't necessary. Now a valid OpenAPI Document can describe only paths, webhooks, or even only reusable components
-webhooks:
- # Each webhook needs a name
- newPet:
- # This is a Path Item Object, the only difference is that the request is initiated by the API provider
- post:
- requestBody:
- description: Information about a new pet in the system
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/Pet"
- responses:
- "200":
- description: Return a 200 status to indicate that the data was received successfully
-
-components:
- schemas:
- Pet:
- required:
- - id
- - name
- properties:
- id:
- type: integer
- format: int64
- name:
- type: string
- tag:
- type: string
-
diff --git a/tests/schema/schema.test.mjs b/tests/schema/schema.test.mjs
deleted file mode 100644
index e7b84f0a74..0000000000
--- a/tests/schema/schema.test.mjs
+++ /dev/null
@@ -1,38 +0,0 @@
-import { readdirSync, readFileSync } from "node:fs";
-import YAML from "yaml";
-import { describe, test, expect } from "vitest";
-import { registerSchema } from "@hyperjump/json-schema-coverage/vitest";
-import registerOasSchema from "./oas-schema.mjs";
-
-const parseYamlFromFile = (filePath) => {
- const schemaYaml = readFileSync(filePath, "utf8");
- return YAML.parse(schemaYaml, { prettyErrors: true });
-};
-
-await registerOasSchema();
-await registerSchema("./src/schemas/validation/schema.yaml");
-const fixtures = './tests/schema';
-
-describe("v3.1", () => {
- describe("Pass", () => {
- readdirSync(`${fixtures}/pass`, { withFileTypes: true })
- .filter((entry) => entry.isFile() && /\.yaml$/.test(entry.name))
- .forEach((entry) => {
- test(entry.name, async () => {
- const instance = parseYamlFromFile(`${fixtures}/pass/${entry.name}`);
- await expect(instance).to.matchJsonSchema("./src/schemas/validation/schema-base.yaml");
- });
- });
- });
-
- describe("Fail", () => {
- readdirSync(`${fixtures}/fail`, { withFileTypes: true })
- .filter((entry) => entry.isFile() && /\.yaml$/.test(entry.name))
- .forEach((entry) => {
- test(entry.name, async () => {
- const instance = parseYamlFromFile(`${fixtures}/fail/${entry.name}`);
- await expect(instance).to.not.matchJsonSchema("./src/schemas/validation/schema-base.yaml");
- });
- });
- });
-});
diff --git a/versions/3.1.2-editors.md b/versions/3.1.2-editors.md
new file mode 100644
index 0000000000..fc5f990794
--- /dev/null
+++ b/versions/3.1.2-editors.md
@@ -0,0 +1,22 @@
+# OpenAPI Specification Editors
+
+## Active
+
+* Henry Andrews [@handrews](https://github.com/handrews)
+* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc)
+* Karen Etheridge [@karenetheridge](https://github.com/karenetheridge)
+* Lorna Mitchell [@lornajane](https://github.com/lornajane)
+* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh)
+* Miguel Quintero [@miqui](https://github.com/miqui)
+* Mike Kistler [@mikekistler](https://github.com/mikekistler)
+* Ralf Handl [@ralfhandl](https://github.com/ralfhandl)
+* Vincent Biret [@baywet](https://github.com/baywet)
+
+## Emeritus
+
+* Ron Ratovsky [@webron](https://github.com/webron)
+* Darrel Miller [@darrelmiller](https://github.com/darrelmiller)
+* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson)
+* Uri Sarid [@usarid](https://github.com/usarid)
+* Jason Harmon [@jharmn](https://github.com/jharmn)
+* Tony Tam [@fehguy](https://github.com/fehguy)
diff --git a/src/oas.md b/versions/3.1.2.md
similarity index 89%
rename from src/oas.md
rename to versions/3.1.2.md
index b2db701c19..43c2a04cfe 100644
--- a/src/oas.md
+++ b/versions/3.1.2.md
@@ -1,6 +1,6 @@
# OpenAPI Specification
-## Version 3.1.1
+## Version 3.1.2
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](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
@@ -43,6 +43,7 @@ Path templating refers to the usage of template expressions, delimited by curly
Each template expression in the path MUST correspond to a path parameter that is included in the [Path Item](#path-item-object) itself and/or in each of the Path Item's [Operations](#operation-object). An exception is if the path item is empty, for example due to ACL constraints, matching path parameters are not required.
The value for these path parameters MUST NOT contain any unescaped "generic syntax" characters described by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3): forward slashes (`/`), question marks (`?`), or hashes (`#`).
+See [URL Percent-Encoding](#url-percent-encoding) for additional guidance on escaping characters.
### Media Types
@@ -176,7 +177,7 @@ In some cases, an unambiguous URI-based alternative is available, and OAD author
| [Security Requirement Object](#security-requirement-object) `{name}` | [Security Scheme Object](#security-scheme-object) name under the [Components Object](#components-object) | _n/a_ |
| [Discriminator Object](#discriminator-object) `mapping` _(implicit, or explicit name syntax)_ | [Schema Object](#schema-object) name under the Components Object | `mapping` _(explicit URI syntax)_ |
| [Operation Object](#operation-object) `tags` | [Tag Object](#tag-object) `name` (in the [OpenAPI Object](#openapi-object)'s `tags` array) | _n/a_ |
-| [Link Object](#link-object) `operationId` | [Path Item Object](#path-item-object) `operationId` | `operationRef` |
+| [Link Object](#link-object) `operationId` | [Operation Object](#operation-object) `operationId` | `operationRef` |
A fifth implicit connection involves appending the templated URL paths of the [Paths Object](#paths-object) to the appropriate [Server Object](#server-object)'s `url` field.
This is unambiguous because only the entry document's Paths Object contributes URLs to the described API.
@@ -198,7 +199,7 @@ There are no URI-based alternatives for the Security Requirement Object or for t
These limitations are expected to be addressed in a future release.
See [Appendix F: Resolving Security Requirements in a Referenced Document](#appendix-f-resolving-security-requirements-in-a-referenced-document) for an example of the possible resolutions, including which one is recommended by this section.
-The behavior for Discrimator Object non-URI mappings and for the Operation Object's `tags` field operate on the same principles.
+The behavior for Discriminator Object non-URI mappings and for the Operation Object's `tags` field operate on the same principles.
Note that no aspect of implicit connection resolution changes how [URIs are resolved](#relative-references-in-api-description-uris), or restricts their possible targets.
@@ -321,7 +322,7 @@ This is the root object of the [OpenAPI Description](#openapi-description).
| Field Name | Type | Description |
| ---- | :----: | ---- |
-| openapi | `string` | **REQUIRED**. This string MUST be the [version number](#versions) of the OpenAPI Specification that the OpenAPI Document uses. The `openapi` field SHOULD be used by tooling to interpret the OpenAPI Document. This is _not_ related to the API [`info.version`](#info-version) string. |
+| openapi | `string` | **REQUIRED**. This string MUST be the [version number](#versions) of the OpenAPI Specification that the OpenAPI Document uses. The `openapi` field SHOULD be used by tooling to interpret the OpenAPI Document. This is _not_ related to the [`info.version`](#info-version) string, which is the version of the OpenAPI Document. |
| info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required. |
| jsonSchemaDialect | `string` | The default value for the `$schema` keyword within [Schema Objects](#schema-object) contained within this OAS document. This MUST be in the form of a URI. |
| servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` field is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `/`. |
@@ -455,7 +456,7 @@ An object representing a Server.
| Field Name | Type | Description |
| ---- | :----: | ---- |
-| url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Variable substitutions will be made when a variable is named in `{`braces`}`. |
+| url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Query and fragment MUST NOT be part of this URL. Variable substitutions will be made when a variable is named in `{`braces`}`. |
| description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
| variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template. |
@@ -549,7 +550,7 @@ servers:
- '443'
default: '8443'
basePath:
- # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `v2`
+ # open meaning there is the opportunity to use special base paths as assigned by the provider, default is "v2"
default: v2
```
@@ -582,7 +583,7 @@ All objects defined within the Components Object will have no effect on the API
| examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object). |
| requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object). |
| headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object). |
-| securitySchemes | Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object). |
+| securitySchemes | Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object). |
| links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object). |
| callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object). |
| pathItems | Map[`string`, [Path Item Object](#path-item-object)] | An object to hold reusable [Path Item Objects](#path-item-object). |
@@ -1164,13 +1165,16 @@ For simpler scenarios, a [`schema`](#parameter-schema) and [`style`](#parameter-
When `example` or `examples` are provided in conjunction with the `schema` field, the example SHOULD match the specified schema and follow the prescribed serialization strategy for the parameter.
The `example` and `examples` fields are mutually exclusive, and if either is present it SHALL _override_ any `example` in the schema.
-Serializing with `schema` is NOT RECOMMENDED for `in: "cookie"` parameters, `in: "header"` parameters that use HTTP header parameters (name=value pairs following a `;`) in their values, or `in: "header"` parameters where values might have non-URL-safe characters; see [Appendix D](#appendix-d-serializing-headers-and-cookies) for details.
+When serializing `in: "header"` parameters with `schema`, URI percent-encoding MUST NOT be applied; if using an RFC6570 implementation that automatically applies it, it MUST be removed before use.
+Implementations MUST pass header values through unchanged rather than attempting to automatically quote header values, as the quoting rules vary too widely among different headers; see [Appendix D](#appendix-d-serializing-headers-and-cookies) for guidance on quoting and escaping.
+
+Serializing with `schema` is NOT RECOMMENDED for `in: "cookie"` parameters; see [Appendix D](#appendix-d-serializing-headers-and-cookies) for details.
| Field Name | Type | Description |
| ---- | :----: | ---- |
| style | `string` | Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of `in`): for `"query"` - `"form"`; for `"path"` - `"simple"`; for `"header"` - `"simple"`; for `"cookie"` - `"form"`. |
| explode | `boolean` | When this is true, parameter values of type `array` or `object` generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this field has no effect. When [`style`](#parameter-style) is `"form"`, the default value is `true`. For all other styles, the default value is `false`. Note that despite `false` being the default for `deepObject`, the combination of `false` with `deepObject` is undefined. |
-| allowReserved | `boolean` | When this is true, parameter values are serialized using reserved expansion, as defined by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3), which allows [RFC3986's reserved character set](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are [not allowed in the query string](https://datatracker.ietf.org/doc/html/rfc3986#section-3.4) (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see Appendices [C](#appendix-c-using-rfc6570-based-serialization) and [E](#appendix-e-percent-encoding-and-form-media-types) for details. This field only applies to parameters with an `in` value of `query`. The default value is `false`. |
+| allowReserved | `boolean` | When this is true, parameter values are serialized using reserved expansion, as defined by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3), which allows [RFC3986's reserved character set](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are [not allowed in the query string](https://datatracker.ietf.org/doc/html/rfc3986#section-3.4) (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see [URL Percent-Encoding](#url-percent-encoding) for details. This field only applies to parameters with an `in` value of `query`. The default value is `false`. |
| schema | [Schema Object](#schema-object) | The schema defining the type used for the parameter. |
| example | Any | Example of the parameter's potential value; see [Working With Examples](#working-with-examples). |
| examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the parameter's potential value; see [Working With Examples](#working-with-examples). |
@@ -1180,7 +1184,7 @@ See also [Appendix C: Using RFC6570-Based Serialization](#appendix-c-using-rfc65
###### Fixed Fields for use with `content`
For more complex scenarios, the [`content`](#parameter-content) field can define the media type and schema of the parameter, as well as give examples of its use.
-Using `content` with a `text/plain` media type is RECOMMENDED for `in: "header"` and `in: "cookie"` parameters where the `schema` strategy is not appropriate.
+Using `content` with a `text/plain` media type is RECOMMENDED for `in: "cookie"` parameters where the `schema` strategy's percent-encoding and/or delimiter rules are not appropriate.
| Field Name | Type | Description |
| ---- | :----: | ---- |
@@ -1200,7 +1204,49 @@ In order to support common ways of serializing simple parameters, a set of `styl
| pipeDelimited | `array`, `object` | `query` | Pipe separated array values or object properties and values. This option replaces `collectionFormat` equal to `pipes` from OpenAPI 2.0. |
| deepObject | `object` | `query` | Allows objects with scalar properties to be represented using form parameters. The representation of array or object properties is not defined. |
-See [Appendix E](#appendix-e-percent-encoding-and-form-media-types) for a discussion of percent-encoding, including when delimiters need to be percent-encoded and options for handling collisions with percent-encoded data.
+##### URL Percent-Encoding
+
+All API URLs MUST successfully parse and percent-decode using [[RFC3986]] rules.
+
+Content in the `application/x-www-form-urlencoded` format, including query strings produced by [Parameter Objects](#parameter-object) with `in: "query"`, MUST also successfully parse and percent-decode using [[RFC1866]] rules, including treating non-percent-encoded `+` as an escaped space character.
+
+These requirements are specified in terms of percent-_decoding_ rules, which are consistently tolerant across different versions of the various standards that apply to URIs.
+
+Percent-_encoding_ is performed in several places:
+
+* By [[RFC6570]] implementations (or simulations thereof; see [Appendix C](#appendix-c-using-rfc6570-based-serialization))
+* By the Parameter or [Encoding](#encoding-object) Objects when incorporating a value serialized with a [Media Type Object](#media-type-object) for a media type that does not already incorporate URI percent-encoding
+* By the user, prior to passing data through RFC6570's reserved expansion process
+
+When percent-encoding, the safest approach is to percent-encode all characters not in RFC3986's "unreserved" set, and for `form-urlencoded` to also percent-encode the tilde character (`~`) to align with the historical requirements of [[RFC1738]], which is cited by RFC1866.
+This approach is used in examples in this specification.
+
+For `form-urlencoded`, while the encoding algorithm given by RFC1866 requires escaping the space character as `+`, percent-encoding it as `%20` also meets the above requirements.
+Examples in this specification will prefer `%20` when using RFC6570's default (non-reserved) form-style expansion, and `+` otherwise.
+
+Reserved characters MUST NOT be percent-encoded when being used for reserved purposes such as `&=+` for `form-urlencoded` or `,` for delimiting non-exploded array and object values in RFC6570 expansions.
+The result of inserting non-percent-encoded delimiters into data using manual percent-encoding, including via RFC6570's reserved expansion rules, is undefined and will likely prevent implementations from parsing the results back into the correct data structures.
+In some cases, such as inserting `/` into path parameter values, doing so is [explicitly forbidden](#path-templating) by this specification.
+
+See [Appendix E](#appendix-e-percent-encoding-and-form-media-types) for a thorough discussion of percent-encoding options, compatibility, and OAS-defined delimiters that are not allowed by RFC3986, and [Appendix C](#appendix-c-using-rfc6570-based-serialization) for guidance on using RFC6570 implementations.
+
+##### Serialization and Examples
+
+The rules in this section apply to both the Parameter and [Header](#header-object) Objects, both of which use the same mechanisms.
+
+When showing serialized examples using the `example` field or [Example Objects](#example-object), in most cases the value to show is just the value, with all relevant percent-encoding or other encoding/escaping applied, and also including any delimiters produced by the `style` and `explode` configuration.
+
+In cases where the name is an inherent part of constructing the serialization, such as the `name=value` pairs produced by `style: "form"` or the combination of `style: "simple", explode: true`, the name and any delimiter between the name and value MUST be included.
+
+The `matrix` and `label` styles produce a leading delimiter which is always a valid part of the serialization and MUST be included.
+The RFC6570 operators corresponding to `style: "form"` produce a leading delimiter of either `?` or `&` depending on the exact syntax used.
+As the suitability of either delimiter depends on where in the query string the parameter occurs, as well as whether it is in a URI or in `application/x-www-form-urlencoded` content, this leading delimiter MUST NOT be included in examples of individual parameters or media type documents.
+For `in: "cookie", style: "form"`, neither the `&` nor `?` delimiters are ever correct; see [Appendix D: Serializing Headers and Cookies](#appendix-d-serializing-headers-and-cookies) for more details.
+
+For headers, the header name MUST NOT be included as part of the serialization, as it is never part of the RFC6570-derived result.
+However, names produced by `style: "simple", explode: "true"` are included as they appear within the header value, not as separate headers.
+
+The following section illustrates these rules.
##### Style Examples
@@ -1212,14 +1258,13 @@ Assume a parameter named `color` has one of the following values:
object -> { "R": 100, "G": 200, "B": 150 }
```
-The following table shows examples, as would be shown with the `example` or `examples` keywords, of the different serializations for each value.
+The following table shows serialized examples, as would be shown with the `example` or `examples` keywords, of the different serializations for each value.
-* The value _empty_ denotes the empty string, and is unrelated to the `allowEmptyValue` field
-* The behavior of combinations marked _n/a_ is undefined
-* The `undefined` column replaces the `empty` column in previous versions of this specification in order to better align with [RFC6570](https://www.rfc-editor.org/rfc/rfc6570.html#section-2.3) terminology, which describes certain values including but not limited to `null` as "undefined" values with special handling; notably, the empty string is _not_ undefined
-* For `form` and the non-RFC6570 query string styles `spaceDelimited`, `pipeDelimited`, and `deepObject`, each example is shown prefixed with `?` as if it were the only query parameter; see [Appendix C](#appendix-c-using-rfc6570-based-serialization) for more information on constructing query strings from multiple parameters, and [Appendix D](#appendix-d-serializing-headers-and-cookies) for warnings regarding `form` and cookie parameters
-* Note that the `?` prefix is not appropriate for serializing `application/x-www-form-urlencoded` HTTP message bodies, and MUST be stripped or (if constructing the string manually) not added when used in that context; see the [Encoding Object](#encoding-object) for more information
-* The examples are percent-encoded as required by RFC6570 and RFC3986; see [Appendix E](#appendix-e-percent-encoding-and-form-media-types) for a thorough discussion of percent-encoding concerns, including why unencoded `|` (`%7C`), `[` (`%5B`), and `]` (`%5D`) seem to work in some environments despite not being compliant.
+* The value _empty_ denotes the empty string, and is unrelated to the `allowEmptyValue` field.
+* The behavior of combinations marked _n/a_ is undefined.
+* The `undefined` column replaces the `empty` column in previous versions of this specification in order to better align with [RFC6570](https://www.rfc-editor.org/rfc/rfc6570.html#section-2.3) terminology, which describes certain values including but not limited to `null` as "undefined" values with special handling; notably, the empty string is _not_ undefined.
+* For `form` and the non-RFC6570 query string styles `spaceDelimited`, `pipeDelimited`, and `deepObject`, see [Appendix C](#appendix-c-using-rfc6570-based-serialization) for more information on constructing query strings from multiple parameters, and [Appendix D](#appendix-d-serializing-headers-and-cookies) for warnings regarding `form` and cookie parameters.
+* The examples are percent-encoded as explained in the [URL Percent-Encoding](#url-percent-encoding) section above; see [Appendix E](#appendix-e-percent-encoding-and-form-media-types) for a thorough discussion of percent-encoding concerns, including why unencoded `|` (`%7C`), `[` (`%5B`), and `]` (`%5D`) seem to work in some environments despite not being compliant.
| [`style`](#style-values) | `explode` | `undefined` | `string` | `array` | `object` |
| ---- | ---- | ---- | ---- | ---- | ---- |
@@ -1229,14 +1274,14 @@ The following table shows examples, as would be shown with the `example` or `exa
| label | true | . | .blue | .blue.black.brown | .R=100.G=200.B=150 |
| 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 |
-| 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 |
-| spaceDelimited | false | _n/a_ | _n/a_ | ?color=blue%20black%20brown | ?color=R%20100%20G%20200%20B%20150 |
+| 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 |
+| spaceDelimited | false | _n/a_ | _n/a_ | color=blue%20black%20brown | color=R%20100%20G%20200%20B%20150 |
| spaceDelimited | true | _n/a_ | _n/a_ | _n/a_ | _n/a_ |
-| pipeDelimited | false | _n/a_ | _n/a_ | ?color=blue%7Cblack%7Cbrown | ?color=R%7C100%7CG%7C200%7CB%7C150 |
+| pipeDelimited | false | _n/a_ | _n/a_ | color=blue%7Cblack%7Cbrown | color=R%7C100%7CG%7C200%7CB%7C150 |
| pipeDelimited | true | _n/a_ | _n/a_ | _n/a_ | _n/a_ |
| deepObject | false | _n/a_ | _n/a_ | _n/a_ | _n/a_ |
-| deepObject | true | _n/a_ | _n/a_ | _n/a_ | ?color%5BR%5D=100&color%5BG%5D=200&color%5BB%5D=150 |
+| deepObject | true | _n/a_ | _n/a_ | _n/a_ | color%5BR%5D=100&color%5BG%5D=200&color%5BB%5D=150 |
##### Parameter Object Examples
@@ -1404,7 +1449,7 @@ Describes a single request body.
| Field Name | Type | Description |
| ---- | :----: | ---- |
| description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
-| content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For requests that match multiple keys, only the most specific key is applicable. e.g. `"text/plain"` overrides `"text/*"` |
+| content | Map[`string`, [Media Type Object](#media-type-object)] | **REQUIRED**. The content of the request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. The map SHOULD have at least one entry; if it does not, the behavior is implementation-defined. For requests that match multiple keys, only the most specific key is applicable. e.g. `"text/plain"` overrides `"text/*"` |
| required | `boolean` | Determines if the request body is required in the request. Defaults to `false`. |
This object MAY be extended with [Specification Extensions](#specification-extensions).
@@ -1670,11 +1715,12 @@ See [Appendix B](#appendix-b-data-type-conversion) for a discussion of data type
| Field Name | Type | Description |
| ---- | :----: | ---- |
-| style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameter-style) field. The behavior follows the same values as `query` parameters, including default values. Note that the initial `?` used in query strings is not used in `application/x-www-form-urlencoded` message bodies, and MUST be removed (if using an RFC6570 implementation) or simply not added (if constructing the string manually). This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encoding-content-type) (implicit or explicit) SHALL be ignored. |
+| style | `string` | Describes how a specific property value will be serialized depending on its type. See [Parameter Object](#parameter-object) for details on the [`style`](#parameter-style) field. The behavior follows the same values as `query` parameters, including the default value of `"form"` which applies only when `contentType` is _not_ being used due to one or both of `explode` or `allowReserved` being explicitly specified. Note that the initial `?` used in query strings is not used in `application/x-www-form-urlencoded` message bodies, and MUST be removed (if using an RFC6570 implementation) or simply not added (if constructing the string manually). This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encoding-content-type) (implicit or explicit) SHALL be ignored. |
| explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this field has no effect. When [`style`](#encoding-style) is `"form"`, the default value is `true`. For all other styles, the default value is `false`. Note that despite `false` being the default for `deepObject`, the combination of `false` with `deepObject` is undefined. This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encoding-content-type) (implicit or explicit) SHALL be ignored. |
-| allowReserved | `boolean` | When this is true, parameter values are serialized using reserved expansion, as defined by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3), which allows [RFC3986's reserved character set](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are [not allowed in the query string](https://datatracker.ietf.org/doc/html/rfc3986#section-3.4) (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see Appendices [C](#appendix-c-using-rfc6570-based-serialization) and [E](#appendix-e-percent-encoding-and-form-media-types) for details. The default value is `false`. This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encoding-content-type) (implicit or explicit) SHALL be ignored. |
+| allowReserved | `boolean` | When this is true, parameter values are serialized using reserved expansion, as defined by [RFC6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3), which allows [RFC3986's reserved character set](https://datatracker.ietf.org/doc/html/rfc3986#section-2.2), as well as percent-encoded triples, to pass through unchanged, while still percent-encoding all other disallowed characters (including `%` outside of percent-encoded triples). Applications are still responsible for percent-encoding reserved characters that are [not allowed in the query string](https://datatracker.ietf.org/doc/html/rfc3986#section-3.4) (`[`, `]`, `#`), or have a special meaning in `application/x-www-form-urlencoded` (`-`, `&`, `+`); see [URL Percent-Encoding](#url-percent-encoding) for details. The default value is `false`. This field SHALL be ignored if the request body media type is not `application/x-www-form-urlencoded` or `multipart/form-data`. If a value is explicitly defined, then the value of [`contentType`](#encoding-content-type) (implicit or explicit) SHALL be ignored. |
-See also [Appendix C: Using RFC6570 Implementations](#appendix-c-using-rfc6570-based-serialization) for additional guidance, including on difficulties caused by the interaction between RFC6570's percent-encoding rules and the `multipart/form-data` media type.
+When using RFC6570-style serialization for `multipart/form-data`, URI percent-encoding MUST NOT be applied, and the value of `allowReserved` has no effect.
+See also [Appendix C: Using RFC6570 Implementations](#appendix-c-using-rfc6570-based-serialization) for additional guidance.
Note that the presence of at least one of `style`, `explode`, or `allowReserved` with an explicit value is equivalent to using `schema` with `in: "query"` Parameter Objects.
The absence of all three of those fields is the equivalent of using `content`, but with the media type specified in `contentType` rather than through a Media Type Object.
@@ -1717,10 +1763,10 @@ With this example, consider an `id` of `f81d4fae-7dec-11d0-a765-00a0c91e6bf6` an
}
```
-Assuming the most compact representation of the JSON value (with unnecessary whitespace removed), we would expect to see the following request body, where space characters have been replaced with `+` and `+`, `"`, `{`, and `}` have been percent-encoded to `%2B`, `%22`, `%7B`, and `%7D`, respectively:
+Assuming the most compact representation of the JSON value (with unnecessary whitespace removed), we would expect to see the following request body, where space characters have been replaced with `+` and `+`, `"`, `:`, `,`, `{`, and `}` have been percent-encoded to `%2B`, `%22`, `%3A`, `%2C`, `%7B`, and `%7D`, respectively:
```uri
-id=f81d4fae-7dec-11d0-a765-00a0c91e6bf6&address=%7B%22streetAddress%22:%22123+Example+Dr.%22,%22city%22:%22Somewhere%22,%22state%22:%22CA%22,%22zip%22:%2299999%2B1234%22%7D
+id=f81d4fae-7dec-11d0-a765-00a0c91e6bf6&address=%7B%22streetAddress%22%3A%22123+Example+Dr.%22%2C%22city%22%3A%22Somewhere%22%2C%22state%22%3A%22CA%22%2C%22zip%22%3A%2299999%2B1234%22%7D
```
Note that the `id` keyword is treated as `text/plain` per the [Encoding Object](#encoding-object)'s default behavior, and is serialized as-is.
@@ -1746,8 +1792,9 @@ requestBody:
name:
type: string
icon:
- # The default with "contentEncoding" is application/octet-stream,
- # so we need to set image media type(s) in the Encoding Object.
+ # The default content type with `contentEncoding` present
+ # is "application/octet-stream", so we need to set the correct
+ # image media type(s) in the Encoding Object.
type: string
contentEncoding: base64url
encoding:
@@ -1781,8 +1828,8 @@ Note that there are significant restrictions on what headers can be used with `m
Note also that `Content-Transfer-Encoding` is deprecated for `multipart/form-data` ([RFC7578](https://www.rfc-editor.org/rfc/rfc7578.html#section-4.7)) where binary data is supported, as it is in HTTP.
-+Using `contentEncoding` for a multipart field is equivalent to specifying an [Encoding Object](#encoding-object) with a `headers` field containing `Content-Transfer-Encoding` with a schema that requires the value used in `contentEncoding`.
-+If `contentEncoding` is used for a multipart field that has an Encoding Object with a `headers` field containing `Content-Transfer-Encoding` with a schema that disallows the value from `contentEncoding`, the result is undefined for serialization and parsing.
+Using `contentEncoding` for a multipart field is equivalent to specifying an [Encoding Object](#encoding-object) with a `headers` field containing `Content-Transfer-Encoding` with a schema that requires the value used in `contentEncoding`.
+If `contentEncoding` is used for a multipart field that has an Encoding Object with a `headers` field containing `Content-Transfer-Encoding` with a schema that disallows the value from `contentEncoding`, the result is undefined for serialization and parsing.
Note that as stated in [Working with Binary Data](#working-with-binary-data), if the Encoding Object's `contentType`, whether set explicitly or implicitly through its default value rules, disagrees with the `contentMediaType` in a Schema Object, the `contentMediaType` SHALL be ignored.
Because of this, and because the Encoding Object's `contentType` defaulting rules do not take the Schema Object's`contentMediaType` into account, the use of `contentMediaType` with an Encoding Object is NOT RECOMMENDED.
@@ -1800,17 +1847,20 @@ requestBody:
schema:
type: object
properties:
+ # default content type for a string without `contentEncoding`
+ # is "text/plain"
id:
- # default for primitives without a special format is text/plain
type: string
format: uuid
- profileImage:
- # default for string with binary format is `application/octet-stream`
- type: string
- format: binary
+
+ # default content type for a schema without `type`
+ # is "application/octet-stream"
+ profileImage: {}
+
+ # default content type for arrays is based on the type
+ # in the `items` subschema, which is an object here,
+ # so the default content type for each item is "application/json"
addresses:
- # default for arrays is based on the type in the `items`
- # subschema, which is an object, so `application/json`
type: array
items:
$ref: '#/components/schemas/Address'
@@ -1828,31 +1878,27 @@ requestBody:
schema:
type: object
properties:
+ # No Encoding Object, so use default "text/plain"
id:
- # default is `text/plain`
type: string
format: uuid
+
+ # Encoding Object overrides the default "application/json" content type
+ # for each item in the array with "application/xml; charset=utf-8"
addresses:
- # default based on the `items` subschema would be
- # `application/json`, but we want these address objects
- # serialized as `application/xml` instead
description: addresses in XML format
type: array
items:
$ref: '#/components/schemas/Address'
- profileImage:
- # default is application/octet-stream, but we can declare
- # a more specific image type or types
- type: string
- format: binary
+
+ # Encoding Object accepts only PNG or JPEG, and also describes
+ # a custom header for just this part in the multipart format
+ profileImage: {}
+
encoding:
addresses:
- # require XML Content-Type in utf-8 encoding
- # This is applied to each address part corresponding
- # to each address in he array
contentType: application/xml; charset=utf-8
profileImage:
- # only accept png or jpeg
contentType: image/png, image/jpeg
headers:
X-Rate-Limit-Limit:
@@ -1871,7 +1917,7 @@ requestBody:
multipart/form-data:
schema:
properties:
- # The property name 'file' will be used for all files.
+ # The property name `file` will be used for all files.
file:
type: array
items: {}
@@ -2211,19 +2257,19 @@ Tooling implementations MAY choose to validate compatibility automatically, and
##### Working with Examples
-Example Objects can be used in both [Parameter Objects](#parameter-object) and [Media Type Objects](#media-type-object).
-In both Objects, this is done through the `examples` (plural) field.
-However, there are several other ways to provide examples: The `example` (singular) field that is mutually exclusive with `examples` in both Objects, and two keywords (the deprecated singular `example` and the current plural `examples`, which takes an array of examples) in the [Schema Object](#schema-object) that appears in the `schema` field of both Objects.
+Example Objects can be used in [Parameter Objects](#parameter-object), [Header Objects](#header-object), and [Media Type Objects](#media-type-object).
+In all three Objects, this is done through the `examples` (plural) field.
+However, there are several other ways to provide examples: The `example` (singular) field that is mutually exclusive with `examples` in all three Objects, and two keywords (the deprecated singular `example` and the current plural `examples`, which takes an array of examples) in the [Schema Object](#schema-object) that appears in the `schema` field of all three Objects.
Each of these fields has slightly different considerations.
The Schema Object's fields are used to show example values without regard to how they might be formatted as parameters or within media type representations.
The `examples` array is part of JSON Schema and is the preferred way to include examples in the Schema Object, while `example` is retained purely for compatibility with older versions of the OpenAPI Specification.
-The mutually exclusive fields in the Parameter or Media Type Objects are used to show example values which SHOULD both match the schema and be formatted as they would appear as a serialized parameter or within a media type representation.
-The exact serialization and encoding is determined by various fields in the Parameter Object, or in the Media Type Object's [Encoding Object](#encoding-object).
+The mutually exclusive fields in the Parameter, Header, or Media Type Objects are used to show example values which SHOULD both match the schema and be formatted as they would appear as a serialized parameter, serialized header, or within a media type representation.
+The exact serialization and encoding is determined by various fields in the Parameter Object, Header Object, or in the Media Type Object's [Encoding Object](#encoding-object).
Because examples using these fields represent the final serialized form of the data, they SHALL _override_ any `example` in the corresponding Schema Object.
-The singular `example` field in the Parameter or Media Type Object is concise and convenient for simple examples, but does not offer any other advantages over using Example Objects under `examples`.
+The singular `example` field in the Parameter, Header, or Media Type Object is concise and convenient for simple examples, but does not offer any other advantages over using Example Objects under `examples`.
Some examples cannot be represented directly in JSON or YAML.
For all three ways of providing examples, these can be shown as string values with any escaping necessary to make the string valid in the JSON or YAML format of documents that comprise the OpenAPI Description.
@@ -2386,7 +2432,7 @@ For computing links and providing instructions to execute them, a [runtime expre
This object MAY be extended with [Specification Extensions](#specification-extensions).
A linked operation MUST be identified using either an `operationRef` or `operationId`.
-The identified or reference operation MUST be unique, and in the case of an `operationId`, it MUST be resolved within the scope of the OpenAPI Description (OAD).
+The identified or referenced operation MUST be unique, and in the case of an `operationId`, it MUST be resolved within the scope of the OpenAPI Description (OAD).
Because of the potential for name clashes, the `operationRef` syntax is preferred for multi-document OADs.
However, because use of an operation depends on its URL path template in the [Paths Object](#paths-object), operations from any [Path Item Object](#path-item-object) that is referenced multiple times within the OAD cannot be resolved unambiguously.
In such ambiguous cases, the resulting behavior is implementation-defined and MAY result in an error.
@@ -2425,7 +2471,7 @@ paths:
# the target link operationId
operationId: getUserAddress
parameters:
- # get the `id` field from the request path parameter named `id`
+ # use the value of the request path parameter named "id"
userid: $request.path.id
# the path item of the linked operation
/users/{userid}/address:
@@ -2453,7 +2499,7 @@ links:
address:
operationId: getUserAddressByUUID
parameters:
- # get the `uuid` field from the `uuid` field in the response body
+ # use the value of the `uuid` field in the response body
userUuid: $response.body#/uuid
```
@@ -2461,33 +2507,34 @@ Clients follow all links at their discretion.
Neither permissions nor the capability to make a successful call to that link is guaranteed
solely by the existence of a relationship.
-##### `operationRef` Examples
+###### `operationRef` Examples
+
+As the `operationId` is an optional field in an [Operation Object](#operation-object), references MAY instead be made through a URI-reference with `operationRef`.
+Note that both of these examples reference operations that can be identified via the [Paths Object](#paths-object) to ensure that the operation's path template is unambiguous.
-As references to `operationId` MAY NOT be possible (the `operationId` is an optional
-field in an [Operation Object](#operation-object)), references MAY also be made through a relative `operationRef`:
+A relative URI-reference `operationRef`:
```yaml
links:
UserRepositories:
- # returns array of '#/components/schemas/repository'
operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get'
parameters:
username: $response.body#/username
```
-or a URI `operationRef`:
+A non-relative URI `operationRef`:
```yaml
links:
UserRepositories:
- # returns array of '#/components/schemas/repository'
operationRef: https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get
parameters:
username: $response.body#/username
```
-Note that in the use of `operationRef` the _escaped forward-slash_ is necessary when
-using JSON Pointer, and it is necessary to URL-encode `{` and `}` as `%7B` and `%7D`, respectively, when using JSON Pointer as URI fragments.
+Note that in the use of `operationRef` the _escaped forward-slash_ (`~1`) is necessary when
+using JSON Pointer in URI fragments, and it is necessary to URL-encode `{` and `}` as `%7B` and `%7D`, respectively.
+The unescaped, percent-decoded path template in the above examples would be `/2.0/repositories/{username}`.
##### Runtime Expressions
@@ -2509,7 +2556,7 @@ The runtime expression is defined by the following [ABNF](https://tools.ietf.org
; %x2F ('/') and %x7E ('~') are excluded from 'unescaped'
escaped = "~" ( "0" / "1" )
; representing '~' and '/', respectively
- name = *( CHAR )
+ name = *char
token = 1*tchar
tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "."
/ "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
@@ -2521,7 +2568,7 @@ The `name` identifier is case-sensitive, whereas `token` is not.
The table below provides examples of runtime expressions and examples of their use in a value:
-##### Examples
+###### Example Expressions
| Source Location | example expression | notes |
| ---- | :---- | :---- |
@@ -2565,7 +2612,8 @@ This object MAY be extended with [Specification Extensions](#specification-exten
For simpler scenarios, a [`schema`](#header-schema) and [`style`](#header-style) can describe the structure and syntax of the header.
When `example` or `examples` are provided in conjunction with the `schema` field, the example MUST follow the prescribed serialization strategy for the header.
-Serializing with `schema` is NOT RECOMMENDED for headers with parameters (name=value pairs following a `;`) in their values, or where values might have non-URL-safe characters; see [Appendix D](#appendix-d-serializing-headers-and-cookies) for details.
+When serializing headers with `schema`, URI percent-encoding MUST NOT be applied; if using an RFC6570 implementation that automatically applies it, it MUST be removed before use.
+Implementations MUST pass header values through unchanged rather than attempting to automatically quote header values, as the quoting rules vary too widely among different headers; see [Appendix D](#appendix-d-serializing-headers-and-cookies) for guidance on quoting and escaping.
When `example` or `examples` are provided in conjunction with the `schema` field, the example SHOULD match the specified schema and follow the prescribed serialization strategy for the header.
The `example` and `examples` fields are mutually exclusive, and if either is present it SHALL _override_ any `example` in the schema.
@@ -2574,7 +2622,7 @@ The `example` and `examples` fields are mutually exclusive, and if either is pre
| ---- | :----: | ---- |
| style | `string` | Describes how the header value will be serialized. The default (and only legal value for headers) is `"simple"`. |
| explode | `boolean` | When this is true, header values of type `array` or `object` generate a single header whose value is a comma-separated list of the array items or key-value pairs of the map, see [Style Examples](#style-examples). For other data types this field has no effect. The default value is `false`. |
-| schema | [Schema Object](#schema-object) \| [Reference Object](#reference-object) | The schema defining the type used for the header. |
+| schema | [Schema Object](#schema-object) | The schema defining the type used for the header. |
| example | Any | Example of the header's potential value; see [Working With Examples](#working-with-examples). |
| examples | Map[ `string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | Examples of the header's potential value; see [Working With Examples](#working-with-examples). |
@@ -2583,7 +2631,6 @@ See also [Appendix C: Using RFC6570-Based Serialization](#appendix-c-using-rfc65
###### Fixed Fields for use with `content`
For more complex scenarios, the [`content`](#header-content) field can define the media type and schema of the header, as well as give examples of its use.
-Using `content` with a `text/plain` media type is RECOMMENDED for headers where the `schema` strategy is not appropriate.
| Field Name | Type | Description |
| ---- | :----: | ---- |
@@ -2609,18 +2656,14 @@ X-Rate-Limit-Limit:
type: integer
```
-Requiring that a strong `ETag` header (with a value starting with `"` rather than `W/`) is present. Note the use of `content`, because using `schema` and `style` would require the `"` to be percent-encoded as `%22`:
+Requiring that a strong `ETag` header (with a value starting with `"` rather than `W/`) is present.
```json
"ETag": {
"required": true,
- "content": {
- "text/plain": {
- "schema": {
- "type": "string",
- "pattern": "^\""
- }
- }
+ "schema": {
+ "type": "string",
+ "pattern": "^\""
}
}
```
@@ -2628,11 +2671,9 @@ Requiring that a strong `ETag` header (with a value starting with `"` rather tha
```yaml
ETag:
required: true
- content:
- text/plain:
- schema:
- type: string
- pattern: ^"
+ schema:
+ type: string
+ pattern: ^"
```
#### Tag Object
@@ -3396,7 +3437,7 @@ components:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
- # all other properties specific to a `Cat`
+ # all other properties specific to a "Cat"
properties:
name:
type: string
@@ -3404,7 +3445,7 @@ components:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
- # all other properties specific to a `Dog`
+ # all other properties specific to a "Dog"
properties:
bark:
type: string
@@ -3412,7 +3453,7 @@ components:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
- # all other properties specific to a `Lizard`
+ # all other properties specific to a "Lizard"
properties:
lovesRocks:
type: boolean
@@ -3449,7 +3490,7 @@ See examples for expected behavior.
| Field Name | Type | Description |
| ---- | :----: | ---- |
-| name | `string` | Replaces the name of the element/attribute used for the described schema property. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `"array"` (outside the `items`), it will affect the wrapping element if and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored. |
+| name | `string` | Replaces the inferred name of the element/attribute used for the described schema property. For the root schema object of a [schema component](#components-schemas), the inferred name is the name of the component; for other schemas the name is inferred from the parent property name. When defined within `items`, it will affect the name of the individual XML elements within the list. When defined alongside `type` being `"array"` (outside the `items`), it will affect the wrapping element if and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored. |
| namespace | `string` | The URI of the namespace definition. Value MUST be in the form of a non-relative URI. |
| prefix | `string` | The prefix to be used for the [name](#xml-name). |
| attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. |
@@ -3457,12 +3498,29 @@ See examples for expected behavior.
This object MAY be extended with [Specification Extensions](#specification-extensions).
+##### Namespace Limitations
+
The `namespace` field is intended to match the syntax of [XML namespaces](https://www.w3.org/TR/xml-names11/), although there are a few caveats:
* Versions 3.1.0, 3.0.3, and earlier of this specification erroneously used the term "absolute URI" instead of "non-relative URI", so authors using namespaces that include a fragment should check tooling support carefully.
* XML allows but discourages relative URI-references, while this specification outright forbids them.
* XML 1.1 allows IRIs ([RFC3987](https://datatracker.ietf.org/doc/html/rfc3987)) as namespaces, and specifies that namespaces are compared without any encoding or decoding, which means that IRIs encoded to meet this specification's URI syntax requirement cannot be compared to IRIs as-is.
+##### Handling `null` Values
+
+XML does not, by default, have a concept equivalent to `null`, and to preserve compatibility with version 3.1.1 and earlier of this specification, the behavior of serializing `null` values is implementation-defined.
+
+However, implementations SHOULD handle `null` values as follows:
+
+* For elements, produce an empty element with an `xsi:nil="true"` attribute.
+* For attributes, omit the attribute.
+
+Note that for attributes, this makes either a `null` value or a missing property serialize to an omitted attribute.
+As the Schema Object validates the in-memory representation, this allows handling the combination of `null` and a required property.
+However, because there is no distinct way to represent `null` as an attribute, it is RECOMMENDED to make attribute properties optional rather than use `null`.
+
+To ensure correct round-trip behavior, when parsing an element that omits an attribute, implementations SHOULD set the corresponding property to `null` if the schema allows for that value (e.g. `type: ["number", "null"]`), and omit the property otherwise (e.g.`type: "number"`).
+
##### XML Object Examples
Each of the following examples represent the value of the `properties` keyword in a [Schema Object](#schema-object) that is omitted for brevity.
@@ -3541,25 +3599,30 @@ animals:
###### XML Attribute, Prefix and Namespace
-In this example, a full model definition is shown.
+In this example, a full [schema component](#components-schemas) definition is shown.
+Note that the name of the root XML element comes from the component name.
```json
{
- "Person": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "format": "int32",
- "xml": {
- "attribute": true
- }
- },
- "name": {
- "type": "string",
- "xml": {
- "namespace": "https://example.com/schema/sample",
- "prefix": "sample"
+ "components": {
+ "schemas": {
+ "Person": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "xml": {
+ "attribute": true
+ }
+ },
+ "name": {
+ "type": "string",
+ "xml": {
+ "namespace": "https://example.com/schema/sample",
+ "prefix": "sample"
+ }
+ }
}
}
}
@@ -3568,19 +3631,21 @@ In this example, a full model definition is shown.
```
```yaml
-Person:
- type: object
- properties:
- id:
- type: integer
- format: int32
- xml:
- attribute: true
- name:
- type: string
- xml:
- namespace: https://example.com/schema/sample
- prefix: sample
+components:
+ schemas:
+ Person:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int32
+ xml:
+ attribute: true
+ name:
+ type: string
+ xml:
+ namespace: https://example.com/schema/sample
+ prefix: sample
```
```xml
@@ -3798,6 +3863,84 @@ animals:
```
+###### XML With `null` Values
+
+Recall that the schema validates the in-memory data, not the XML document itself.
+
+```json
+{
+ "product": {
+ "type": "object",
+ "required": ["count", "description", "related"],
+ "properties": {
+ "count": {
+ "type": ["number", "null"],
+ "xml": {
+ "attribute": true
+ }
+ },
+ "rating": {
+ "type": "string",
+ "xml": {
+ "attribute": true
+ }
+ },
+ "description": {
+ "type": "string"
+ },
+ "related": {
+ "type": ["object", "null"]
+ }
+ }
+ }
+}
+```
+
+```yaml
+product:
+ type: object
+ required:
+ - count
+ - description
+ - related
+ properties:
+ count:
+ type:
+ - number
+ - "null"
+ xml:
+ attribute: true
+ rating:
+ type: string
+ xml:
+ attribute: true
+ description:
+ type: string
+ related:
+ type:
+ - object
+ - "null"
+```
+
+```xml
+form‑urlencoded
|
| [RFC1866](https://datatracker.ietf.org/doc/html/rfc1866#section-8.2.1) | 11/1995 | content-based serialization | [[RFC1738]] | obsoleted by [[HTML401]] [Section 17.13.4.1](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1), [[URL]] [Section 5](https://url.spec.whatwg.org/#urlencoded-serializing) |
-Style-based serialization is used in the [Parameter Object](#parameter-object) when `schema` is present, and in the [Encoding Object](#encoding-object) when at least one of `style`, `explode`, or `allowReserved` is present.
+Style-based serialization with percent-encoding is used in the [Parameter Object](#parameter-object) when `schema` is present, and in the [Encoding Object](#encoding-object) when at least one of `style`, `explode`, or `allowReserved` is present.
See [Appendix C](#appendix-c-using-rfc6570-based-serialization) for more details of RFC6570's two different approaches to percent-encoding, including an example involving `+`.
-Content-based serialization is defined by the [Media Type Object](#media-type-object), and used with the [Parameter Object](#parameter-object) when the `content` field is present, and with the [Encoding Object](#encoding-object) based on the `contentType` field when the fields `style`, `explode`, and `allowReserved` are absent.
-Each part is encoded based on the media type (e.g. `text/plain` or `application/json`), and must then be percent-encoded for use in a `form-urlencoded` string.
-
-Note that content-based serialization for `form-data` does not expect or require percent-encoding in the data, only in per-part header values.
+Content-based serialization is defined by the [Media Type Object](#media-type-object), and used with the [Parameter Object](#parameter-object) and [Header Object](#header-object) when the `content` field is present, and with the [Encoding Object](#encoding-object) based on the `contentType` field when the fields `style`, `explode`, and `allowReserved` are absent.
+Each part is encoded based on the media type (e.g. `text/plain` or `application/json`), and must then be percent-encoded for use in a `form-urlencoded` string unless the media type already incorporates URI percent-encoding.
#### Interoperability with Historical Specifications
-In most cases, generating query strings in strict compliance with [[RFC3986]] is sufficient to pass validation (including JSON Schema's `format: "uri"` and `format: "uri-reference"`), but some `form-urlencoded` implementations still expect the slightly more restrictive [[RFC1738]] rules to be used.
+In most cases, generating query strings in strict compliance with [[RFC3986]] is sufficient to pass validation (including JSON Schema's `format: "uri"` and `format: "uri-reference"` when `format` validation is enabled), but some `form-urlencoded` implementations still expect the slightly more restrictive [[RFC1738]] rules to be used.
Since all RFC1738-compliant URIs are compliant with RFC3986, applications needing to ensure historical interoperability SHOULD use RFC1738's rules.
@@ -4504,7 +4662,7 @@ WHATWG is a [web browser-oriented](https://whatwg.org/faq#what-is-the-whatwg-wor
WHATWG's percent-encoding rules for query strings are different depending on whether the query string is [being treated as `form-urlencoded`](https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set) (where it requires more percent-encoding than [[RFC1738]]) or [as part of the generic syntax](https://url.spec.whatwg.org/#query-percent-encode-set), where it allows characters that [[RFC3986]] forbids.
Implementations needing maximum compatibility with web browsers SHOULD use WHATWG's `form-urlencoded` percent-encoding rules.
-However, they SHOULD NOT rely on WHATWG's less stringent generic query string rules, as the resulting URLs would fail RFC3986 validation, including JSON Schema's `format: uri` and `format: uri-reference`.
+However, they SHOULD NOT rely on WHATWG's less stringent generic query string rules, as the resulting URLs would fail RFC3986 validation, including JSON Schema's `format: uri` and `format: uri-reference` (when `format` validation is endabled).
### Decoding URIs and `form-urlencoded` Strings
@@ -4520,9 +4678,11 @@ The `[`, `]`, `|`, and space characters, which are used as delimiters for the `d
This requires users to pre-encode the character(s) in some other way in parameter names and values to distinguish them from the delimiter usage when using one of these styles.
The space character is always illegal and encoded in some way by all implementations of all versions of the relevant standards.
-While one could use the `form-urlencoded` convention of `+` to distinguish spaces in parameter names and values from `spaceDelimited` delimiters encoded as `%20`, the specifications define the decoding as a single pass, making it impossible to distinguish the different usages in the decoded result.
+While one could use the `form-urlencoded` convention of `+` to distinguish spaces in parameter names and values from `spaceDelimited` delimiters encoded as `%20`, the specifications define the decoding as a single pass, making it impossible to distinguish the different usages in the decoded result unless a non-standard parsing algorithm is used that separates based on one delimiter before decoding the other.
+Any such non-standard parsing approach will not be interoperable across all tools.
-Some environments use `[`, `]`, and possibly `|` unencoded in query strings without apparent difficulties, and WHATWG's generic query string rules do not require percent-encoding them.
+Some environments use `[`, `]`, and possibly `|` unencoded in query strings without apparent difficulties.
+WHATWG's generic query string rules do not require percent-encoding them in non-`form-urlencoded` query strings, although it also excludes them from the set of valid URL Unicode code points.
Code that relies on leaving these delimiters unencoded, while using regular percent-encoding for them within names and values, is not guaranteed to be interoperable across all implementations.
For maximum interoperability, it is RECOMMENDED to either define and document an additional escape convention while percent-encoding the delimiters for these styles, or to avoid these styles entirely.
diff --git a/versions/3.2.0-editors.md b/versions/3.2.0-editors.md
new file mode 100644
index 0000000000..fc5f990794
--- /dev/null
+++ b/versions/3.2.0-editors.md
@@ -0,0 +1,22 @@
+# OpenAPI Specification Editors
+
+## Active
+
+* Henry Andrews [@handrews](https://github.com/handrews)
+* Jeremy Whitlock [@whitlockjc](https://github.com/whitlockjc)
+* Karen Etheridge [@karenetheridge](https://github.com/karenetheridge)
+* Lorna Mitchell [@lornajane](https://github.com/lornajane)
+* Marsh Gardiner [@earth2marsh](https://github.com/earth2marsh)
+* Miguel Quintero [@miqui](https://github.com/miqui)
+* Mike Kistler [@mikekistler](https://github.com/mikekistler)
+* Ralf Handl [@ralfhandl](https://github.com/ralfhandl)
+* Vincent Biret [@baywet](https://github.com/baywet)
+
+## Emeritus
+
+* Ron Ratovsky [@webron](https://github.com/webron)
+* Darrel Miller [@darrelmiller](https://github.com/darrelmiller)
+* Mike Ralphson [@MikeRalphson](https://github.com/MikeRalphson)
+* Uri Sarid [@usarid](https://github.com/usarid)
+* Jason Harmon [@jharmn](https://github.com/jharmn)
+* Tony Tam [@fehguy](https://github.com/fehguy)
diff --git a/versions/3.2.0.md b/versions/3.2.0.md
new file mode 100644
index 0000000000..6ecea10ce4
--- /dev/null
+++ b/versions/3.2.0.md
@@ -0,0 +1,5604 @@
+# OpenAPI Specification
+
+## Version 3.2.0
+
+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](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
+
+This document is licensed under [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).
+
+## Introduction
+
+The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to HTTP APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service by [parsing and serializing](#parsing-and-serializing) HTTP messages to and from a [data model](#data-types) with a minimal amount of implementation logic.
+
+An [OpenAPI Description](#openapi-description-structure) (OAD) can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
+
+For examples of OpenAPI usage and additional documentation, please visit [[?OpenAPI-Learn]].
+
+For extension registries and other specifications published by the OpenAPI Initiative, as well as the authoritative rendering of this specification, please visit [spec.openapis.org](https://spec.openapis.org/).
+
+### Versions and Deprecation
+
+The OpenAPI Specification is versioned using a `major`.`minor`.`patch` versioning scheme. The `major`.`minor` portion of the version string (for example `3.1`) SHALL designate the OAS feature set. _`.patch`_ versions address errors in, or provide clarifications to, this document, not the feature set. Tooling which supports OAS 3.1 SHOULD be compatible with all OAS 3.1.\* versions. The patch version SHOULD NOT be considered by tooling, making no distinction between `3.1.0` and `3.1.1` for example.
+
+Certain fields or features may be marked **Deprecated**.
+These fields and features remain part of the specification and can be used like any other field or feature.
+However, OpenAPI Description authors should use newer fields and features documented to replace the deprecated ones whenever possible.
+
+At this time, such elements are expected to remain part of the OAS until the next major version, although a future minor version of this specification may define a policy for later removal of deprecated elements.
+
+Occasionally, non-backwards compatible changes may be made in `minor` versions of the OAS where impact is believed to be low relative to the benefit provided.
+
+### Undefined and Implementation-Defined Behavior
+
+This specification deems certain situations to have either _undefined_ or _implementation-defined_ behavior.
+
+Behavior described as _undefined_ is likely, at least in some circumstances, to result in outcomes that contradict the specification.
+This description is used when detecting the contradiction is impossible or impractical.
+Implementations MAY support undefined scenarios for historical reasons, including ambiguous text in prior versions of the specification.
+This support might produce correct outcomes in many cases, but relying on it is NOT RECOMMENDED as there is no guarantee that it will work across all tools or with future specification versions, even if those versions are otherwise strictly compatible with this one.
+
+Behavior described as _implementation-defined_ allows implementations to choose which of several different-but-compliant approaches to a requirement to implement.
+This documents ambiguous requirements that API description authors are RECOMMENDED to avoid in order to maximize interoperability.
+Unlike undefined behavior, it is safe to rely on implementation-defined behavior if _and only if_ it can be guaranteed that all relevant tools support the same behavior.
+
+## Format
+
+An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in [[RFC8259|JSON]] or [[YAML|YAML]] format.
+Examples in this specification will be shown in YAML for brevity.
+
+All field names in the specification are **case-sensitive**.
+This includes all fields that are used as keys in a map, except where explicitly noted that keys are **case-insensitive**.
+
+OAS [Objects](#objects-and-fields) expose two types of fields: _fixed fields_, which have a declared name, and _patterned fields_, which have a declared pattern for the field name.
+
+Patterned fields MUST have unique names within the containing object.
+
+**Note:** While APIs may be described by OpenAPI Descriptions in either YAML or JSON format, the API request and response bodies and other content are not required to be JSON or YAML.
+
+### JSON and YAML Compatibility
+
+In order to preserve the ability to round-trip between YAML and JSON formats, YAML version [1.2](https://yaml.org/spec/1.2/spec.html) is RECOMMENDED along with the additional constraints listed in [[!RFC9512]] [Section 3.4](https://www.rfc-editor.org/rfc/rfc9512.html#name-yaml-and-json).
+
+The recommendation in previous versions of this specification to restrict YAML to its "JSON" [schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231) allowed for the inclusion of certain values that (despite the name) cannot be represented in JSON.
+OAD authors SHOULD NOT rely on any such JSON-incompatible YAML values.
+
+### Case Sensitivity
+
+As most field names and values in the OpenAPI Specification are case-sensitive, this document endeavors to call out any case-insensitive names and values.
+However, the case sensitivity of field names and values that map directly to HTTP concepts follow the case sensitivity rules of HTTP, even if this document does not make a note of every concept.
+
+### Rich Text Formatting
+
+Throughout the specification `description` fields are noted as supporting CommonMark markdown formatting.
+Where OpenAPI tooling renders rich text it MUST support, at a minimum, markdown syntax as described by [CommonMark 0.27](https://spec.commonmark.org/0.27/). Tooling MAY choose to ignore some CommonMark or extension features to address security concerns.
+
+While the framing of CommonMark 0.27 as a minimum requirement means that tooling MAY choose to implement extensions on top of it, note that any such extensions are by definition implementation-defined and will not be interoperable.
+OpenAPI Description authors SHOULD consider how text using such extensions will be rendered by tools that offer only the minimum support.
+
+## Objects and Fields
+
+This section describes the structure of the OpenAPI Description format.
+This text is the only normative description of the format.
+A JSON Schema is hosted on [spec.openapis.org](https://spec.openapis.org) for informational purposes.
+If the JSON Schema differs from this section, then this section MUST be considered authoritative.
+
+In the following description, if a field is not explicitly **REQUIRED** or described with a MUST or SHALL, it can be considered OPTIONAL.
+
+### OpenAPI Object
+
+This is the root object of the [OpenAPI Description](#openapi-description-structure).
+
+#### Fixed Fields
+
+In addition to the required fields, at least one of the `components`, `paths`, or `webhooks` fields MUST be present.
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| openapi | `string` | **REQUIRED**. This string MUST be the [version number](#versions-and-deprecation) of the OpenAPI Specification that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling to interpret the OpenAPI document. This is _not_ related to the [`info.version`](#info-version) string, which describes the OpenAPI document's version. |
+| $self | `string` | This string MUST be in the form of a URI reference as defined by [[RFC3986]] [Section 4.1](https://www.rfc-editor.org/rfc/rfc3986#section-4.1). The `$self` field provides the self-assigned URI of this document, which also serves as its base URI in accordance with [[RFC3986]] [Section 5.1.1](https://www.rfc-editor.org/rfc/rfc3986#section-5.1.1). Implementations MUST support identifying the targets of [API description URIs](#relative-references-in-api-description-uris) using the URI defined by this field when it is present. See [Establishing the Base URI](#establishing-the-base-uri) for the base URI behavior when `$self` is absent or relative, and see [Appendix F]((#appendix-f-examples-of-base-uri-determination-and-reference-resolution)) for examples of using `$self` to resolve references. |
+| info | [Info Object](#info-object) | **REQUIRED**. Provides metadata about the API. The metadata MAY be used by tooling as required. |
+| jsonSchemaDialect | `string` | The default value for the `$schema` keyword within [Schema Objects](#schema-object) contained within this OAS document. This MUST be in the form of a URI. |
+| servers | [[Server Object](#server-object)] | An array of Server Objects, which provide connectivity information to a target server. If the `servers` field is not provided, or is an empty array, the default value would be an array consisting of a single [Server Object](#server-object) with a [url](#server-url) value of `/`. |
+| paths | [Paths Object](#paths-object) | The available paths and operations for the API. |
+| webhooks | Map[`string`, [Path Item Object](#path-item-object)] | The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the `callbacks` feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An [example](https://learn.openapis.org/examples/v3.1/webhook-example.html) is available. |
+| components | [Components Object](#components-object) | An element to hold various Objects for the OpenAPI Description. |
+| security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement (`{}`) can be included in the array. |
+| tags | [[Tag Object](#tag-object)] | A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operation-object) must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. |
+| externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+To ensure interoperability, references MUST use the target document's `$self` URI if the `$self` field is present.
+Implementations MAY choose to support referencing by other URIs such as the retrieval URI even when `$self` is present, however this behavior is not interoperable and relying on it is NOT RECOMMENDED.
+
+#### OpenAPI Description Structure
+
+An **OpenAPI Description** (**OAD**) formally describes the surface of an API and its semantics.
+An OAD MAY be made up of a single document, or be distributed across multiple documents that are connected by various fields using [URI references](#relative-references-in-api-description-uris) and [implicit connections](#resolving-implicit-connections).
+
+In order for parsing behavior to be well-defined, all documents in an OAD MUST have either an OpenAPI Object or a Schema Object at the root, and MUST be parsed as complete documents, as described in the next section.
+
+Documents with a different Object at the root, or that mix OAD content with other content, MAY be supported, but will have implementation-defined or, potentially, undefined behavior as described in [Appendix G: Parsing and Resolution Guidance](#appendix-g-parsing-and-resolution-guidance).
+Throughout this specification, documents are assumed to have either an OpenAPI Object or Schema Object at the root unless otherwise specified.
+
+In a multi-document OAD, the document containing the OpenAPI Object where parsing begins is known as that OAD's **entry document**.
+It is RECOMMENDED that the entry document of an OAD be named `openapi.json` or `openapi.yaml`.
+
+An OpenAPI Object MAY be embedded in another format, called the **embedding format**, just as JSON Schema is embedded in the OAS in the form of Schema Objects.
+It is the responsibility of an embedding format to define how to parse embedded content, and OAS implementations that do not document support for an embedding format cannot be expected to parse embedded OAS content correctly.
+
+##### Parsing Documents
+
+Each document in an OAD MUST be fully parsed in order to locate possible reference targets.
+This includes the parsing requirements of [JSON Schema Specification Draft 2020-12](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-9), with appropriate modifications regarding base URIs as specified in [Relative References In URIs](#relative-references-in-api-description-uris).
+Reference targets are defined by fields including the OpenAPI Object's [`$self`](#oas-self) field and the [Schema Object's](#schema-object) `$id`, `$anchor`, and `$dynamicAnchor` keywords.
+
+Implementations MUST NOT treat a reference as unresolvable before completely parsing all documents provided to the implementation as possible parts of the OAD.
+
+If only the referenced part of the document is parsed when resolving a reference, the resulting behavior can be implementation-defined or undefined; see [Warnings Regarding Fragmentary Parsing](#warnings-regarding-fragmentary-parsing) in [Appendix G](#appendix-g-parsing-and-resolution-guidance) for details.
+
+##### Relative References in API Description URIs
+
+URIs used as references within an OpenAPI Description, or to external documentation or other supplementary information such as a license, are resolved as _identifiers_, and described by this specification as **_URIs_**, in contrast with [API URLs](#relative-references-in-api-urls).
+Note that some URI fields are named `url` for historical reasons, but the descriptive text for those fields uses the correct "URI" terminology.
+
+As noted under [Parsing Documents](#parsing-documents), several fields can be used to associate an OpenAPI document or a Schema Object with a URI, which might not match the document's or schema's location.
+This allows the same references to be used in different deployment environments, including local filesystems or networks restricted by security policies or connectivity limitations.
+
+Unless specified otherwise, all fields that are URIs MAY be relative references as defined by [[RFC3986]] [Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2).
+
+###### Establishing the Base URI
+
+Relative URI references are resolved using the appropriate base URI, which MUST be determined in accordance with [[RFC3986]] [Section 5.1.1 – 5.1.4](https://tools.ietf.org/html/rfc3986#section-5.1.1) and, for Schema objects, [JSON Schema draft 2020-12 Section 8.2](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-8.2), as illustrated by the examples in [Appendix F: Examples of Base URI Determination and Reference Resolution](#appendix-f-examples-of-base-uri-determination-and-reference-resolution).
+
+If `$self` is a relative URI reference, it is resolved against the next possible base URI source ([[RFC3986]] [Section 5.1.2 – 5.1.4](https://tools.ietf.org/html/rfc3986#section-5.1.2)) before being used for the resolution of other relative URI references.
+
+The most common base URI source that is used in the event of a missing or relative `$self` (in the [OpenAPI Object](#openapi-object)) and (for [Schema Object](#schema-object)) `$id` is the retrieval URI.
+Implementations MAY support document retrieval, although see the [Security Considerations](#security-considerations) sections for additional guidance.
+Even if retrieval is supported, it may be impossible due to network configuration or server unavailability (including the server hosting an older version while a new version is in development), or undesirable due to performance impacts.
+Therefore, all implementations SHOULD allow users to provide documents with their intended retrieval URIs so that references can be resolved as if retrievals were performed.
+
+###### Resolving URI fragments
+
+If a URI contains a fragment identifier, then the fragment should be resolved per the fragment resolution mechanism of the referenced document. If the representation of the referenced document is JSON or YAML, then the fragment identifier SHOULD be interpreted as a JSON Pointer as per [RFC6901](https://tools.ietf.org/html/rfc6901).
+
+###### Relative URI References in CommonMark Fields
+
+Relative references in CommonMark hyperlinks are resolved in their rendered context, which might differ from the context of the API description.
+
+##### Resolving Implicit Connections
+
+Several features of this specification require resolution of non-URI-based connections to some other part of the OpenAPI Description (OAD).
+
+These connections are unambiguously resolved in single-document OADs, but the resolution process in multi-document OADs is _implementation-defined_, within the constraints described in this section.
+In some cases, an unambiguous URI-based alternative is available, and OAD authors are RECOMMENDED to use the alternative to maximize interoperability.
+
+For resolving [Components Object](#components-object) and [Tag Object](#tag-object) names from a referenced (non-entry) document, it is RECOMMENDED that tools resolve from the entry document, rather than the current document.
+For resolving an [Operation Object](#operation-object) based on an `operationId`, it is RECOMMENDED to consider all Operation Objects from all parsed documents.
+
+Note that no aspect of implicit connection resolution changes how [URIs are resolved](#relative-references-in-api-description-uris), or restricts their possible targets.
+
+See [Appendix G: Parsing and Resolution Guidance](#appendix-g-parsing-and-resolution-guidance) for more details, including a list of Objects and fields using implicit connections.
+
+### Info Object
+
+The object provides metadata about the API.
+The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| title | `string` | **REQUIRED**. The title of the API. |
+| summary | `string` | A short summary of the API. |
+| description | `string` | A description of the API. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
+| termsOfService | `string` | A URI for the Terms of Service for the API. This MUST be in the form of a URI. |
+| contact | [Contact Object](#contact-object) | The contact information for the exposed API. |
+| license | [License Object](#license-object) | The license information for the exposed API. |
+| version | `string` | **REQUIRED**. The version of the OpenAPI document (which is distinct from the [OpenAPI Specification version](#oas-version) or the version of the API being described or the version of the OpenAPI Description). |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Info Object Example
+
+```yaml
+title: Example Pet Store App
+summary: A pet store manager.
+description: This is an example server for a pet store.
+termsOfService: https://example.com/terms/
+contact:
+ name: API Support
+ url: https://www.example.com/support
+ email: support@example.com
+license:
+ name: Apache 2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+version: 1.0.1
+```
+
+### Contact Object
+
+Contact information for the exposed API.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| name | `string` | The identifying name of the contact person/organization. |
+| url | `string` | The URI for the contact information. This MUST be in the form of a URI. |
+| email | `string` | The email address of the contact person/organization. This MUST be in the form of an email address. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Contact Object Example
+
+```yaml
+name: API Support
+url: https://www.example.com/support
+email: support@example.com
+```
+
+### License Object
+
+License information for the exposed API.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| name | `string` | **REQUIRED**. The license name used for the API. |
+| identifier | `string` | An [SPDX](https://spdx.org/licenses/) license expression for the API. The `identifier` field is mutually exclusive of the `url` field. |
+| url | `string` | A URI for the license used for the API. This MUST be in the form of a URI. The `url` field is mutually exclusive of the `identifier` field. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### License Object Example
+
+```yaml
+name: Apache 2.0
+identifier: Apache-2.0
+```
+
+### Server Object
+
+An object representing a Server.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Query and fragment MUST NOT be part of this URL. Variable substitutions will be made when a variable is named in `{`braces`}`. |
+| description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
+| name | `string` | An optional unique string to refer to the host designated by the URL. |
+| variables | Map[`string`, [Server Variable Object](#server-variable-object)] | A map between a variable name and its value. The value is used for substitution in the server's URL template. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Relative References in API URLs
+
+API endpoints are by definition accessed as locations, and are described by this specification as **_URLs_**.
+
+Unless specified otherwise, all fields that are URLs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+
+Because the API is a distinct entity from the OpenAPI document, RFC3986's base URI rules for the OpenAPI document do not apply.
+Unless specified otherwise, relative references are resolved using the URLs defined in the [Server Object](#server-object) as a base URL. Note that these themselves MAY be relative to the referring document.
+
+##### Examples of API Base URL Determination
+
+Assume a retrieval URI of `https://device1.example.com` for the following OpenAPI document:
+
+```yaml
+openapi: 3.2.0
+$self: https://apidescriptions.example.com/foo
+info:
+ title: Example API
+ version: 1.0
+servers:
+- url: .
+ description: The production API on this device
+- url: ./test
+ description: The test API on this device
+```
+
+For API URLs the `$self` field, which identifies the OpenAPI document, is ignored and the retrieval URI is used instead. This produces a normalized production URL of `https://device1.example.com`, and a normalized test URL of `https://device1.example.com/test`.
+
+#### Server Object Example
+
+A single server would be described as:
+
+```yaml
+url: https://development.gigantic-server.com/v1
+description: Development server
+name: dev
+```
+
+The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oas-servers):
+
+```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
+```
+
+The following shows how variables can be used for a server configuration:
+
+```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
+```
+
+### Server Variable Object
+
+An object representing a Server Variable for server URL template substitution.
+
+The server URL templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax.
+
+```abnf
+server-url-template = 1*( literals / server-variable )
+server-variable = "{" server-variable-name "}"
+server-variable-name = 1*( %x00-7A / %x7C / %x7E-10FFFF ) ; every Unicode character except { and }
+
+literals = 1*( %x21 / %x23-24 / %x26-3B / %x3D / %x3F-5B
+ / %x5D / %x5F / %x61-7A / %x7E / ucschar / iprivate
+ / pct-encoded)
+ ; any Unicode character except: CTL, SP,
+ ; DQUOTE, "%" (aside from pct-encoded),
+ ; "<", ">", "\", "^", "`", "{", "|", "}"
+pct-encoded = "%" HEXDIG HEXDIG
+ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF
+ / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD
+ / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD
+ / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD
+ / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD
+ / %xD0000-DFFFD / %xE1000-EFFFD
+iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD
+```
+
+Here, `literals`, `pct-encoded`, `ucschar` and `iprivate` definitions are taken from [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570), incorporating the corrections specified in [Errata 6937](https://www.rfc-editor.org/errata/eid6937) for `literals`.
+
+Each server variable MUST NOT appear more than once in the URL template.
+
+See the [Paths Object](#paths-object) for guidance on constructing full request URLs.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| enum | [`string`] | An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. |
+| default | `string` | **REQUIRED**. The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. If the [`enum`](#server-variable-enum) is defined, the value MUST exist in the enum's values. Note that this behavior is different from the [Schema Object](#schema-object)'s `default` keyword, which documents the receiver's behavior rather than inserting the value into the data. |
+| description | `string` | An optional description for the server variable. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+### Components Object
+
+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 outside the Components Object.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :---- | ---- |
+| schemas | Map[`string`, [Schema Object](#schema-object)] | An object to hold reusable [Schema Objects](#schema-object). |
+| responses | Map[`string`, [Response Object](#response-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Response Objects](#response-object). |
+| parameters | Map[`string`, [Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Parameter Objects](#parameter-object). |
+| examples | Map[`string`, [Example Object](#example-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Example Objects](#example-object). |
+| requestBodies | Map[`string`, [Request Body Object](#request-body-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Request Body Objects](#request-body-object). |
+| headers | Map[`string`, [Header Object](#header-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Header Objects](#header-object). |
+| securitySchemes | Map[`string`, [Security Scheme Object](#security-scheme-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Security Scheme Objects](#security-scheme-object). |
+| links | Map[`string`, [Link Object](#link-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Link Objects](#link-object). |
+| callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Callback Objects](#callback-object). |
+| pathItems | Map[`string`, [Path Item Object](#path-item-object)] | An object to hold reusable [Path Item Objects](#path-item-object). |
+| mediaTypes | Map[`string`, [Media Type Object](#media-type-object) \| [Reference Object](#reference-object)] | An object to hold reusable [Media Type Objects](#media-type-object). |
+
+This object MAY be extended with [Specification Extensions](#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:
+
+```text
+User
+User_1
+User_Name
+user-name
+my.org.User
+```
+
+#### Components Object Example
+
+```yaml
+components:
+ schemas:
+ GeneralError:
+ type: object
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ Category:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ Tag:
+ type: object
+ properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+ parameters:
+ skipParam:
+ name: skip
+ in: query
+ description: number of items to skip
+ required: true
+ schema:
+ type: integer
+ format: int32
+ limitParam:
+ name: limit
+ in: query
+ description: max records to return
+ required: true
+ schema:
+ type: integer
+ format: int32
+ responses:
+ NotFound:
+ description: Entity not found.
+ IllegalInput:
+ description: Illegal input for operation.
+ GeneralError:
+ description: General Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GeneralError'
+ securitySchemes:
+ api_key:
+ type: apiKey
+ name: api-key
+ in: header
+ petstore_auth:
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: https://example.org/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+```
+
+### Paths Object
+
+Holds the relative paths to the individual endpoints and their operations.
+The path is appended to the URL from the [Server Object](#server-object) in order to construct the full URL. The Paths Object MAY be empty, due to [Access Control List (ACL) constraints](#security-filtering).
+
+#### Patterned Fields
+
+| Field Pattern | Type | Description |
+| ---- | :----: | ---- |
+| /{path} | [Path Item Object](#path-item-object) | A relative path to an individual endpoint. The field name MUST begin with a forward slash (`/`). The URL from the [Server Object](#server-object)'s `url` field, resolved and with template variables substituted, has the path **appended** (no relative URL resolution) to it in order to construct the full URL. [Path templating](#path-templating) is allowed. When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Path Templating
+
+Path templating refers to the usage of template expressions, delimited by curly braces (`{}`), to mark a section of a URL path as replaceable using path parameters.
+
+Each template expression in the path MUST correspond to a path parameter that is included in the [Path Item](#path-item-object) itself and/or in each of the Path Item's [Operations](#operation-object). An exception is if the path item is empty, for example due to ACL constraints, matching path parameters are not required.
+
+The value for these path parameters MUST NOT contain any unescaped "generic syntax" characters described by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3): forward slashes (`/`), question marks (`?`), or hashes (`#`).
+See [URL Percent-Encoding](#url-percent-encoding) for additional guidance on escaping characters.
+
+The path templating is defined by the following [ABNF](https://tools.ietf.org/html/rfc5234) syntax
+
+```abnf
+path-template = "/" *( path-segment "/" ) [ path-segment ]
+path-segment = 1*( path-literal / template-expression )
+path-literal = 1*pchar
+template-expression = "{" template-expression-param-name "}"
+template-expression-param-name = 1*( %x00-7A / %x7C / %x7E-10FFFF ) ; every Unicode character except { and }
+
+pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
+unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
+pct-encoded = "%" HEXDIG HEXDIG
+sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
+ / "*" / "+" / "," / ";" / "="
+```
+
+Here, `pchar`, `unreserved`, `pct-encoded` and `sub-delims` definitions are taken from [RFC 3986](https://tools.ietf.org/html/rfc3986). The `path-template` is directly derived from [RFC 3986, section 3.3](https://datatracker.ietf.org/doc/html/rfc3986#section-3.3).
+
+Each template expression MUST NOT appear more than once in a single path template.
+
+See also [Appendix C: Using RFC6570-Based Serialization](#appendix-c-using-rfc6570-based-serialization) for additional guidance.
+
+##### Path Templating Matching
+
+Assuming the following paths, the concrete definition, `/pets/mine`, will be matched first if used:
+
+```text
+ /pets/{petId}
+ /pets/mine
+```
+
+The following paths are considered identical and invalid:
+
+```text
+ /pets/{petId}
+ /pets/{name}
+```
+
+The following may lead to ambiguous resolution:
+
+```text
+ /{entity}/me
+ /books/{id}
+```
+
+#### Paths Object Example
+
+```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
+
+Describes the operations available on a single path.
+A Path Item MAY be empty, due to [ACL constraints](#security-filtering).
+The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| $ref | `string` | Allows for a referenced definition of this path item. The value MUST be in the form of a URI, and the referenced structure MUST be in the form of a [Path Item Object](#path-item-object). In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving [Relative References](#relative-references-in-api-description-uris).
_**Note:** The behavior of `$ref` with adjacent properties is likely to change in future versions of this specification to bring it into closer alignment with the behavior of the [Reference Object](#reference-object)._ |
+| summary | `string` | An optional string summary, intended to apply to all operations in this path. |
+| description | `string` | An optional string description, intended to apply to all operations in this path. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
+| get | [Operation Object](#operation-object) | A definition of a GET operation on this path. |
+| put | [Operation Object](#operation-object) | A definition of a PUT operation on this path. |
+| post | [Operation Object](#operation-object) | A definition of a POST operation on this path. |
+| delete | [Operation Object](#operation-object) | A definition of a DELETE operation on this path. |
+| options | [Operation Object](#operation-object) | A definition of a OPTIONS operation on this path. |
+| head | [Operation Object](#operation-object) | A definition of a HEAD operation on this path. |
+| patch | [Operation Object](#operation-object) | A definition of a PATCH operation on this path. |
+| trace | [Operation Object](#operation-object) | A definition of a TRACE operation on this path. |
+| query | [Operation Object](#operation-object) | A definition of a QUERY operation, as defined in the most recent IETF draft ([draft-ietf-httpbis-safe-method-w-body-08](https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-11.html) as of this writing) or its RFC successor, on this path. |
+| additionalOperations | Map[`string`, [Operation Object](#operation-object)] | A map of additional operations on this path. The map key is the HTTP method with the same capitalization that is to be sent in the request. This map MUST NOT contain any entry for the methods that can be defined by other fixed fields with Operation Object values (e.g. no `POST` entry, as the `post` field is used for this method). |
+| servers | [[Server Object](#server-object)] | An alternative `servers` array to service all operations in this path. If a `servers` array is specified at the [OpenAPI Object](#oas-servers) level, it will be overridden by this value. |
+| parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameter-name) and [location](#parameter-in). The list can use the [Reference Object](#reference-object) to link to parameters that are defined in the [OpenAPI Object's `components.parameters`](#components-parameters). |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Path Item Object 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'
+```
+
+### Operation Object
+
+Describes a single API operation on a path.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier. |
+| summary | `string` | A short summary of what the operation does. |
+| description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
+| externalDocs | [External Documentation Object](#external-documentation-object) | Additional external documentation for this operation. |
+| operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions. |
+| parameters | [[Parameter Object](#parameter-object) \| [Reference Object](#reference-object)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#path-item-parameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameter-name) and [location](#parameter-in). The list can use the [Reference Object](#reference-object) to link to parameters that are defined in the [OpenAPI Object's `components.parameters`](#components-parameters). |
+| requestBody | [Request Body Object](#request-body-object) \| [Reference Object](#reference-object) | The request body applicable for this operation. The `requestBody` is fully supported in HTTP methods where the HTTP specification [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3) has explicitly defined semantics for request bodies. In other cases where the HTTP spec discourages message content (such as [GET](https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.1) and [DELETE](https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.5)), `requestBody` is permitted but does not have well-defined semantics and SHOULD be avoided if possible. |
+| responses | [Responses Object](#responses-object) | The list of possible responses as they are returned from executing this operation. |
+| callbacks | Map[`string`, [Callback Object](#callback-object) \| [Reference Object](#reference-object)] | A map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](#callback-object) that describes a request that may be initiated by the API provider and the expected responses. |
+| deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`. |
+| security | [[Security Requirement Object](#security-requirement-object)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level [`security`](#oas-security). To remove a top-level security declaration, an empty array can be used. |
+| servers | [[Server Object](#server-object)] | An alternative `servers` array to service this operation. If a `servers` array is specified at the [Path Item Object](#path-item-servers) or [OpenAPI Object](#oas-servers) level, it will be overridden by this value. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Operation Object Example
+
+```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
+```
+
+### External Documentation Object
+
+Allows referencing an external resource for extended documentation.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| description | `string` | A description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. |
+| url | `string` | **REQUIRED**. The URI for the target documentation. This MUST be in the form of a URI. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### External Documentation Object Example
+
+```yaml
+description: Find more info here
+url: https://example.com
+```
+
+### Parameter Object
+
+Describes a single operation parameter.
+
+A unique parameter is defined by a combination of a [name](#parameter-name) and [location](#parameter-in).
+
+See [Appendix E](#appendix-e-percent-encoding-and-form-media-types) for a detailed examination of percent-encoding concerns, including interactions with the `application/x-www-form-urlencoded` query string format.
+
+#### Parameter Locations
+
+There are five possible parameter locations specified by the `in` field:
+
+* path - Used together with [Path Templating](#path-templating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.
+* query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`; MUST NOT appear in the same operation (or in the operation's path-item) as an `in: "querystring"` parameter.
+* querystring - A parameter that treats the entire URL query string as a value which MUST be specified using the `content` field, most often with media type `application/x-www-form-urlencoded` using [Encoding Objects](#encoding-object) in the same way as with request bodies of that media type; MUST NOT appear more than once, and MUST NOT appear in the same operation (or in the operation's path-item) as any `in: "query"` parameters.
+* header - Custom headers that are expected as part of the request. Note that [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#section-5.1) states header names are case-insensitive.
+* cookie - Used to pass a specific cookie value to the API.
+
+#### Fixed Fields
+
+The rules for serialization of the parameter are specified in one of two ways.
+Parameter Objects MUST include either a `content` field or a `schema` field, but not both.
+See [Appendix B](#appendix-b-data-type-conversion) for a discussion of converting values of various types to string representations.
+
+##### Common Fixed Fields
+
+These fields MAY be used with either `content` or `schema`.
+
+The `example` and `examples` fields are mutually exclusive; see [Working with Examples](#working-with-examples) for guidance on validation requirements.
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| name | `string` | **REQUIRED**. The name of the parameter. Parameter names are _case-sensitive_.
type: string
format: binary
| contentMediaType: image/png
| if redundant, can be omitted, often resulting in an empty [Schema Object](#schema-object) |
+| type: string
format: byte
| type: string
contentMediaType: image/png
contentEncoding: base64
| note that `base64url` can be used to avoid re-encoding the base64 string to be URL-safe |
+
+#### Extended Validation with Annotations
+
+JSON Schema Draft 2020-12 supports [collecting annotations](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-7.7.1), including [treating unrecognized keywords as annotations](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-6.5).
+OAS implementations MAY use such annotations, including [extensions](https://spec.openapis.org/registry/extension/) not recognized as part of a declared JSON Schema vocabulary, as the basis for further validation.
+Note that JSON Schema Draft 2020-12 does not require an `x-` prefix for extensions.
+
+##### Non-Validating Constraint Keywords
+
+The [`format` keyword (when using default format-annotation vocabulary)](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#section-7.2.1) and the [`contentMediaType`, `contentEncoding`, and `contentSchema` keywords](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#section-8.2) define constraints on the data, but are treated as annotations instead of being validated directly.
+Extended validation is one way that these constraints MAY be enforced.
+
+##### Validating `readOnly` and `writeOnly`
+
+The `readOnly` and `writeOnly` keywords are annotations, as JSON Schema is not aware of how the data it is validating is being used.
+Validation of these keywords MAY be done by checking the annotation, the read or write direction, and (if relevant) the current value of the field.
+[JSON Schema Validation Draft 2020-12 Section 9.4](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#section-9.4) defines the expectations of these keywords, including that a resource (described as the "owning authority") MAY either ignore a `readOnly` field or treat it as an error.
+
+Fields that are both required and read-only are an example of when it is beneficial to ignore a `readOnly: true` constraint in a PUT, particularly if the value has not been changed.
+This allows correctly requiring the field on a GET and still using the same representation and schema with PUT.
+Even when read-only fields are not required, stripping them is burdensome for clients, particularly when the JSON data is complex or deeply nested.
+
+Note that the behavior of `readOnly` in particular differs from that specified by version 3.0 of this specification.
+
+#### Data Modeling Techniques
+
+##### Composition and Inheritance (Polymorphism)
+
+The OpenAPI Specification allows combining and extending model definitions using the `allOf` keyword of JSON Schema, in effect offering model composition.
+`allOf` takes an array of object definitions that are validated _independently_ but together compose a single object.
+
+While composition offers model extensibility, it does not imply a hierarchy between the models.
+
+JSON Schema also provides the `anyOf` and `oneOf` keywords, which allow defining multiple schemas where at least one or exactly one of them must be valid, respectively.
+As is the case with `allOf`, the schemas are validated _independently_.
+These keywords can be used to describe polymorphism, where a single field can accept multiple types of values.
+
+The OpenAPI specification extends the JSON Schema support for polymorphism by adding the [`discriminator`](#schema-discriminator) field whose value is a [Discriminator Object](#discriminator-object).
+When used, the Discriminator Object indicates the name of the property that hints which schema of an `anyOf` or `oneOf` is expected to validate the structure of the model.
+The discriminating property MAY be defined as required or optional, but when defined as an optional property the Discriminator Object MUST include a `defaultMapping` field that specifies which schema of the `anyOf` or `oneOf`, or which schema that references the current schema in an `allOf`, is expected to validate the structure of the model when the discriminating property is not present.
+
+There are two ways to define the value of a discriminating property for an inheriting instance.
+
+* Use the schema name.
+* [Override the schema name](#discriminator-mapping) by overriding the property with a new value. If a new value exists, this takes precedence over the schema name.
+
+##### Generic (Template) Data Structures
+
+Implementations SHOULD support defining generic or template data structures using JSON Schema's dynamic referencing feature:
+
+* `$dynamicAnchor` identifies a set of possible schemas (including a default placeholder schema) to which a `$dynamicRef` can resolve
+* `$dynamicRef` resolves to the first matching `$dynamicAnchor` encountered on its path from the schema entry point to the reference, as described in the JSON Schema specification
+
+An example is included in the [Schema Object Examples](#schema-object-examples) section below, and further information can be found on the Learn OpenAPI site's ["Dynamic References"](https://learn.openapis.org/referencing/dynamic.html) page.
+
+##### Annotated Enumerations
+
+The Schema Object's `enum` keyword does not allow associating descriptions or other information with individual values.
+
+Implementations MAY support recognizing a `oneOf` or `anyOf` where each subschema in the keyword's array consists of a `const` keyword and annotations such as `title` or `description` as an enumerated type with additional information. The exact behavior of this pattern beyond what is required by JSON Schema is implementation-defined.
+
+##### XML Modeling
+
+The [xml](#schema-xml) field allows extra definitions when translating the JSON definition to XML.
+The [XML Object](#xml-object) contains additional information about the available options.
+
+#### Specifying Schema Dialects
+
+It is important for tooling to be able to determine which dialect or meta-schema any given resource wishes to be processed with: JSON Schema Core, JSON Schema Validation, OpenAPI Schema dialect, or some custom meta-schema.
+
+The `$schema` keyword MAY be present in any Schema Object that is a [schema resource root](https://www.ietf.org/archive/id/draft-bhutton-json-schema-01.html#section-4.3.5), and if present MUST be used to determine which dialect should be used when processing the schema. This allows use of Schema Objects which comply with other drafts of JSON Schema than the default Draft 2020-12 support. Tooling MUST support the OAS dialect schema id, and MAY support additional values of `$schema`.
+
+To allow use of a different default `$schema` value for all Schema Objects contained within an OAS document, a `jsonSchemaDialect` value may be set within the OpenAPI Object. If this default is not set, then the OAS dialect schema id MUST be used for these Schema Objects. The value of `$schema` within a resource root Schema Object always overrides any default.
+
+For standalone JSON Schema documents that do not set `$schema`, or for Schema Objects in OpenAPI description documents that are _not_ [complete documents](#openapi-description-structure), the dialect SHOULD be assumed to be the OAS dialect.
+However, for maximum interoperability, it is RECOMMENDED that OpenAPI description authors explicitly set the dialect through `$schema` in such documents.
+
+#### Schema Object Examples
+
+##### Primitive Example
+
+```yaml
+type: string
+format: email
+```
+
+##### Simple Model
+
+```yaml
+type: object
+required:
+ - name
+properties:
+ name:
+ type: string
+ address:
+ $ref: '#/components/schemas/Address'
+ age:
+ type: integer
+ format: int32
+ minimum: 0
+```
+
+##### Model with Map/Dictionary Properties
+
+For a simple string to string mapping:
+
+```yaml
+type: object
+additionalProperties:
+ type: string
+```
+
+For a string to model mapping:
+
+```yaml
+type: object
+additionalProperties:
+ $ref: '#/components/schemas/ComplexModel'
+```
+
+##### Model with Annotated Enumeration
+
+```yaml
+oneOf:
+ - const: RGB
+ title: Red, Green, Blue
+ description: Specify colors with the red, green, and blue additive color model
+ - const: CMYK
+ title: Cyan, Magenta, Yellow, Black
+ description: Specify colors with the cyan, magenta, yellow, and black subtractive color model
+```
+
+##### Model with Example
+
+```yaml
+type: object
+properties:
+ id:
+ type: integer
+ format: int64
+ name:
+ type: string
+required:
+ - name
+examples:
+ - name: Puma
+ id: 1
+```
+
+##### Models with Composition
+
+```yaml
+components:
+ schemas:
+ ErrorModel:
+ type: object
+ required:
+ - message
+ - code
+ properties:
+ message:
+ type: string
+ code:
+ type: integer
+ minimum: 100
+ maximum: 600
+ ExtendedErrorModel:
+ allOf:
+ - $ref: '#/components/schemas/ErrorModel'
+ - type: object
+ required:
+ - rootCause
+ properties:
+ rootCause:
+ type: string
+```
+
+##### Models with Polymorphism Support
+
+The following example describes a `Pet` model that can represent either a cat or a dog, as distinguished by the `petType` property. Each type of pet has other properties beyond those of the base `Pet` model. An instance without a `petType` property, or with a `petType` property that does not match either `cat` or `dog`, is invalid.
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ properties:
+ name:
+ type: string
+ required:
+ - name
+ - petType
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ Cat:
+ description: A pet cat
+ type: object
+ properties:
+ petType:
+ const: 'cat'
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog:
+ description: A pet dog
+ type: object
+ properties:
+ petType:
+ const: 'dog'
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - packSize
+```
+
+##### Models with Polymorphism Support and a Discriminator Object
+
+The following example extends the example of the previous section by adding a [Discriminator Object](#discriminator-object) to the `Pet` schema. Note that the Discriminator Object is only a hint to the consumer of the API and does not change the validation outcome of the schema.
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ discriminator:
+ propertyName: petType
+ mapping:
+ cat: '#/components/schemas/Cat'
+ dog: '#/components/schemas/Dog'
+ properties:
+ name:
+ type: string
+ required:
+ - name
+ - petType
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ Cat:
+ description: A pet cat
+ type: object
+ properties:
+ petType:
+ const: 'cat'
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog:
+ description: A pet dog
+ type: object
+ properties:
+ petType:
+ const: 'dog'
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - petType
+ - packSize
+```
+
+##### Models with Polymorphism Support using `allOf` and a Discriminator Object
+
+It is also possible to describe polymorphic models using `allOf`. The following example uses `allOf` with a [Discriminator Object](#discriminator-object) to describe a polymorphic `Pet` model.
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ discriminator:
+ propertyName: petType
+ properties:
+ name:
+ type: string
+ petType:
+ type: string
+ required:
+ - name
+ - petType
+ Cat: # "Cat" will be used as the discriminating value
+ description: A representation of a cat
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ huntingSkill:
+ type: string
+ description: The measured skill for hunting
+ enum:
+ - clueless
+ - lazy
+ - adventurous
+ - aggressive
+ required:
+ - huntingSkill
+ Dog: # "Dog" will be used as the discriminating value
+ description: A representation of a dog
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ packSize:
+ type: integer
+ format: int32
+ description: the size of the pack the dog is from
+ default: 0
+ minimum: 0
+ required:
+ - packSize
+```
+
+##### Generic Data Structure Model
+
+```yaml
+components:
+ schemas:
+ genericArrayComponent:
+ $id: fully_generic_array
+ type: array
+ items:
+ $dynamicRef: '#generic-array'
+ $defs:
+ allowAll:
+ $dynamicAnchor: generic-array
+ numberArray:
+ $id: array_of_numbers
+ $ref: fully_generic_array
+ $defs:
+ numbersOnly:
+ $dynamicAnchor: generic-array
+ type: number
+ stringArray:
+ $id: array_of_strings
+ $ref: fully_generic_array
+ $defs:
+ stringsOnly:
+ $dynamicAnchor: generic-array
+ type: string
+ objWithTypedArray:
+ $id: obj_with_typed_array
+ type: object
+ required:
+ - dataType
+ - data
+ properties:
+ dataType:
+ enum:
+ - string
+ - number
+ oneOf:
+ - properties:
+ dataType:
+ const: string
+ data:
+ $ref: array_of_strings
+ - properties:
+ dataType:
+ const: number
+ data:
+ $ref: array_of_numbers
+```
+
+### Discriminator Object
+
+When request bodies or response payloads may be one of a number of different schemas, these should use the JSON Schema `anyOf` or `oneOf` keywords to describe the possible schemas (see [Composition and Inheritance](#composition-and-inheritance-polymorphism)).
+
+A polymorphic schema MAY include a Discriminator Object, which defines the name of the property that may be used as a hint for which schema of the `anyOf` or `oneOf`, or which schema that references the current schema in an `allOf`, is expected to validate the structure of the model.
+This hint can be used to aid in serialization, deserialization, and validation.
+The Discriminator Object does this by implicitly or explicitly associating the possible values of a named property with alternative schemas.
+
+Note that `discriminator` MUST NOT change the validation outcome of the schema.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| propertyName | `string` | **REQUIRED**. The name of the discriminating property in the payload that will hold the discriminating value. The discriminating property MAY be defined as required or optional, but when defined as optional the Discriminator Object MUST include a `defaultMapping` field that specifies which schema is expected to validate the structure of the model when the discriminating property is not present. |
+| mapping | Map[`string`, `string`] | An object to hold mappings between payload values and schema names or URI references. |
+| defaultMapping | `string` | The schema name or URI reference to a schema that is expected to validate the structure of the model when the discriminating property is not present in the payload or contains a value for which there is no explicit or implicit mapping. |
+
+This object MAY be extended with [Specification Extensions](#specification-extensions).
+
+#### Conditions for Using the Discriminator Object
+
+The Discriminator Object is legal only when using one of the composite keywords `oneOf`, `anyOf`, `allOf`.
+
+In both the `oneOf` and `anyOf` use cases, where those keywords are adjacent to `discriminator`, all possible schemas MUST be listed explicitly.
+
+To avoid redundancy, the discriminator MAY be added to a parent schema definition, and all schemas building on the parent schema via an `allOf` construct may be used as an alternate schema.
+
+The `allOf` form of `discriminator` is _only_ useful for non-validation use cases; validation with the parent schema with this form of `discriminator` _does not_ perform a search for child schemas or use them in validation in any way.
+This is because `discriminator` cannot change the validation outcome, and no standard JSON Schema keyword connects the parent schema to the child schemas.
+
+The behavior of any configuration of `oneOf`, `anyOf`, `allOf` and `discriminator` that is not described above is undefined.
+
+#### Options for Mapping Values to Schemas
+
+The value of the property named in `propertyName` is used as the name of the associated schema under the [Components Object](#components-object), _unless_ a `mapping` is present for that value.
+The `mapping` entry maps a specific property value to either a different schema component name, or to a schema identified by a URI.
+When using implicit or explicit schema component names, inline `oneOf` or `anyOf` subschemas are not considered.
+The behavior of a `mapping` value or `defaultMapping` value that is both a valid schema name and a valid relative URI reference is implementation-defined, but it is RECOMMENDED that it be treated as a schema name.
+To ensure that an ambiguous value (e.g. `"foo"`) is treated as a relative URI reference by all implementations, authors MUST prefix it with the `"."` path segment (e.g. `"./foo"`).
+
+Mapping keys MUST be string values, but tooling MAY convert response values to strings for comparison.
+However, the exact nature of such conversions are implementation-defined.
+
+#### Optional Discriminating Property
+
+When the discriminating property is defined as optional, the [Discriminator Object](#discriminator-object) MUST include a `defaultMapping` field that specifies a schema that is expected to validate the structure of the model when the discriminating property is not present in the payload or contains a value for which there is no explicit or implicit mapping. This allows the schema to still be validated correctly even if the discriminating property is missing.
+
+The primary use case for an optional discriminating property is to allow a schema to be extended with a discriminator without breaking existing clients that do not provide the discriminating property.
+
+When the discriminating property is defined as optional, it is important that each subschema that defines a value for the discriminating property also define the property as required, since this is no longer enforced by the parent schema.
+
+The `defaultMapping` schema is also expected to validate the structure of the model when the discriminating property is present but contains a value for which there is no explicit or implicit mapping. This is typically expressed in the `defaultMapping` schema by excluding any instances with mapped values of the discriminating property, e.g.
+
+```yaml
+OtherPet:
+ type: object
+ properties:
+ petType:
+ not:
+ enum: ['cat', 'dog']
+```
+
+This prevents the `defaultMapping` schema from validating a payload that includes the discriminating property with a mapped discriminating value, which would cause a validation to fail when polymorphism is described using the `oneOf` JSON schema keyword.
+
+#### Examples
+
+For these examples, assume all schemas are in the [entry document](#openapi-description-structure) of the OAD; for handling of `discriminator` in referenced documents see [Resolving Implicit Connections](#resolving-implicit-connections).
+
+In OAS 3.x, a response payload MAY be described to be exactly one of any number of types:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+```
+
+which means a valid payload has to match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. Deserialization of a `oneOf` can be a costly operation, as it requires determining which schema matches the payload and thus should be used in deserialization. This problem also exists for `anyOf` schemas. A `discriminator` can be used as a "hint" to improve the efficiency of selection of the matching schema. The [Discriminator Object](#discriminator-object) cannot change the validation result of the `oneOf`, it can only help make the deserialization more efficient and provide better error messaging. We can specify the exact field that tells us which schema is expected to match the instance:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ discriminator:
+ propertyName: petType
+```
+
+The expectation now is that a property with name `petType` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OpenAPI Description. Thus the response payload:
+
+```json
+{
+ "id": 12345,
+ "petType": "Cat"
+}
+```
+
+will indicate that the `Cat` schema is expected to match this payload.
+
+In scenarios where the value of the discriminating property does not match the schema name or implicit mapping is not possible, an optional `mapping` definition can be used:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ - $ref: https://gigantic-server.com/schemas/Monster/schema.json
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: '#/components/schemas/Dog'
+ monster: https://gigantic-server.com/schemas/Monster/schema.json
+```
+
+Here the discriminating value of `dog` will map to the schema `#/components/schemas/Dog`, rather than the default (implicit) value of `#/components/schemas/dog`. If the discriminating value does not match an implicit or explicit mapping, no schema can be determined and validation SHOULD fail.
+
+When used in conjunction with the `anyOf` construct, the use of the discriminator can avoid ambiguity for serializers/deserializers where multiple schemas may satisfy a single payload.
+
+When the discriminating property is defined as optional, the Discriminator Object has to include a `defaultMapping` field that specifies a schema of the `anyOf` or `oneOf` is expected to validate the structure of the model when the discriminating property is not present in the payload. This allows the schema to still be validated correctly even if the discriminator property is missing.
+
+For example:
+
+```yaml
+MyResponseType:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Dog'
+ - $ref: '#/components/schemas/Lizard'
+ - $ref: '#/components/schemas/OtherPet'
+ discriminator:
+ propertyName: petType
+ defaultMapping: OtherPet
+OtherPet:
+ type: object
+ properties:
+ petType:
+ not:
+ enum: ['Cat', 'Dog', 'Lizard']
+```
+
+In this example, if the `petType` property is not present in the payload, or if the value of `petType` is not "Cat", "Dog", or "Lizard", then the payload should validate against the `OtherPet` schema.
+
+This example shows the `allOf` usage, which avoids needing to reference all child schemas in the parent:
+
+```yaml
+components:
+ schemas:
+ Pet:
+ type: object
+ required:
+ - petType
+ properties:
+ petType:
+ type: string
+ discriminator:
+ propertyName: petType
+ mapping:
+ dog: Dog
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Cat`
+ properties:
+ name:
+ type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Dog`
+ properties:
+ bark:
+ type: string
+ Lizard:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ # all other properties specific to a `Lizard`
+ properties:
+ lovesRocks:
+ type: boolean
+```
+
+Validated against the `Pet` schema, a payload like this:
+
+```json
+{
+ "petType": "Cat",
+ "name": "Misty"
+}
+```
+
+will indicate that the `#/components/schemas/Cat` schema is expected to match. Likewise this payload:
+
+```json
+{
+ "petType": "dog",
+ "bark": "soft"
+}
+```
+
+will map to `#/components/schemas/Dog` because the `dog` entry in the `mapping` element maps to `Dog` which is the schema name for `#/components/schemas/Dog`.
+
+### XML Object
+
+A metadata object that allows for more fine-tuned XML model definitions.
+When using a Schema Object with XML, if no XML Object is present, the behavior is determined by the XML Object's default field values.
+
+#### Fixed Fields
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| nodeType | `string` | One of `element`, `attribute`, `text`, `cdata`, or `none`, as explained under [XML Node Types](#xml-node-types). The default value is `none` if `$ref`, `$dynamicRef`, or `type: "array"` is present in the [Schema Object](#schema-object) containing the XML Object, and `element` otherwise. |
+| name | `string` | Sets the name of the element/attribute corresponding to the schema, replacing the name that was inferred as described under [XML Node Names](#xml-node-names). This field SHALL be ignored if the `nodeType` is `text`, `cdata`, or `none`. |
+| namespace | `string` | The IRI ([[RFC3987]]) of the namespace definition. Value MUST be in the form of a non-relative IRI. |
+| prefix | `string` | The prefix to be used for the [name](#xml-name). |
+| attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`. If `nodeType` is present, this field MUST NOT be present.Awesome documentation goes here
+ + +--boundary-example +``` + +In this example, the URI for each part, which also serves as its base URI, comes from the part's `Content-Location` header as specified by RFC2557. +Since the Schema Object at `#/components/schemas/Foo` does not contain an `$id`, the reference in its subschema uses the OpenAPI document's base URI, which is taken from the `Content-Location` header of its part within the `multipart/related` format. +The resulting reference to `https://example.com/schemas/bar` matches the `Content-Location` header of the second part, which according to RFC2557 allows the reference target to be located within the multipart archive. + +Similarly, the `url` field of the [External Documentation Object](#external-documentation-object) is resolved against the base URI from `Content-Location`, producing `https://example.com/api/docs.html` which matches the `Content-Location` of the third part. + +### Base URI From the Retrieval URI + +If no base URI is provided from either of the previous sources, the next source is the retrieval URI ([RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1.3)). + +Assume this document was retrieved from `https://example.com/api/openapis.yaml`: + +```yaml +openapi: 3.2.0 +info: + title: Example API + version: 1.0 +components: + requestBodies: + Foo: + content: + application/json: + schema: + $ref: schemas/foo +``` + +Assume this document was retrieved from `https://example.com/api/schemas/foo`: + +```json +{ + "type": "object", + "properties": { + "bar": { + "type": "string" + } + } +} +``` + +Resolving the `$ref: schemas/foo` against the retrieval URI of the OpenAPI document produces `https://example.com/api/schemas/foo`, the retrieval URI of the JSON Schema document. + +### Application-Specific Default Base URI + +When constructing an OpenAPI document in memory that does not have a `$self`, or an encapsulating entity, or a retrieval URI, applications can resolve internal (fragment-only) references by assuming a default base URI ([RFC3986](https://tools.ietf.org/html/rfc3986#section-5.1.4)). +While this sort of internal resolution can be performed in practice without choosing a base URI, choosing one, such as a URN with a randomly generated UUID (e.g. `urn:uuid:f26cdaad-3193-4398-a838-4ecb7326c4c5`) avoids the need to implement it as a special case. + +### Resolving Relative `$self` and `$id` + +Let's re-consider the first example in this appendix, but with relative URI references for `$self` and `$id`, and retrieval URIs that support that relative usage: + + +Assume that the following is retrieved from `https://staging.example.com/api/openapi`: + +```yaml +openapi: 3.2.0 +$self: /api/openapi +info: + title: Example API + version: 1.0 +paths: + /foo: + get: + requestBody: + $ref: "shared/foo#/components/requestBodies/Foo" +``` + +Assume the retrieval URI for the following document is `https://staging.example.com/api/shared/foo`: + +```yaml +openapi: 3.2.0 +$self: /api/shared/foo +info: + title: Shared components for all APIs + version: 1.0 +components: + requestBodies: + Foo: + content: + application/json: + schema: + $ref: ../schemas/foo + schemas: + Foo: + $id: /api/schemas/foo + properties: + bar: + $ref: bar + Bar: + $id: /api/schemas/bar + type: string +``` + +In this example, all of the `$self` and `$id` values are relative URI references consisting of an absolute path. +This allows the retrieval URI to set the host (and scheme), in this case `https://staging.example.com`, resulting in the first document's `$self` being `https://staging.example.com/openapi`, and the second document's `$self` being `https://staging.example.com/api/shared/foo`, with `$id` values of `https://staging.example.com/api/schemas/foo` and `https://staging.example.com/api/schemas/bar`. +Relative `$self` and `$id` values of this sort allow the same set of documents to work when deployed to other hosts, e.g. `https://example.com` (production) or `https://localhost:8080` (local development). + +## Appendix G: Parsing and Resolution Guidance + +Implementations MAY support complete-document parsing in any of the following ways: + +* Detecting OpenAPI or JSON Schema documents using media types +* Detecting OpenAPI documents through the root `openapi` field +* Detecting JSON Schema documents through detecting keywords or otherwise successfully parsing the document in accordance with the JSON Schema specification + +Additional mechanisms can be used to support documents with Objects other than an OpenAPI Object or a Schema Object at the root, but note that the resulting behavior is implementation-defined: + +* Detecting a document containing a referenceable Object at its root based on the expected type of the reference +* Allowing users to configure the type of documents that might be loaded due to a reference to a non-root Object + +### Warnings Regarding Fragmentary Parsing + +Implementations that parse referenced fragments of OpenAPI content without regard for the content of the rest of the containing document will miss keywords that change the meaning and behavior of the reference target. +In particular, failing to take into account keywords that change the base URI introduces security risks by causing references to resolve to unintended URIs, with unpredictable results. +While some implementations support this sort of parsing due to the requirements of past versions of this specification, in version 3.1 and later, the result of parsing fragments in isolation is _undefined_ and likely to contradict the requirements of this specification. + +While it is possible to structure certain OpenAPI Descriptions to ensure that they will behave correctly when references are parsed as isolated fragments, depending on this is NOT RECOMMENDED. +This specification does not explicitly enumerate the conditions under which such behavior is safe and provides no guarantee for continued safety in any future versions of the OAS. + +### Conflicts Between Field Types and Reference Contexts + +JSON or YAML objects within an OAD are interpreted as specific Objects (such as [Operation Objects](#operation-object), [Response Objects](#response-object), [Reference Objects](#reference-object), etc.) based on their context. Depending on how references are arranged, a given JSON or YAML object can be interpreted in multiple different contexts: + +* As the root object of the [entry document](#openapi-description-structure), which is always interpreted as an OpenAPI Object +* As the Object type implied by its parent Object's field within the document +* As a reference target, with the Object type matching the reference source's context + +If the same JSON/YAML object is parsed multiple times and the respective contexts require it to be parsed as _different_ Object types, the resulting behavior is _implementation defined_, and MAY be treated as an error if detected. An example would be referencing an empty Schema Object under `#/components/schemas` where a Path Item Object is expected, as an empty object is valid for both types. For maximum interoperability, it is RECOMMENDED that OpenAPI Description authors avoid such scenarios. + +### Guidance Regarding Implicit Connections + +The following Objects and Fields involve the use of implicit connections: + +| Source | Target | Alternative | +| ---- | ---- | ---- | +| [Security Requirement Object](#security-requirement-object) `{name}` | [Security Scheme Object](#security-scheme-object) name under the [Components Object](#components-object) | _n/a_ | +| [Discriminator Object](#discriminator-object) `mapping` _(implicit, or explicit name syntax)_ | [Schema Object](#schema-object) name under the Components Object | `mapping` _(explicit URI syntax)_ | +| [Operation Object](#operation-object) `tags` | [Tag Object](#tag-object) `name` (in the [OpenAPI Object](#openapi-object)'s `tags` array) | _n/a_ | +| [Link Object](#link-object) `operationId` | [Operation Object](#operation-object) `operationId` | `operationRef` | + +An additional implicit connection involves appending the templated URL paths of the [Paths Object](#paths-object) to the appropriate [Server Object](#server-object)'s `url` field. +This connection is unambiguous because only the entry document's Paths Object contributes URLs to the described API. + +The implicit connections in the Security Requirement Object and Discriminator Object rely on the _component name_, which is the name of the property holding the component in the appropriately typed sub-object of the Components Object. +For example, the component name of the Schema Object at `#/components/schemas/Foo` is `Foo`. +The implicit connection of `tags` in the Operation Object uses the `name` field of Tag Objects, which (like the Components Object) are found under the root OpenAPI Object. +This means resolving component names and tag names both depend on starting from the correct OpenAPI Object. + +For resolving component and tag name connections from a referenced (non-entry) document, it is RECOMMENDED that tools resolve from the entry document, rather than the current document. +Resolving component and tag name connections from a referenced (non-entry) document to the entry document as recommended under [Resolving Implicit Connections](#resolving-implicit-connections) allows components and Tag Objects to be defined next to the API's deployment information in the top-level array of Server Objects and treated as an interface for referenced documents to access. + +For Security Requirement Objects and Discriminator Objects, it is also possible to keep the resolution within the referenced document by using the URI-reference form that these Objects offer. + +There are no URI-based alternatives for the Operation Object's `tags` field. +OAD authors are advised to use external solutions such as the OpenAPI Initiative's Overlay Specification to simulate sharing [Tag Objects](#tag-object) across multiple documents. + +#### Implicit Connection Resolution Examples + +This section shows how to retrieve an HTTP-accessible multi-document OpenAPI Description (OAD) and resolve a [Security Requirement Object](#security-requirement-object) in the referenced (non-entry) document. +The behavior for Discriminator Object non-URI mappings and for the Operation Object's `tags` field operate on the same principles. + +First, the [entry document](#openapi-description-structure) is where parsing begins. It defines the `MySecurity` security scheme to be JWT-based, and it defines a Path Item as a reference to a component in another document: + +```http +GET /api/description/openapi HTTP/1.1 +Host: www.example.com +Accept: application/openapi+json +``` + +```json +"components": { + "securitySchemes": { + "MySecurity": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } +}, +"paths": { + "/foo": { + "$ref": "other#/components/pathItems/Foo" + } +} +``` + +```http +GET /api/description/openapi HTTP/1.1 +Host: www.example.com +Accept: application/openapi+yaml +``` + +```yaml +components: + securitySchemes: + MySecurity: + type: http + scheme: bearer + bearerFormat: JWT +paths: + /foo: + $ref: 'other#/components/pathItems/Foo' +``` + +This entry document references another document, `other`, without using a file extension. This gives the client the flexibility to choose an acceptable format on a resource-by-resource basis, assuming both representations are available: + +```http +GET /api/description/other HTTP/1.1 +Host: www.example.com +Accept: application/openapi+json +``` + +```json +"components": { + "securitySchemes": { + "MySecurity": { + "type": "http", + "scheme": "basic" + } + }, + "pathItems": { + "Foo": { + "get": { + "security": [ + "MySecurity": [] + ] + } + } + } +} +``` + +```http +GET /api/description/other HTTP/1.1 +Host: www.example.com +Accept: application/openapi+yaml +``` + +```yaml +components: + securitySchemes: + MySecurity: + type: http + scheme: basic + pathItems: + Foo: + get: + security: + - MySecurity: [] +``` + +In the `other` document, the referenced path item has a Security Requirement for a Security Scheme, `MySecurity`. The same Security Scheme exists in the original entry document. As outlined in [Resolving Implicit Connections](#resolving-implicit-connections), `MySecurity` is resolved with an [implementation-defined behavior](#undefined-and-implementation-defined-behavior), but the section formally recommends that tools resolve component names from the [entry document](#openapi-description-structure). As with all implementation-defined behavior, it is important to check tool documentation to determine which behavior is supported.