Skip to content

Commit

Permalink
Merge pull request #4137 from ralfhandl/schemas-yaml-to-json-test-che…
Browse files Browse the repository at this point in the history
…ck-in

Run tests with YAML metaschemas
  • Loading branch information
handrews authored Oct 18, 2024
2 parents 37e4ef0 + 7f19e32 commit e9dc186
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 3,243 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/schema-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: schema-test

#
# This workflow runs the npm test script to validate passing and failing
# testcases for the metaschema.
# testcases for the metaschemas
#

# run this on push to any branch and creation of pull-requests
Expand All @@ -23,13 +23,15 @@ jobs:
- uses: actions/checkout@v4 # checkout repo content
with:
fetch-depth: 0

- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '20.x'

- name: Install dependencies from main
run: |
git checkout remotes/origin/main -- package.json package-lock.json
npm ci
- name: Run tests
run: npm run test

28 changes: 21 additions & 7 deletions schemas/v3.0/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
OpenAPI 3.0.X JSON Schema
---
# OpenAPI 3.0.X JSON Schema

Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.X.
Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.x.

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.
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 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.
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.

To submit improvements to the schema, modify the schema.yaml file only.
## Contributing

To submit improvements to the schema, modify the `schema.yaml` and add test cases for your changes.

The TSC will then:
- Run tests on the updated schema
- Update the iteration version
- Convert the schema.yaml to schema.json
- Publish the new version

## Tests

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

```bash
npm install
npm test
```
Loading

0 comments on commit e9dc186

Please sign in to comment.