Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
a401932
Restored src/* and tests/*
github-actions[bot] Oct 11, 2025
6a655d6
Merge pull request #5031 from OAI/dev-sync-with-main
ralfhandl Oct 15, 2025
897f04c
Merge main into dev-sync-with-main
github-actions[bot] Oct 19, 2025
1c442ea
Merge main into dev-sync-with-main
github-actions[bot] Oct 19, 2025
ad5e775
Merge main into dev-sync-with-main
github-actions[bot] Oct 19, 2025
08d88ed
Merge main into dev-sync-with-main
github-actions[bot] Oct 23, 2025
d065ae6
Merge main into dev-sync-with-main
github-actions[bot] Oct 23, 2025
5eaf3bf
Merge main into dev-sync-with-main
github-actions[bot] Oct 23, 2025
1970d7c
Merge main into dev-sync-with-main
github-actions[bot] Oct 23, 2025
64efc80
Merge main into dev-sync-with-main
github-actions[bot] Oct 24, 2025
2067792
Merge main into dev-sync-with-main
github-actions[bot] Oct 26, 2025
f4948e0
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
13daff3
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
3c426c0
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
34448dd
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
80ad612
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
a8dcceb
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
9976706
Merge main into dev-sync-with-main
github-actions[bot] Oct 27, 2025
36552bd
Merge pull request #5047 from OAI/dev-sync-with-main
ralfhandl Oct 27, 2025
f7c74a9
Merge main into dev-sync-with-main
github-actions[bot] Oct 29, 2025
1f0aa5b
Merge main into dev-sync-with-main
github-actions[bot] Oct 29, 2025
bf9acd9
Merge main into dev-sync-with-main
github-actions[bot] Oct 29, 2025
4625982
Merge pull request #5081 from OAI/dev-sync-with-main
ralfhandl Oct 29, 2025
29115e3
Merge main into dev-sync-with-main
github-actions[bot] Oct 30, 2025
ead3952
Merge main into dev-sync-with-main
github-actions[bot] Oct 30, 2025
3f63831
Merge main into dev-sync-with-main
github-actions[bot] Oct 30, 2025
105aad6
Merge main into dev-sync-with-main
github-actions[bot] Oct 30, 2025
2483d85
Merge main into dev-sync-with-main
github-actions[bot] Oct 30, 2025
29ec519
Merge main into dev-sync-with-main
github-actions[bot] Oct 30, 2025
2c5110d
Merge pull request #5087 from OAI/dev-sync-with-main
ralfhandl Oct 30, 2025
ccfb0d9
Merge main into dev-sync-with-main
github-actions[bot] Nov 3, 2025
ecd9f7d
Merge main into dev-sync-with-main
github-actions[bot] Nov 3, 2025
f6ea580
Merge pull request #5099 from OAI/dev-sync-with-main
ralfhandl Nov 3, 2025
995fe75
Merge main into dev-sync-with-main
github-actions[bot] Nov 3, 2025
b835885
Merge main into dev-sync-with-main
github-actions[bot] Nov 5, 2025
86457eb
Merge main into dev-sync-with-main
github-actions[bot] Nov 6, 2025
00b7dec
Merge pull request #5104 from OAI/dev-sync-with-main
ralfhandl Nov 6, 2025
6b5d102
Merge main into dev-sync-with-main
github-actions[bot] Nov 13, 2025
ee47406
Merge main into dev-sync-with-main
github-actions[bot] Nov 13, 2025
df397f9
Merge main into dev-sync-with-main
github-actions[bot] Nov 16, 2025
3080a9c
Merge pull request #5118 from OAI/dev-sync-with-main
ralfhandl Nov 17, 2025
5692267
Merge main into dev-sync-with-main
github-actions[bot] Nov 18, 2025
013132d
Merge main into dev-sync-with-main
github-actions[bot] Nov 21, 2025
2a267f1
Merge main into dev-sync-with-main
github-actions[bot] Nov 21, 2025
cc76cd1
Merge main into dev-sync-with-main
github-actions[bot] Nov 24, 2025
6703158
Merge main into dev-sync-with-main
github-actions[bot] Nov 24, 2025
7849f1a
Merge pull request #5127 from OAI/dev-sync-with-main
ralfhandl Nov 24, 2025
d63da86
Merge main into dev-sync-with-main
github-actions[bot] Nov 25, 2025
99e254e
Merge main into dev-sync-with-main
github-actions[bot] Nov 26, 2025
03b9421
Merge main into dev-sync-with-main
github-actions[bot] Dec 3, 2025
6f4c3cb
Merge main into dev-sync-with-main
github-actions[bot] Dec 11, 2025
81569f4
Merge main into dev-sync-with-main
github-actions[bot] Dec 11, 2025
281bfe5
Merge main into dev-sync-with-main
github-actions[bot] Dec 11, 2025
5d3cc49
Merge main into dev-sync-with-main
github-actions[bot] Dec 11, 2025
b19c795
Merge pull request #5143 from OAI/dev-sync-with-main
ralfhandl Dec 11, 2025
44a17fa
Merge main into dev-sync-with-main
github-actions[bot] Dec 22, 2025
c3738ac
Merge main into dev-sync-with-main
github-actions[bot] Jan 14, 2026
f39f7f0
Merge pull request #5168 from OAI/dev-sync-with-main
handrews Jan 22, 2026
23016b3
Merge main into dev-sync-with-main
github-actions[bot] Jan 29, 2026
fe62063
Merge main into dev-sync-with-main
github-actions[bot] Jan 30, 2026
41cac7b
Merge main into dev-sync-with-main
github-actions[bot] Feb 27, 2026
939f402
Merge main into dev-sync-with-main
github-actions[bot] Feb 27, 2026
aae4eab
Merge main into dev-sync-with-main
github-actions[bot] Feb 27, 2026
03ed04f
Merge main into dev-sync-with-main
github-actions[bot] Feb 27, 2026
1ab26a7
Merge main into dev-sync-with-main
github-actions[bot] Mar 10, 2026
92e8ec5
Merge pull request #5192 from OAI/dev-sync-with-main
ralfhandl Mar 10, 2026
6998caa
Merge main into dev-sync-with-main
github-actions[bot] Mar 10, 2026
1e20be6
Merge pull request #5240 from OAI/dev-sync-with-main
ralfhandl Mar 10, 2026
4c77f58
Merge main into dev-sync-with-main
github-actions[bot] Mar 12, 2026
bc695fb
Merge pull request #5245 from OAI/dev-sync-with-main
ralfhandl Mar 12, 2026
8a7215b
Merge main into dev-sync-with-main
github-actions[bot] Mar 13, 2026
2ae26ad
Merge main into dev-sync-with-main
github-actions[bot] Mar 24, 2026
f9ddf10
Merge main into dev-sync-with-main
github-actions[bot] Mar 24, 2026
ac81cc9
Merge main into dev-sync-with-main
github-actions[bot] Mar 24, 2026
55d52c8
Merge main into dev-sync-with-main
github-actions[bot] Apr 16, 2026
c5c76b2
Merge main into dev-sync-with-main
github-actions[bot] Apr 20, 2026
3189038
Merge main into dev-sync-with-main
github-actions[bot] Apr 27, 2026
d86cd3c
Merge main into dev-sync-with-main
github-actions[bot] Apr 27, 2026
75c6027
Merge main into dev-sync-with-main
github-actions[bot] May 5, 2026
e29f12e
Merge main into dev-sync-with-main
github-actions[bot] May 5, 2026
35d6a29
Merge main into dev-sync-with-main
github-actions[bot] May 5, 2026
6f77dd9
Merge pull request #5250 from OAI/dev-sync-with-main
miqui May 7, 2026
6ab4465
Merge main into dev-sync-with-main
github-actions[bot] May 12, 2026
25cca5b
Merge main into dev-sync-with-main
github-actions[bot] May 12, 2026
5cf3b12
Merge pull request #5326 from OAI/dev-sync-with-main
ralfhandl May 12, 2026
09ead60
Merge main into dev-sync-with-main
github-actions[bot] May 19, 2026
edb33af
Merge pull request #5342 from OAI/dev-sync-with-main
ralfhandl May 20, 2026
3a33bbf
Merge main into dev-sync-with-main
github-actions[bot] May 20, 2026
4f3ddeb
Merge main into dev-sync-with-main
github-actions[bot] Jun 3, 2026
b8664bd
Merge pull request #5347 from OAI/dev-sync-with-main
miqui Jun 3, 2026
0f91b8b
Merge main into dev-sync-with-main
github-actions[bot] Jun 5, 2026
86d8d4b
Merge main into dev-sync-with-main
github-actions[bot] Jun 5, 2026
7b4acea
Merge main into dev-sync-with-main
github-actions[bot] Jun 5, 2026
9e83410
Merge main into dev-sync-with-main
github-actions[bot] Jun 5, 2026
1065c90
Merge main into dev-sync-with-main
github-actions[bot] Jun 7, 2026
2a8788d
Merge main into dev-sync-with-main
github-actions[bot] Jun 8, 2026
ffd4153
Merge pull request #5363 from OAI/dev-sync-with-main
ralfhandl Jun 8, 2026
89f7956
Merge main into dev-sync-with-main
github-actions[bot] Jun 9, 2026
18fe474
Merge pull request #5374 from OAI/dev-sync-with-main
ralfhandl Jun 9, 2026
4603a2c
Merge main into dev-sync-with-main
github-actions[bot] Jun 10, 2026
a7a32f9
Merge main into dev-sync-with-main
github-actions[bot] Jun 10, 2026
9ea4f7b
Merge pull request #5380 from OAI/dev-sync-with-main
ralfhandl Jun 10, 2026
2137551
Merge main into dev-sync-with-main
github-actions[bot] Jun 15, 2026
ef17168
Merge pull request #5394 from OAI/dev-sync-with-main
miqui Jun 18, 2026
6bade1c
Merge main into dev-sync-with-main
github-actions[bot] Jun 24, 2026
7084ba4
Merge main into dev-sync-with-main
github-actions[bot] Jul 2, 2026
74965ed
Merge main into dev-sync-with-main
github-actions[bot] Jul 2, 2026
764f4bd
Merge pull request #5402 from OAI/dev-sync-with-main
miqui Jul 2, 2026
9a7cdc9
Merge main into dev-sync-with-main
github-actions[bot] Jul 9, 2026
d5b3654
Merge pull request #5430 from OAI/dev-sync-with-main
miqui Jul 10, 2026
bb68296
Merge main into dev-sync-with-main
github-actions[bot] Jul 14, 2026
fd82831
Merge main into dev-sync-with-main
github-actions[bot] Jul 30, 2026
c2f9d6c
Merge pull request #5436 from OAI/dev-sync-with-main
miqui Jul 30, 2026
207a929
Merge main into dev-sync-with-main
github-actions[bot] Aug 8, 2026
dd99b35
Merge pull request #5472 from OAI/dev-sync-with-main
handrews Aug 8, 2026
ad83c51
Merge main into dev-sync-with-main
github-actions[bot] Aug 8, 2026
e429b7f
Merge pull request #5477 from OAI/dev-sync-with-main
handrews Aug 9, 2026
808b826
Merge main into dev-sync-with-main
github-actions[bot] Aug 13, 2026
47c31cb
Restored src/ and tests/schema/
github-actions[bot] Aug 13, 2026
42d680f
Merge main into dev-sync-with-main
github-actions[bot] Aug 13, 2026
2c428e6
Merge pull request #5484 from OAI/dev-sync-with-main
lornajane Aug 13, 2026
a9e5454
Merge main into dev-sync-with-main
github-actions[bot] Aug 13, 2026
0dc7c2d
Merge main into dev-sync-with-main
github-actions[bot] Aug 13, 2026
dbb9f27
Merge pull request #5493 from OAI/dev-sync-with-main
handrews Aug 13, 2026
ebdc5d4
Use build-infra schema test helpers
handrews Aug 13, 2026
1db493c
Merge pull request #5499 from handrews/fix/schema-test-build-infra
lornajane Aug 20, 2026
ba1a4f4
Merge main into dev-sync-with-main
handrews Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,626 changes: 4,626 additions & 0 deletions src/oas.md

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions src/schemas/validation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# OpenAPI 3.X.Y JSON Schema

This directory contains the YAML sources for generating the JSON Schemas for validating OpenAPI definitions of versions 3.X.Y, which are published on [https://spec.openapis.org](https://spec.openapis.org).

Due to limitations of GitHub pages, the schemas on the spec site are served with `Content-Type: application/octet-stream`, but should be interpreted as `application/schema+json`.

The sources in this directory, which have `WORK-IN-PROGRESS` in their `$id`s, are _not intended for direct use_.

## Schema `$id` dates

The published schemas on the spec site have an _iteration date_ in their `id`s.
This allows the schemas for a release line to be updated independent of the spec patch release cycle.

The iteration version of the JSON Schema can be found in the `$id` field.
For example, the value of `$id: https://spec.openapis.org/oas/3.1/schema/2021-03-02` means this iteration was created on March 2nd, 2021.

We are [working on](https://github.com/OAI/OpenAPI-Specification/issues/4152) how to best provide programmatic access for determining the latest date for each schema.

## Choosing which schema to use

There are two schemas to choose from for versions 3.1 and greater, both of which have an `$id` that starts with `https://spec.openapis.org/oas/3.X/` and ends with the iteration date:

* `https://spec.openapis.org/oas/3.X/schema/{date}`, source: `schema.yaml` — A self-contained schema that _does not_ validate Schema Objects beyond `type: [object, boolean]`
* `https://spec.openapis.org/oas/3.1/schema-base/{date}`, source: `schema-base.yaml` — A schema that combines the self-contained schema and the "base" dialect schema to validate Schema Objects with the dialect; this schema does not allow changing `$schema` or `jsonSchemaDialect` to other dialects

Two metaschemas define the OAS "base" dialect:

* `https://spec.openapis.org/oas/3.X/meta/{date}`, source: `meta.yaml` — The vocabulary metaschema for OAS 3.X's extensions to draft 2020-12
* `https://spec.openapis.org/oas/3.X/dialect/{date}`, source: `dialect.yaml` — The dialect metaschema that extends the standard `draft/2020-12` metaschema by adding the OAS "base" vocabulary

The name "base" for the dialect was intended to indicate that the OAS dialect could be further extended.

~~~mermaid
flowchart LR
schema_base
schema
dialect
meta
schema --> |default| dialect
schema_base --> |$ref| schema
schema_base --> |$ref| dialect
dialect --> |$ref| meta
~~~

An additional schema that validates the Schema Object with the OAS 3.X dialect but does not restrict changing `$schema` is [under consideration](https://github.com/OAI/OpenAPI-Specification/issues/4147).

## Improving the schemas

As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance.

The schema only validates the mandatory aspects of the OAS.
Validating requirements that are optional, or field usage that has undefined or ignored behavior are not within the scope of this schema.
Schemas to perform additional optional validation are [under consideration](https://github.com/OAI/OpenAPI-Specification/issues/4141).

Improvements can be submitted by opening a PR against the `vX.Y-dev` branch of the respective specification version.

Modify the `schema.yaml` file and add test cases for your changes.

The TSC will then:
- Run tests on the updated schema
- Update the iteration version
- Publish the new version

The [test suite](../../../tests/schema) is part of this package.

```bash
npm install
npm test
```
21 changes: 21 additions & 0 deletions src/schemas/validation/dialect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$id: https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS
$schema: https://json-schema.org/draft/2020-12/schema

title: OpenAPI 3.1 Schema Object Dialect
description: A JSON Schema dialect describing schemas found in OpenAPI v3.1 Descriptions

$dynamicAnchor: meta

$vocabulary:
https://json-schema.org/draft/2020-12/vocab/applicator: true
https://json-schema.org/draft/2020-12/vocab/content: true
https://json-schema.org/draft/2020-12/vocab/core: true
https://json-schema.org/draft/2020-12/vocab/format-annotation: true
https://json-schema.org/draft/2020-12/vocab/meta-data: true
https://json-schema.org/draft/2020-12/vocab/unevaluated: true
https://json-schema.org/draft/2020-12/vocab/validation: true
https://spec.openapis.org/oas/3.1/vocab/base: false

allOf:
- $ref: https://json-schema.org/draft/2020-12/schema
- $ref: https://spec.openapis.org/oas/3.1/meta/WORK-IN-PROGRESS
70 changes: 70 additions & 0 deletions src/schemas/validation/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
$id: https://spec.openapis.org/oas/3.1/meta/WORK-IN-PROGRESS
$schema: https://json-schema.org/draft/2020-12/schema

title: OAS Base Vocabulary
description: A JSON Schema Vocabulary used in the OpenAPI Schema Dialect

$dynamicAnchor: meta

$vocabulary:
https://spec.openapis.org/oas/3.1/vocab/base: true

type:
- object
- boolean
properties:
discriminator:
$ref: '#/$defs/discriminator'
example: true
externalDocs:
$ref: '#/$defs/external-docs'
xml:
$ref: '#/$defs/xml'

$defs:
discriminator:
$ref: '#/$defs/extensible'
properties:
mapping:
additionalProperties:
type: string
type: object
propertyName:
type: string
required:
- propertyName
type: object
unevaluatedProperties: false

extensible:
patternProperties:
^x-: true
external-docs:
$ref: '#/$defs/extensible'
properties:
description:
type: string
url:
format: uri-reference
type: string
required:
- url
type: object
unevaluatedProperties: false

xml:
$ref: '#/$defs/extensible'
properties:
attribute:
type: boolean
name:
type: string
namespace:
format: uri
type: string
prefix:
type: string
wrapped:
type: boolean
type: object
unevaluatedProperties: false
20 changes: 20 additions & 0 deletions src/schemas/validation/schema-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$id: 'https://spec.openapis.org/oas/3.1/schema-base/WORK-IN-PROGRESS'
$schema: 'https://json-schema.org/draft/2020-12/schema'

description: The description of OpenAPI v3.1.x Documents using the OpenAPI JSON Schema dialect

$ref: 'https://spec.openapis.org/oas/3.1/schema/WORK-IN-PROGRESS'
properties:
jsonSchemaDialect:
$ref: '#/$defs/dialect'

$defs:
dialect:
const: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'

schema:
$dynamicAnchor: meta
$ref: 'https://spec.openapis.org/oas/3.1/dialect/WORK-IN-PROGRESS'
properties:
$schema:
$ref: '#/$defs/dialect'
Loading
Loading