Skip to content

3.2 improve schema test coverage #4780

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

Open
wants to merge 17 commits into
base: v3.2-dev
Choose a base branch
from

Conversation

ralfhandl
Copy link
Contributor

@ralfhandl ralfhandl commented Jul 14, 2025

We switched to https://github.com/hyperjump-io/json-schema-coverage for schema test coverage, and the new tool is more diligent than the preliminary tool used so far, reporting branches tbat are not covered by the existing schema tests.

This PR brings schema test coverage back up to 100%.

It includes the changes in

which can't be merged due to the insufficient schema test coverage.

  • schema changes are included in this pull request
  • schema changes are needed for this pull request but not done yet
  • no schema changes are needed for this pull request

@ralfhandl ralfhandl marked this pull request as ready for review July 16, 2025 11:57
@ralfhandl ralfhandl requested review from a team as code owners July 16, 2025 11:57
@ralfhandl ralfhandl changed the title 3.2 improve schema coverage 3.2 improve schema test coverage Jul 16, 2025
Copy link
Member

@handrews handrews left a comment

Choose a reason for hiding this comment

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

I'm concerned that the actual validation coverage is not as thorough as the files make it appear- I have commented on one such example. This all depends on how the JSON Schema implementation handles things, and whether we expect this suite to be usable with other implementations. If we want it to work with any conforming JSON Schema implementation, we need to only test one failure condition per case.

Comment on lines +5 to +16
paths: true
components:
schemas: true
responses: true
parameters: true
examples: true
requestBodies: true
headers: true
securitySchemes: true
links: true
callbacks: true
pathItems: true
Copy link
Member

Choose a reason for hiding this comment

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

Does the JSON Schema implementation actually check every single one of these? Many if not most stop evaluating on the first error. This is why most of the time negative test cases test only one condition at a time while postive test cases can test many conditions.

Also, why is paths: true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants