|
1 | 1 | # OpenAPI 3.1.X JSON Schema |
2 | 2 |
|
3 | | -Here you can find the JSON Schema for validating OpenAPI definitions of versions |
4 | | -3.1.X. |
| 3 | +Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.1.x. |
5 | 4 |
|
6 | 5 | As a reminder, the JSON Schema is not the source of truth for the Specification. |
7 | 6 | In cases of conflicts between the Specification itself and the JSON Schema, the |
8 | 7 | Specification wins. Also, some Specification constraints cannot be represented |
9 | 8 | with the JSON Schema so it's highly recommended to employ other methods to |
10 | 9 | ensure compliance. |
11 | 10 |
|
12 | | -The iteration version of the JSON Schema can be found in the `$id` field. For |
13 | | -example, the value of `$id: https://spec.openapis.org/oas/3.1/schema/2021-03-02` |
14 | | -means this iteration was created on March 2nd, 2021. |
| 11 | +The iteration version of the JSON Schema can be found in the `$id` field. |
| 12 | +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. |
15 | 13 |
|
16 | 14 | The `schema.yaml` schema doesn't validate the JSON Schemas in your OpenAPI |
17 | 15 | document because 3.1 allows you to use any JSON Schema dialect you choose. We |
18 | 16 | have also included `schema-base.yaml` that extends the main schema to validate |
19 | 17 | that all schemas use the default OAS base vocabulary. |
20 | 18 |
|
21 | 19 | ## Contributing |
22 | | -To submit improvements to the schema, modify the schema.yaml file only. |
| 20 | + |
| 21 | +To submit improvements to the schema, modify the `schema.yaml` file only. |
23 | 22 |
|
24 | 23 | The TSC will then: |
25 | 24 | - Run tests on the updated schema |
26 | 25 | - Update the iteration version |
27 | | -- Convert the schema.yaml to schema.json |
| 26 | +- Convert the `schema.yaml` to `schema.json` |
28 | 27 | - Publish the new version |
29 | 28 |
|
30 | 29 | ## Tests |
31 | | -The test suite is included as a git submodule of https://github.com/Mermade/openapi3-examples. |
32 | | - |
33 | | -```bash |
34 | | -npx mocha --recursive tests |
35 | | -``` |
36 | 30 |
|
37 | | -You can also validate a document individually. |
| 31 | +The test suite is part of this package. |
38 | 32 |
|
39 | 33 | ```bash |
40 | | -scripts/validate.js path/to/document/to/validate.yaml |
| 34 | +npm install |
| 35 | +npm test |
41 | 36 | ``` |
0 commit comments