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

Prune JSON Schema error reporting #40

Open
handrews opened this issue Jun 29, 2023 · 1 comment
Open

Prune JSON Schema error reporting #40

handrews opened this issue Jun 29, 2023 · 1 comment

Comments

@handrews
Copy link
Member

JSON Schema standard error reporting is verbose (even when using the "basic" format, and more so with the more complex ones). oascomply should log the full error output ("detailed" or "verbose"?), at least on a high logging verbosity. But for the main error report, it should prune the output.

Ideas include:

  • prune all annotations, except perhaps ones like properties that might help debug (but probably better to leave that for the verbose output log)
  • if a oneOf or anyOf passed, prune all errors from failing branches
  • unevaluatedProperties (and to a lesser degree, additionalProperties and similar keywords for array items) cause produce errors when a property/item fails validation and then becomes evaluated by the *Properties* or *Items* keyword when it normally would not be
  • I think some errors can be repeated in the output as they propagate upwards in some way, need to investigate but I suspect some things can be pruned here
@handrews
Copy link
Member Author

One thing to do: "if" errors get included in the report, which is useful when figuring out why the wrong one of "then" vs "else" was selected, but they should be moved to a more supplemental area.

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

No branches or pull requests

1 participant