Open jeremyfiel opened 2 weeks ago
Latest commit: 498f6b78d8c7e0ab42b4074c52406a11405ea0de
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
ok, i think i'm done with this. missed a few keywords for Oas3_1 schemas.
ready for review. thanks
I added a few extra JSON Schema 2020-12 keywords that were missed
fixes #1547
What/Why/How?
The typings for OAS 3 and OAS 3_1 schemas were incorrectly defined per the OpenAPI Specification.
OAS 3.0 has a specific requirement which defines an OpenAPI Schema rather than a JSON Schema schema. There are subtleties to the OpenAPI 3.0 Schema.
OpenAPI 3.1 Schemas are equivalent to a JSON Schema 2020-12 schema.
Reference
Per the OpenAPI 3.0 Specification
4.7.24.1 JSON Schema Keywords The following keywords are taken directly from the JSON Schema definition and follow the same specifications:
The following keywords are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
Alternatively, any time a Schema Object can be used, a Reference Object can be used in its place. This allows referencing definitions instead of defining them inline.
Additional keywords defined by the JSON Schema specification that are not mentioned here are strictly unsupported.
Other than the JSON Schema subset fields, the following fields MAY be used for further schema documentation:
Per the OpenAPI 3.1 Specification
4.8.24 Schema Object The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.
For more information about the keywords, see JSON Schema Core and JSON Schema Validation.
Unless stated otherwise, the keyword definitions follow those of JSON Schema and do not add any additional semantics; this includes keywords such as $schema, $id, $ref, and $dynamicRef being URIs rather than URLs. Where JSON Schema indicates that behavior is defined by the application (e.g. for annotations), OAS also defers the definition of semantics to the application consuming the OpenAPI document.
Testing
Screenshots (optional)
Check yourself
Security