diff --git a/src/oas.md b/src/oas.md
new file mode 100644
index 0000000000..6afe86b2a0
--- /dev/null
+++ b/src/oas.md
@@ -0,0 +1,4887 @@
+# 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 with a minimal amount of implementation logic.
+
+An OpenAPI Description 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/).
+
+## Definitions
+
+### OpenAPI Description
+
+An OpenAPI Description (OAD) formally describes the surface of an API and its semantics. It is composed of an [entry document](#openapi-description-structure), which must be an OpenAPI Document, and any/all of its referenced documents. An OAD uses and conforms to the OpenAPI Specification, and MUST contain at least one [paths](#paths-object) field, [components](#oas-components) field, or [webhooks](#oas-webhooks) field.
+
+### OpenAPI Document
+
+An OpenAPI Document is a single JSON or YAML document that conforms to the OpenAPI Specification. An OpenAPI Document compatible with OAS 3.\*.\* contains a required [`openapi`](#oas-version) field which designates the version of the OAS that it uses.
+
+### Schema
+
+A "schema" is a formal description of syntax and structure.
+This document serves as the [schema](#schema) for the OpenAPI Specification format; a non-authoritative JSON Schema based on this document is also provided on [spec.openapis.org](https://spec.openapis.org) for informational purposes.
+This specification also _uses_ schemas in the form of the [Schema Object](#schema-object).
+
+### Object
+
+When capitalized, the word "Object" refers to any of the Objects that are named by section headings in this document.
+
+### 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 (`#`).
+
+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 UTF8 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).
+
+See also [Appendix C: Using RFC6570-Based Serialization](#appendix-c-using-rfc6570-based-serialization) for additional guidance.
+
+### Media Types
+
+Media type definitions are spread across several resources.
+The media type definitions SHOULD be in compliance with [RFC6838](https://tools.ietf.org/html/rfc6838).
+
+Some examples of possible media type definitions:
+
+```text
+ text/plain; charset=utf-8
+ application/json
+ application/vnd.github+json
+ application/vnd.github.v3+json
+ application/vnd.github.v3.raw+json
+ application/vnd.github.v3.text+json
+ application/vnd.github.v3.html+json
+ application/vnd.github.v3.full+json
+ application/vnd.github.v3.diff
+ application/vnd.github.v3.patch
+```
+
+### HTTP Status Codes
+
+The HTTP Status Codes are used to indicate the status of the executed operation.
+Status codes SHOULD be selected from the available status codes registered in the [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
+
+### 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.
+
+### 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.
+
+## Specification
+
+### Versions
+
+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.
+
+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.
+
+### 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.
+
+For example, if a field has an array value, the JSON array representation will be used:
+
+```json
+{
+ "field": [1, 2, 3]
+}
+```
+
+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**.
+
+The [schema](#schema) exposes 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.
+
+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 some additional constraints:
+
+* Tags MUST be limited to those allowed by [YAML's JSON schema ruleset](https://yaml.org/spec/1.2/spec.html#id2803231), which defines a subset of the YAML syntax and is unrelated to [[JSON-Schema-2020-12|JSON Schema]].
+* Keys used in YAML maps MUST be limited to a scalar string, as defined by the [YAML Failsafe schema ruleset](https://yaml.org/spec/1.2/spec.html#id2802346).
+
+**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.
+
+### OpenAPI Description Structure
+
+An OpenAPI Description (OAD) MAY be made up of a single JSON or YAML document or be divided into multiple, connected parts at the discretion of the author. In the latter case, [Reference Object](#reference-object), [Path Item Object](#path-item-object) and [Schema Object](#schema-object) `$ref` fields, as well as the [Link Object](#link-object) `operationRef` field, and the URI form of the [Discriminator Object](#discriminator-object) `mapping` field, are used to identify the referenced elements.
+
+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`.
+
+#### Parsing Documents
+
+In order to properly handle [Schema Objects](#schema-object), OAS 3.1 inherits the parsing requirements of [JSON Schema Specification Draft 2020-12](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01#section-9), with appropriate modifications regarding base URIs as specified in [Relative References In URIs](#relative-references-in-api-description-uris).
+
+This includes a requirement to parse complete documents before deeming a Schema Object reference to be unresolvable, in order to detect keywords that might provide the reference target or impact the determination of the appropriate base URI.
+
+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
+* 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
+
+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, 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.
+
+A special case of parsing fragments of OAS content would be if such fragments are embedded in another format, referred to as an _embedding format_ with respect to the OAS.
+Note that the OAS itself is an embedding format with respect to JSON Schema, which is embedded as 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.
+
+#### Structural Interoperability
+
+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 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.
+
+#### 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 always use the alternative:
+
+| 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` | [Path Item Object](#path-item-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.
+
+It is RECOMMENDED to consider all Operation Objects from all parsed documents when resolving any Link Object `operationId`.
+This requires parsing all referenced documents prior to determining an `operationId` to be unresolvable.
+
+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.
+This allows Security Scheme Objects and Tag Objects to be defined next to the API's deployment information (the top-level array of Server Objects), and treated as an interface for referenced documents to access.
+
+The interface approach can also work for Discriminator Objects and Schema Objects, but it is also possible to keep the Discriminator Object's behavior within a single document using the relative URI-reference syntax of `mapping`.
+
+There are no URI-based alternatives for the Operation Object's `tags` field.
+This limitation is 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.
+
+Note that no aspect of implicit connection resolution changes how [URIs are resolved](#relative-references-in-api-description-uris), or restricts their possible targets.
+
+### Data Types
+
+Data types in the OAS are based on the types defined by the [JSON Schema Validation Specification Draft 2020-12](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#section-6.1.1):
+"null", "boolean", "object", "array", "number", "string", or "integer".
+Models are defined using the [Schema Object](#schema-object), which is a superset of the JSON Schema Specification Draft 2020-12.
+
+JSON Schema keywords and `format` values operate on JSON "instances" which may be one of the six JSON data types, "null", "boolean", "object", "array", "number", or "string", with certain keywords and formats only applying to a specific type. For example, the `pattern` keyword and the `date-time` format only apply to strings, and treat any instance of the other five types as _automatically valid._ This means JSON Schema keywords and formats do **NOT** implicitly require the expected type. Use the `type` keyword to explicitly constrain the type.
+
+Note that the `type` keyword allows `"integer"` as a value for convenience, but keyword and format applicability does not recognize integers as being of a distinct JSON type from other numbers because [[RFC8259|JSON]] itself does not make that distinction. Since there is no distinct JSON integer type, JSON Schema defines integers mathematically. This means that both `1` and `1.0` are [equivalent](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01#section-4.2.2), and are both considered to be integers.
+
+#### Data Type Format
+
+As defined by the [JSON Schema Validation specification](https://tools.ietf.org/html/draft-bhutton-json-schema-validation-01#section-7.3), data types can have an optional modifier keyword: `format`. As described in that specification, `format` is treated as a non-validating annotation by default; the ability to validate `format` varies across implementations.
+
+The OpenAPI Initiative also hosts a [Format Registry](https://spec.openapis.org/registry/format/) for formats defined by OAS users and other specifications. Support for any registered format is strictly OPTIONAL, and support for one registered format does not imply support for any others.
+
+Types that are not accompanied by a `format` keyword follow the type definition in the JSON Schema. Tools that do not recognize a specific `format` MAY default back to the `type` alone, as if the `format` is not specified.
+For the purpose of [JSON Schema validation](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#section-7.1), each format should specify the set of JSON data types for which it applies. In this registry, these types are shown in the "JSON Data Type" column.
+
+The formats defined by the OAS are:
+
+| `format` | JSON Data Type | Comments |
+| ---- | ---- | ---- |
+| `int32` | number | signed 32 bits |
+| `int64` | number | signed 64 bits (a.k.a long) |
+| `float` | number | |
+| `double` | number | |
+| `password` | string | A hint to obscure the value. |
+
+As noted under [Data Type](#data-types), both `type: number` and `type: integer` are considered to be numbers in the data model.
+
+#### Working with Binary Data
+
+The OAS can describe either _raw_ or _encoded_ binary data.
+
+* **raw binary** is used where unencoded binary data is allowed, such as when sending a binary payload as the entire HTTP message body, or as part of a `multipart/*` payload that allows binary parts
+* **encoded binary** is used where binary data is embedded in a text-only format such as `application/json` or `application/x-www-form-urlencoded` (either as a message body or in the URL query string).
+
+In the following table showing how to use Schema Object keywords for binary data, we use `image/png` as an example binary media type. Any binary media type, including `application/octet-stream`, is sufficient to indicate binary content.
+
+| Keyword | Raw | Encoded | Comments |
+| ---- | ---- | ---- | ---- |
+| `type` | _omit_ | `string` | raw binary is [outside of `type`](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01#section-4.2.3) |
+| `contentMediaType` | `image/png` | `image/png` | can sometimes be omitted if redundant (see below) |
+| `contentEncoding` | _omit_ | `base64` or `base64url` | other encodings are [allowed](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-01#section-8.3) |
+
+Note that the encoding indicated by `contentEncoding`, which inflates the size of data in order to represent it as 7-bit ASCII text, is unrelated to HTTP's `Content-Encoding` header, which indicates whether and how a message body has been compressed and is applied after all content serialization described in this section has occurred. Since HTTP allows unencoded binary message bodies, there is no standardized HTTP header for indicating base64 or similar encoding of an entire message body.
+
+Using a `contentEncoding` of `base64url` ensures that URL encoding (as required in the query string and in message bodies of type `application/x-www-form-urlencoded`) does not need to further encode any part of the already-encoded binary data.
+
+The `contentMediaType` keyword is redundant if the media type is already set:
+
+* as the key for a [MediaType Object](#media-type-object)
+* in the `contentType` field of an [Encoding Object](#encoding-object)
+
+If the [Schema Object](#schema-object) will be processed by a non-OAS-aware JSON Schema implementation, it may be useful to include `contentMediaType` even if it is redundant. However, if `contentMediaType` contradicts a relevant Media Type Object or Encoding Object, then `contentMediaType` SHALL be ignored.
+
+The `maxLength` keyword MAY be used to set an expected upper bound on the length of a streaming payload. The keyword can be applied to either string data, including encoded binary data, or to unencoded binary data. For unencoded binary, the length is the number of octets.
+
+##### Migrating binary descriptions from OAS 3.0
+
+The following table shows how to migrate from OAS 3.0 binary data descriptions, continuing to use `image/png` as the example binary media type:
+
+| OAS < 3.1 | OAS >= 3.1 | Comments |
+| ---- | ---- | ---- |
+| 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 |
+
+### 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.
+
+### 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_**.
+As noted under [Parsing Documents](#parsing-documents), this specification inherits JSON Schema Specification Draft 2020-12's requirements for [loading documents](https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01#section-9) and associating them with their expected URIs, which might not match their current location.
+This feature is used both for working in development or test environments without having to change the URIs, and for working within restrictive network configurations or security policies.
+
+Note that some URI fields are named `url` for historical reasons, but the descriptive text for those fields uses the correct "URI" terminology.
+
+Unless specified otherwise, all fields that are URIs MAY be relative references as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-4.2).
+
+Relative references in [Schema Objects](#schema-object), including any that appear as `$id` values, use the nearest parent `$id` as a Base URI, as described by [JSON Schema Specification Draft 2020-12](https://tools.ietf.org/html/draft-bhutton-json-schema-01#section-8.2).
+
+Relative URI references in other Objects, and in Schema Objects where no parent schema contains an `$id`, MUST be resolved using the referring document's base URI, which is determined in accordance with [[RFC3986]] [Section 5.1.2 – 5.1.4](https://tools.ietf.org/html/rfc3986#section-5.1.2).
+In practice, this is usually the retrieval URI of the document, which MAY be determined based on either its current actual location or a user-supplied expected location.
+
+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 references in CommonMark hyperlinks are resolved in their rendered context, which might differ from the context of the API description.
+
+### 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).
+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.
+
+### Schema
+
+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).
+
+##### Fixed Fields
+
+| 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. |
+| 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 `/`. |
+| 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).
+
+#### 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
+
+```json
+{
+ "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"
+}
+```
+
+```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
+
+```json
+{
+ "name": "API Support",
+ "url": "https://www.example.com/support",
+ "email": "support@example.com"
+}
+```
+
+```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
+
+```json
+{
+ "name": "Apache 2.0",
+ "identifier": "Apache-2.0"
+}
+```
+
+```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. 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).
+
+##### Server Object Example
+
+A single server would be described as:
+
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server",
+ "name": "dev"
+}
+```
+
+```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):
+
+```json
+{
+ "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"
+ }
+ ]
+}
+```
+
+```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:
+
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "name": "prod",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "A user-specific subdomain. Use `demo` for a free sandbox environment."
+ },
+ "port": {
+ "enum": ["8443", "443"],
+ "default": "8443"
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
+```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 UTF8 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`.
+
+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). |
+
+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
+
+```json
+"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"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```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 path is **appended** (no relative URL resolution) to the expanded URL from the [Server Object](#server-object)'s `url` field 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 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
+
+```json
+{
+ "/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"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```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. |
+| additionalOperations | Map[`string`, [Operation Object](#operation-object)] | A map of additional operations on this path. This map MUST NOT contain any entry matching (case-insensitive) any operation that can be defined on the parent path item object. |
+| 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. |
+| 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
+
+```json
+{
+ "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": {
+ "query": {
+ "description": "Returns pets based on ID",
+ "summary": "Find pets by ID",
+ "operationId": "queryPetsById",
+ "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"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+```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:
+ query:
+ description: Returns pets based on ID
+ summary: Find pets by ID
+ operationId: queryPetsById
+ 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
+
+```json
+{
+ "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"]
+ }
+ ]
+}
+```
+
+```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
+
+```json
+{
+ "description": "Find more info here",
+ "url": "https://example.com"
+}
+```
+
+```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 four 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`.
+* 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`.
+
+| Field Name | Type | Description |
+| ---- | :----: | ---- |
+| name | `string` | **REQUIRED**. The name of the parameter. Parameter names are _case sensitive_.
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.
+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.
+
+#### 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.
+
+Since all RFC1738-compliant URIs are compliant with RFC3986, applications needing to ensure historical interoperability SHOULD use RFC1738's rules.
+
+#### Interoperability with Web Browser Environments
+
+WHATWG is a [web browser-oriented](https://whatwg.org/faq#what-is-the-whatwg-working-on) standards group that has defined a "URL Living Standard" for parsing and serializing URLs in a browser context, including parsing and serializing `form-urlencoded` data.
+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`.
+
+### Decoding URIs and `form-urlencoded` Strings
+
+The percent-decoding algorithm does not care which characters were or were not percent-decoded, which means that URIs percent-encoded according to any specification will be decoded correctly.
+
+Similarly, all `form-urlencoded` decoding algorithms simply add `+`-for-space handling to the percent-decoding algorithm, and will work regardless of the encoding specification used.
+
+However, care must be taken to use `form-urlencoded` decoding if `+` represents a space, and to use regular percent-decoding if `+` represents itself as a literal value.
+
+### Percent-Encoding and Illegal or Reserved Delimiters
+
+The `[`, `]`, `|`, and space characters, which are used as delimiters for the `deepObject`, `pipeDelimited`, and `spaceDelimited` styles, respectively, all MUST be percent-encoded to comply with [[RFC3986]].
+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.
+
+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.
+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.
+The exact method of additional encoding/escaping is left to the API designer, and is expected to be performed before serialization and encoding described in this specification, and reversed after this specification's encoding and serialization steps are reversed.
+This keeps it outside of the processes governed by this specification.
+
+## Appendix F: Resolving Security Requirements in a Referenced Document
+
+This appendix 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. See [Resolving Implicit Connections](#resolving-implicit-connections) for more information.
+
+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). However, documented in that section, it is RECOMMENDED 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.
diff --git a/src/schemas/validation/README.md b/src/schemas/validation/README.md
new file mode 100644
index 0000000000..2fdeb6999e
--- /dev/null
+++ b/src/schemas/validation/README.md
@@ -0,0 +1,54 @@
+# 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.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/base/{date}`, source: `base.yaml` — The dialect metaschema that extends the standard `draft/2020-12` metaschema by adding the OAS "base" vocabulary
+* `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
+
+The name "base" for the dialect was intended to indicate that the OAS dialect could be further extended.
+
+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
new file mode 100644
index 0000000000..1986c9e8f8
--- /dev/null
+++ b/src/schemas/validation/dialect.yaml
@@ -0,0 +1,21 @@
+$id: https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS
+$schema: https://json-schema.org/draft/2020-12/schema
+
+title: OpenAPI 3.2 Schema Object Dialect
+description: A JSON Schema dialect describing schemas found in OpenAPI v3.2.x 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.2/vocab/base: false
+
+allOf:
+ - $ref: https://json-schema.org/draft/2020-12/schema
+ - $ref: https://spec.openapis.org/oas/3.2/meta/WORK-IN-PROGRESS
diff --git a/src/schemas/validation/meta.yaml b/src/schemas/validation/meta.yaml
new file mode 100644
index 0000000000..eb6a9af2dd
--- /dev/null
+++ b/src/schemas/validation/meta.yaml
@@ -0,0 +1,70 @@
+$id: https://spec.openapis.org/oas/3.2/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 JSON Schema Dialect
+
+$dynamicAnchor: meta
+
+$vocabulary:
+ https://spec.openapis.org/oas/3.2/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
new file mode 100644
index 0000000000..195ae5ed43
--- /dev/null
+++ b/src/schemas/validation/schema-base.yaml
@@ -0,0 +1,20 @@
+$id: 'https://spec.openapis.org/oas/3.2/schema-base/WORK-IN-PROGRESS'
+$schema: 'https://json-schema.org/draft/2020-12/schema'
+
+description: The description of OpenAPI v3.2.x Documents using the OpenAPI JSON Schema dialect
+
+$ref: 'https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS'
+properties:
+ jsonSchemaDialect:
+ $ref: '#/$defs/dialect'
+
+$defs:
+ dialect:
+ const: 'https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS'
+
+ schema:
+ $dynamicAnchor: meta
+ $ref: 'https://spec.openapis.org/oas/3.2/dialect/WORK-IN-PROGRESS'
+ properties:
+ $schema:
+ $ref: '#/$defs/dialect'
diff --git a/src/schemas/validation/schema.yaml b/src/schemas/validation/schema.yaml
new file mode 100644
index 0000000000..666e9314d6
--- /dev/null
+++ b/src/schemas/validation/schema.yaml
@@ -0,0 +1,1031 @@
+$id: 'https://spec.openapis.org/oas/3.2/schema/WORK-IN-PROGRESS'
+$schema: 'https://json-schema.org/draft/2020-12/schema'
+
+description: The description of OpenAPI v3.2.x Documents without Schema Object validation
+
+type: object
+properties:
+ openapi:
+ type: string
+ pattern: '^3\.2\.\d+(-.+)?$'
+ info:
+ $ref: '#/$defs/info'
+ jsonSchemaDialect:
+ type: string
+ format: uri
+ default: 'https://spec.openapis.org/oas/3.2/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.2#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.2#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.2#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.2#server-object
+ type: object
+ properties:
+ url:
+ type: string
+ description:
+ type: string
+ name:
+ 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.2#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.2#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.2#paths-object
+ type: object
+ patternProperties:
+ '^/':
+ $ref: '#/$defs/path-item'
+ $ref: '#/$defs/specification-extensions'
+ unevaluatedProperties: false
+
+ path-item:
+ $comment: https://spec.openapis.org/oas/v3.2#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'
+ additionalOperations:
+ type: object
+ additionalProperties:
+ $ref: '#/$defs/operation'
+ not:
+ required:
+ - 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'
+ 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.2#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.2#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.2#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.2#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.2#fixed-fields-10
+ type: object
+ additionalProperties:
+ $ref: '#/$defs/media-type'
+ propertyNames:
+ format: media-range
+
+ media-type:
+ $comment: https://spec.openapis.org/oas/v3.2#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.2#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.2#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.2#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'
+ $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.2#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.2#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.2#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
+ server:
+ $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.2#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.2#tag-object
+ type: object
+ properties:
+ name:
+ type: string
+ summary:
+ type: string
+ description:
+ type: string
+ externalDocs:
+ $ref: '#/$defs/external-documentation'
+ parent:
+ type: string
+ kind:
+ type: string
+ required:
+ - name
+ $ref: '#/$defs/specification-extensions'
+ unevaluatedProperties: false
+
+ reference:
+ $comment: https://spec.openapis.org/oas/v3.2#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.2#schema-object
+ $dynamicAnchor: meta
+ type:
+ - object
+ - boolean
+
+ security-scheme:
+ $comment: https://spec.openapis.org/oas/v3.2#security-scheme-object
+ type: object
+ properties:
+ type:
+ enum:
+ - apiKey
+ - http
+ - mutualTLS
+ - oauth2
+ - openIdConnect
+ description:
+ type: string
+ deprecated:
+ default: false
+ type: boolean
+ 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'
+ oauth2MetadataUrl:
+ type: string
+ format: uri-reference
+ 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'
+ deviceAuthorization:
+ $ref: '#/$defs/oauth-flows/$defs/device-authorization'
+ $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
+
+ device-authorization:
+ type: object
+ properties:
+ deviceAuthorizationUrl:
+ type: string
+ format: uri-reference
+ tokenUrl:
+ type: string
+ format: uri-reference
+ refreshUrl:
+ type: string
+ format: uri-reference
+ scopes:
+ $ref: '#/$defs/map-of-strings'
+ required:
+ - deviceAuthorizationUrl
+ - tokenUrl
+ - scopes
+ $ref: '#/$defs/specification-extensions'
+ unevaluatedProperties: false
+
+ security-requirement:
+ $comment: https://spec.openapis.org/oas/v3.2#security-requirement-object
+ type: object
+ additionalProperties:
+ type: array
+ items:
+ type: string
+
+ specification-extensions:
+ $comment: https://spec.openapis.org/oas/v3.2#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
new file mode 100644
index 0000000000..ae51ad083e
--- /dev/null
+++ b/tests/schema/fail/invalid_schema_types.yaml
@@ -0,0 +1,13 @@
+openapi: 3.2.0
+
+# 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
new file mode 100644
index 0000000000..3c38be021d
--- /dev/null
+++ b/tests/schema/fail/no_containers.yaml
@@ -0,0 +1,7 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..db4b970ced
--- /dev/null
+++ b/tests/schema/fail/server_enum_empty.yaml
@@ -0,0 +1,14 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..1b5e2d5fc8
--- /dev/null
+++ b/tests/schema/fail/servers.yaml
@@ -0,0 +1,11 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..c0a4b8bb7e
--- /dev/null
+++ b/tests/schema/fail/unknown_container.yaml
@@ -0,0 +1,8 @@
+openapi: 3.2.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/callback-object-examples.yaml b/tests/schema/pass/callback-object-examples.yaml
new file mode 100644
index 0000000000..7a7f86f070
--- /dev/null
+++ b/tests/schema/pass/callback-object-examples.yaml
@@ -0,0 +1,30 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+components:
+ callbacks:
+ myCallback:
+ '{$request.query.queryUrl}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+ transactionCallback:
+ 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
\ No newline at end of file
diff --git a/tests/schema/pass/comp_pathitems.yaml b/tests/schema/pass/comp_pathitems.yaml
new file mode 100644
index 0000000000..5178c1f56b
--- /dev/null
+++ b/tests/schema/pass/comp_pathitems.yaml
@@ -0,0 +1,6 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+components:
+ pathItems: {}
diff --git a/tests/schema/pass/components-object-example.yaml b/tests/schema/pass/components-object-example.yaml
new file mode 100644
index 0000000000..33a56e608f
--- /dev/null
+++ b/tests/schema/pass/components-object-example.yaml
@@ -0,0 +1,71 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+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
\ No newline at end of file
diff --git a/tests/schema/pass/example-object-examples.yaml b/tests/schema/pass/example-object-examples.yaml
new file mode 100644
index 0000000000..61d6b347ee
--- /dev/null
+++ b/tests/schema/pass/example-object-examples.yaml
@@ -0,0 +1,63 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+components:
+ requestBodies:
+ with-example:
+ content:
+ 'application/json':
+ schema:
+ $ref: '#/components/schemas/Address'
+ examples:
+ foo:
+ summary: A foo example
+ value:
+ foo: bar
+ bar:
+ summary: A bar example
+ value:
+ bar: baz
+ application/xml:
+ examples:
+ xmlExample:
+ summary: This is an example in XML
+ externalValue: https://example.org/examples/address-example.xml
+ text/plain:
+ examples:
+ textExample:
+ summary: This is a text example
+ externalValue: https://foo.bar/examples/address-example.txt
+ parameters:
+ with-example:
+ name: zipCode
+ in: query
+ schema:
+ type: string
+ format: zip-code
+ examples:
+ zip-example:
+ $ref: '#/components/examples/zip-example'
+ responses:
+ '200':
+ description: your car appointment has been booked
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SuccessResponse'
+ examples:
+ confirmation-success:
+ $ref: '#/components/examples/confirmation-success'
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ jsonValue:
+ type: string
+ encoding:
+ jsonValue:
+ contentType: application/json
+ examples:
+ jsonFormValue:
+ description: 'The JSON string "json" as a form value'
+ value: jsonValue=%22json%22
diff --git a/tests/schema/pass/header-object-examples.yaml b/tests/schema/pass/header-object-examples.yaml
new file mode 100644
index 0000000000..2a23a8ff82
--- /dev/null
+++ b/tests/schema/pass/header-object-examples.yaml
@@ -0,0 +1,25 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+components:
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ deprecated: false
+ schema:
+ type: integer
+ ETag:
+ required: true
+ content:
+ text/plain:
+ schema:
+ type: string
+ pattern: ^"
+ Reference:
+ $ref: '#/components/schemas/ETag'
+ Style:
+ schema:
+ type: array
+ style: simple
+ explode: true
\ No newline at end of file
diff --git a/tests/schema/pass/info-object-example.yaml b/tests/schema/pass/info-object-example.yaml
new file mode 100644
index 0000000000..2f1be1d6f5
--- /dev/null
+++ b/tests/schema/pass/info-object-example.yaml
@@ -0,0 +1,19 @@
+# including External Documentation Object Example
+openapi: 3.2.0
+info:
+ 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
+externalDocs:
+ description: Find more info here
+ url: https://example.com
+components: {}
diff --git a/tests/schema/pass/info_summary.yaml b/tests/schema/pass/info_summary.yaml
new file mode 100644
index 0000000000..6697751d56
--- /dev/null
+++ b/tests/schema/pass/info_summary.yaml
@@ -0,0 +1,6 @@
+openapi: 3.2.0
+info:
+ title: API
+ summary: My lovely API
+ version: 1.0.0
+components: {}
diff --git a/tests/schema/pass/license_identifier.yaml b/tests/schema/pass/license_identifier.yaml
new file mode 100644
index 0000000000..20d5e4368e
--- /dev/null
+++ b/tests/schema/pass/license_identifier.yaml
@@ -0,0 +1,9 @@
+openapi: 3.2.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/link-object-examples.yaml b/tests/schema/pass/link-object-examples.yaml
new file mode 100644
index 0000000000..12a1194bf5
--- /dev/null
+++ b/tests/schema/pass/link-object-examples.yaml
@@ -0,0 +1,62 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /users/{id}:
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ get:
+ responses:
+ '200':
+ description: the user being returned
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ uuid: # the unique user id
+ type: string
+ format: uuid
+ links:
+ address:
+ # the target link operationId
+ operationId: getUserAddress
+ parameters:
+ # get the `id` field from the request path parameter named `id`
+ userid: $request.path.id
+ address2:
+ operationId: getUserAddressByUUID
+ parameters:
+ # get the `uuid` field from the `uuid` field in the response body
+ userUuid: $response.body#/uuid
+ UserRepositories:
+ # returns array of '#/components/schemas/repository'
+ operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get'
+ parameters:
+ username: $response.body#/username
+ UserRepositories2:
+ # 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
+ # the path item of the linked operation
+ /users/{userid}/address:
+ parameters:
+ - name: userid
+ in: path
+ required: true
+ description: the user identifier, as userId
+ schema:
+ type: string
+ # linked operation
+ get:
+ operationId: getUserAddress
+ responses:
+ '200':
+ description: the user's address
\ No newline at end of file
diff --git a/tests/schema/pass/media-type-examples.yaml b/tests/schema/pass/media-type-examples.yaml
new file mode 100644
index 0000000000..dd71a42008
--- /dev/null
+++ b/tests/schema/pass/media-type-examples.yaml
@@ -0,0 +1,97 @@
+# including Encoding Object examples
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /something:
+ put:
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ examples:
+ cat:
+ summary: An example of a cat
+ value:
+ name: Fluffy
+ petType: Cat
+ color: White
+ gender: male
+ breed: Persian
+ dog:
+ summary: An example of a dog with a cat's name
+ value:
+ name: Puma
+ petType: Dog
+ color: Black
+ gender: Female
+ breed: Mixed
+ frog:
+ $ref: '#/components/examples/frog-example'
+ application/x-www-form-urlencoded:
+ schema:
+ type: object
+ properties:
+ id:
+ type: string
+ format: uuid
+ address:
+ # complex types are stringified to support RFC 1866
+ type: object
+ properties: {}
+ icon:
+ # The default with "contentEncoding" is application/octet-stream,
+ # so we need to set image media type(s) in the Encoding Object.
+ type: string
+ contentEncoding: base64url
+ encoding:
+ icon:
+ contentType: image/png, image/jpeg
+ multipart/form-data:
+ schema:
+ type: object
+ properties:
+ id:
+ # default is `text/plain`
+ type: string
+ format: uuid
+ 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
+ forCoverage:
+ type: string
+ forCoverage2:
+ type: string
+ 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:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ forCoverage:
+ style: form
+ explode: false
+ allowReserved: true
+ forCoverage2:
+ style: spaceDelimited
+ explode: true
\ No newline at end of file
diff --git a/tests/schema/pass/mega.yaml b/tests/schema/pass/mega.yaml
new file mode 100644
index 0000000000..a0179b64bd
--- /dev/null
+++ b/tests/schema/pass/mega.yaml
@@ -0,0 +1,49 @@
+openapi: 3.2.0
+info:
+ summary: My API's summary
+ 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/base
+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
new file mode 100644
index 0000000000..8f81f7e05e
--- /dev/null
+++ b/tests/schema/pass/minimal_comp.yaml
@@ -0,0 +1,5 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..0e44257ad0
--- /dev/null
+++ b/tests/schema/pass/minimal_hooks.yaml
@@ -0,0 +1,5 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..c332bba18c
--- /dev/null
+++ b/tests/schema/pass/minimal_paths.yaml
@@ -0,0 +1,5 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..45506616b4
--- /dev/null
+++ b/tests/schema/pass/non-oauth-scopes.yaml
@@ -0,0 +1,19 @@
+openapi: 3.2.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/operation-object-example.yaml b/tests/schema/pass/operation-object-example.yaml
new file mode 100644
index 0000000000..1e5bac29f1
--- /dev/null
+++ b/tests/schema/pass/operation-object-example.yaml
@@ -0,0 +1,47 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /pets/{id}:
+ put:
+ 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
\ No newline at end of file
diff --git a/tests/schema/pass/parameter-object-examples.yaml b/tests/schema/pass/parameter-object-examples.yaml
new file mode 100644
index 0000000000..ba8fbc4886
--- /dev/null
+++ b/tests/schema/pass/parameter-object-examples.yaml
@@ -0,0 +1,54 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /user/{username}:
+ parameters:
+ - name: token
+ in: header
+ description: token to be passed as a header
+ required: true
+ schema:
+ type: array
+ items:
+ type: integer
+ format: int64
+ style: simple
+ - name: username
+ in: path
+ description: username to fetch
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: query
+ description: ID of the object to fetch
+ required: false
+ schema:
+ type: array
+ items:
+ type: string
+ style: form
+ explode: true
+ - in: query
+ name: freeForm
+ schema:
+ type: object
+ additionalProperties:
+ type: integer
+ style: form
+ - in: query
+ name: coordinates
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - lat
+ - long
+ properties:
+ lat:
+ type: number
+ long:
+ type: number
\ No newline at end of file
diff --git a/tests/schema/pass/path-item-object-example.yaml b/tests/schema/pass/path-item-object-example.yaml
new file mode 100644
index 0000000000..234325e21a
--- /dev/null
+++ b/tests/schema/pass/path-item-object-example.yaml
@@ -0,0 +1,35 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /pets/{id}:
+ 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
\ No newline at end of file
diff --git a/tests/schema/pass/path_item_servers_parameters.yaml b/tests/schema/pass/path_item_servers_parameters.yaml
new file mode 100644
index 0000000000..7cedc5d16c
--- /dev/null
+++ b/tests/schema/pass/path_item_servers_parameters.yaml
@@ -0,0 +1,112 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /things:
+ summary: Lots of things
+ servers:
+ - url: https://things.example.com
+ get:
+ summary: Get a list of things
+ externalDocs:
+ description: Find more info here
+ url: https://example.com
+ parameters:
+ - $ref: '#/components/parameters/biscuit'
+ summary: The maximum number of things to return
+ description: The maximum number of things to return
+ responses:
+ default:
+ description: A list of things
+ servers:
+ - url: https://things.example.com
+ post:
+ deprecated: false
+ requestBody:
+ $ref: '#/components/requestBodies/ThingRequestBody'
+ responses:
+ '201':
+ $ref: '#/components/responses/ThingResponse'
+ callbacks:
+ myCallback:
+ '{$request.query.queryUrl}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+ transactionCallback:
+ $ref: '#/components/callbacks/transactionCallback'
+ patch: {}
+ delete: {}
+ head: {}
+ options: {}
+ trace: {}
+components:
+ callbacks:
+ transactionCallback:
+ 'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':
+ post:
+ requestBody:
+ description: Callback payload
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SomePayload'
+ responses:
+ '200':
+ description: callback successfully processed
+ examples:
+ ThingExample:
+ summary: A thing
+ description: A thing
+ value:
+ id: 1
+ name: Thing
+ links:
+ ThingLink:
+ description: A link to a thing
+ operationId: getThing
+ parameters:
+ thingId: '$response.body#/id'
+ server:
+ url: https://things.example.com
+ ThingyLink:
+ $ref: '#/components/links/ThingLink'
+ parameters:
+ limit:
+ name: limit
+ in: query
+ required: false
+ allowEmptyValue: false
+ allowReserved: false
+ deprecated: true
+ description: The maximum number of list items to return
+ schema:
+ type: integer
+ minimum: 0
+ biscuit:
+ name: biscuit
+ in: cookie
+ style: form
+ schema:
+ type: string
+ requestBodies:
+ ThingRequestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ responses:
+ ThingResponse:
+ description: A thing
+ content:
+ application/json:
+ schema:
+ type: object
diff --git a/tests/schema/pass/path_no_response.yaml b/tests/schema/pass/path_no_response.yaml
new file mode 100644
index 0000000000..e4876799c9
--- /dev/null
+++ b/tests/schema/pass/path_no_response.yaml
@@ -0,0 +1,7 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..e79b7cd4fe
--- /dev/null
+++ b/tests/schema/pass/path_var_empty_pathitem.yaml
@@ -0,0 +1,6 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /{var}: {}
diff --git a/tests/schema/pass/paths-object-example.yaml b/tests/schema/pass/paths-object-example.yaml
new file mode 100644
index 0000000000..2ee08e581e
--- /dev/null
+++ b/tests/schema/pass/paths-object-example.yaml
@@ -0,0 +1,17 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /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'
\ No newline at end of file
diff --git a/tests/schema/pass/request-body-examples.yaml b/tests/schema/pass/request-body-examples.yaml
new file mode 100644
index 0000000000..4da1d41bd4
--- /dev/null
+++ b/tests/schema/pass/request-body-examples.yaml
@@ -0,0 +1,34 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths:
+ /something:
+ put:
+ requestBody:
+ description: user to add to the system
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User example
+ externalValue: https://foo.bar/examples/user-example.json
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/User'
+ examples:
+ user:
+ summary: User example in XML
+ externalValue: https://foo.bar/examples/user-example.xml
+ text/plain:
+ examples:
+ user:
+ summary: User example in plain text
+ externalValue: https://foo.bar/examples/user-example.txt
+ '*/*':
+ examples:
+ user:
+ summary: User example in other format
+ externalValue: https://foo.bar/examples/user-example.whatever
\ No newline at end of file
diff --git a/tests/schema/pass/response-object-examples.yaml b/tests/schema/pass/response-object-examples.yaml
new file mode 100644
index 0000000000..8c3edd7d0c
--- /dev/null
+++ b/tests/schema/pass/response-object-examples.yaml
@@ -0,0 +1,42 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+components:
+ responses:
+ complex-object-array:
+ description: A complex object array response
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VeryComplexType'
+ simple-string:
+ description: A simple string response
+ content:
+ text/plain:
+ schema:
+ type: string
+ plain-text-with-headers:
+ description: A simple string response
+ content:
+ text/plain:
+ schema:
+ type: string
+ example: 'whoa!'
+ headers:
+ X-Rate-Limit-Limit:
+ description: The number of allowed requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Remaining:
+ description: The number of remaining requests in the current period
+ schema:
+ type: integer
+ X-Rate-Limit-Reset:
+ description: The number of seconds left in the current period
+ schema:
+ type: integer
+ no-return-value:
+ description: object created
\ No newline at end of file
diff --git a/tests/schema/pass/schema.yaml b/tests/schema/pass/schema.yaml
new file mode 100644
index 0000000000..a6d72b9972
--- /dev/null
+++ b/tests/schema/pass/schema.yaml
@@ -0,0 +1,55 @@
+openapi: 3.2.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/security-scheme-object-examples.yaml b/tests/schema/pass/security-scheme-object-examples.yaml
new file mode 100644
index 0000000000..d3472d5a32
--- /dev/null
+++ b/tests/schema/pass/security-scheme-object-examples.yaml
@@ -0,0 +1,69 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+security:
+ - basic: []
+ - apiKey: []
+ - JWT-bearer: []
+ - mutualTLS: []
+ - OAuth2:
+ - write:pets
+ - read:pets
+components:
+ securitySchemes:
+ basic:
+ type: http
+ scheme: basic
+ apiKey:
+ type: apiKey
+ name: api-key
+ in: header
+ JWT-bearer:
+ type: http
+ scheme: bearer
+ bearerFormat: JWT
+ mutualTLS:
+ type: mutualTLS
+ description: Cert must be signed by example.com CA
+ OAuth2:
+ type: oauth2
+ oauth2MetadataUrl: https://example.com/api/oauth/metadata
+ flows:
+ authorizationCode:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ refreshUrl: https://example.com/api/oauth/refresh
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ password:
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ read:pets: read your pets
+ refreshUrl: https://example.com/api/oauth/refresh
+ clientCredentials:
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ read:pets: read your pets
+ refreshUrl: https://example.com/api/oauth/refresh
+ deviceAuthorization:
+ deviceAuthorizationUrl: https://example.com/api/oauth/device
+ tokenUrl: https://example.com/api/oauth/token
+ scopes:
+ read:pets: read your pets
+ refreshUrl: https://example.com/api/oauth/refresh
+ OAuth2Old:
+ deprecated: true
+ type: oauth2
+ flows:
+ implicit:
+ authorizationUrl: https://example.com/api/oauth/dialog
+ scopes:
+ read:pets: read your pets
+ refreshUrl: https://example.com/api/oauth/refresh
+ OpenIdConnect:
+ type: openIdConnect
+ openIdConnectUrl: https://example.com/api/oauth/openid
+ external:
+ $ref: 'https://example.com/api/openapi.json#/components/externalDocs/ThingExternalDocs'
\ No newline at end of file
diff --git a/tests/schema/pass/servers.yaml b/tests/schema/pass/servers.yaml
new file mode 100644
index 0000000000..07992113bf
--- /dev/null
+++ b/tests/schema/pass/servers.yaml
@@ -0,0 +1,26 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths: {}
+servers:
+ - url: /v1
+ description: Run locally.
+ name: local
+ - url: https://production.com/v1
+ description: Run on production server.
+ - url: https://{username}.gigantic-server.com:{port}/{basePath}
+ description: The production API server
+ 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
\ No newline at end of file
diff --git a/tests/schema/pass/tag-object-example.yaml b/tests/schema/pass/tag-object-example.yaml
new file mode 100644
index 0000000000..6e740c8df0
--- /dev/null
+++ b/tests/schema/pass/tag-object-example.yaml
@@ -0,0 +1,25 @@
+openapi: 3.2.0
+info:
+ title: API
+ version: 1.0.0
+paths: {}
+tags:
+
+ - name: account-updates
+ summary: Account Updates
+ description: Account update operations
+ kind: nav
+
+ - name: partner
+ summary: Partner
+ description: Operations available to the partners network
+ parent: external
+ kind: audience
+
+ - name: external
+ summary: External
+ description: Operations available to external consumers
+ kind: audience
+ externalDocs:
+ description: Find more info here
+ url: https://example.com
diff --git a/tests/schema/pass/valid_schema_types.yaml b/tests/schema/pass/valid_schema_types.yaml
new file mode 100644
index 0000000000..43e7cdc782
--- /dev/null
+++ b/tests/schema/pass/valid_schema_types.yaml
@@ -0,0 +1,14 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..c0b505ac63
--- /dev/null
+++ b/tests/schema/pass/webhook-example.yaml
@@ -0,0 +1,35 @@
+openapi: 3.2.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
new file mode 100644
index 0000000000..362ccc856c
--- /dev/null
+++ b/tests/schema/schema.test.mjs
@@ -0,0 +1,56 @@
+import { readdirSync, readFileSync } from "node:fs";
+import YAML from "yaml";
+import { validate, setMetaSchemaOutputFormat } from "@hyperjump/json-schema/openapi-3-1";
+import { BASIC } from "@hyperjump/json-schema/experimental";
+import { describe, test, expect } from "vitest";
+
+import contentTypeParser from "content-type";
+import { addMediaTypePlugin } from "@hyperjump/browser";
+import { buildSchemaDocument } from "@hyperjump/json-schema/experimental";
+
+addMediaTypePlugin("application/schema+yaml", {
+ parse: async (response) => {
+ const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? "");
+ const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile;
+
+ const foo = YAML.parse(await response.text());
+ return buildSchemaDocument(foo, response.url, contextDialectId);
+ },
+ fileMatcher: (path) => path.endsWith(".yaml")
+ });
+
+const parseYamlFromFile = (filePath) => {
+ const schemaYaml = readFileSync(filePath, "utf8");
+ return YAML.parse(schemaYaml, { prettyErrors: true });
+};
+
+setMetaSchemaOutputFormat(BASIC);
+
+const validateOpenApi = await validate("./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, () => {
+ const instance = parseYamlFromFile(`${fixtures}/pass/${entry.name}`);
+ const output = validateOpenApi(instance, BASIC);
+ expect(output).to.deep.equal({ valid: true });
+ });
+ });
+ });
+
+ describe("Fail", () => {
+ readdirSync(`${fixtures}/fail`, { withFileTypes: true })
+ .filter((entry) => entry.isFile() && /\.yaml$/.test(entry.name))
+ .forEach((entry) => {
+ test(entry.name, () => {
+ const instance = parseYamlFromFile(`${fixtures}/fail/${entry.name}`);
+ const output = validateOpenApi(instance, BASIC);
+ expect(output.valid).to.equal(false);
+ });
+ });
+ });
+});