Skip to content

Commit fc9f89a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into publish-schemas
2 parents cafb8b8 + cc25d27 commit fc9f89a

21 files changed

+9163
-3276
lines changed

.github/workflows/schema-tests.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: schema-test
55

66
#
77
# This workflow runs the npm test script to validate passing and failing
8-
# testcases for the metaschema.
8+
# testcases for the metaschemas
99
#
1010

1111
# run this on push to any branch and creation of pull-requests
@@ -23,13 +23,15 @@ jobs:
2323
- uses: actions/checkout@v4 # checkout repo content
2424
with:
2525
fetch-depth: 0
26+
2627
- uses: actions/setup-node@v4 # setup Node.js
2728
with:
2829
node-version: '20.x'
30+
2931
- name: Install dependencies from main
3032
run: |
3133
git checkout remotes/origin/main -- package.json package-lock.json
3234
npm ci
35+
3336
- name: Run tests
3437
run: npm run test
35-

.github/workflows/validate-markdown.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ jobs:
2323
fetch-depth: 0
2424
- name: use the javascript environment from main
2525
run: |
26-
git checkout remotes/origin/main -- package.json package-lock.json
26+
git checkout remotes/origin/main -- package.json package-lock.json .markdownlint.yaml
2727
- uses: actions/setup-node@v4 # setup Node.js
2828
with:
2929
node-version: '20.x'
3030
- name: Validate markdown
3131
run: npx --yes mdv versions/3.*.md
32-
32+
- name: Lint markdown v3.0.4
33+
run: npx --yes markdownlint-cli --config .markdownlint.yaml versions/3.0.4.md
34+
- name: Lint markdown v3.1.1
35+
run: npx --yes markdownlint-cli --config .markdownlint.yaml versions/3.1.1.md

schemas/v3.0/README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1-
OpenAPI 3.0.X JSON Schema
2-
---
1+
# OpenAPI 3.0.X JSON Schema
32

4-
Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.X.
3+
This directory contains the YAML source for generating the JSON Schema for validating OpenAPI definitions of versions 3.0.X, which is published on [https://spec.openapis.org](https://spec.openapis.org).
54

6-
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.
5+
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`.
76

8-
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.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019.
7+
The source in this directory, which has `WORK-IN-PROGRESS` in its `id`, is _not intended for direct use_.
98

10-
To submit improvements to the schema, modify the schema.yaml file only.
9+
## Schema `id` dates
10+
11+
The published schemas on the spec site have an _iteration date_ in their `id`s.
12+
This allows the schemas for a release line (in this case 3.0) to be updated independent of the spec patch release cycle.
13+
14+
The iteration version of the JSON Schema can be found in the `id` field.
15+
For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019.
16+
17+
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.
18+
19+
## Improving the schema
20+
21+
As a reminder, the JSON Schema is not the source of truth for the Specification.
22+
In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins.
23+
Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance.
24+
25+
The schema only validates the mandatory aspects of the OAS.
26+
Validating requirements that are optional, or field usage that has undefined or ignored behavior are not within the scope of this schema.
27+
Schemas to perform additional optional validation are [under consideration](https://github.com/OAI/OpenAPI-Specification/issues/4141).
28+
29+
Improvements can be submitted by opening a PR against the `main` branch.
30+
31+
Modify the `schema.yaml` file and add test cases for your changes.
1132

1233
The TSC will then:
1334
- Run tests on the updated schema
1435
- Update the iteration version
15-
- Convert the schema.yaml to schema.json
1636
- Publish the new version
37+
38+
The [test suite](../../tests/v3.0) is part of this package.
39+
40+
```bash
41+
npm install
42+
npm test
43+
```

0 commit comments

Comments
 (0)