Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more CI checks for OpenAPI definitions and JSON Schemas #1656

Merged
merged 9 commits into from Oct 11, 2023

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Oct 4, 2023

The commits can be reviewed one by one.

check-json-schemas.py

Validates all JSON schemas and their inline examples.

This is complementary to check-event-schema-examples.py that only validates the event examples and their JSON schemas. There is no way currently to detect a JSON schema, so it validates all files in a fixed set of folders. This could be fixed by adding the $schema field to all JSON schemas.

This check found several issues, such as: #1634, #1635, #1636, #1646.

check-openapi-sources.py

Validates OpenAPI definitions schemas and their inline examples.

This was already unused prior to the switch to OpenAPI 3.1. It was adapted to validate against the new version, and slightly improved to check all all request parameters instead of just the requestBody.

This check was the reason for #1647. It seems this issue was also the reason why it was removed from CI in the first place.

Fixes #8.

Preview: https://pr1656--matrix-spec-previews.netlify.app

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…t the 2020-12 spec

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
They are only in a few schemas and use the wrong version of the spec

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner October 4, 2023 08:05
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks great - a couple of comments

scripts/check-json-schemas.py Outdated Show resolved Hide resolved
scripts/check-json-schemas.py Outdated Show resolved Hide resolved
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from richvdh October 11, 2023 08:36
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@richvdh richvdh enabled auto-merge (squash) October 11, 2023 10:35
@richvdh richvdh merged commit 560d98b into matrix-org:main Oct 11, 2023
12 checks passed
@zecakeh zecakeh deleted the check-all-schemas branch October 11, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check-swagger-sources.py is not run in CI
2 participants