Panic on unexpected schema validation error #265
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
err
return value of*jsonschema.Schema.ValidateInterface()
is used to pass the schema validation failure result.That error type is given special treatment by Arduino Lint because it occurs under normal circumstances when a rule
violation occurs, and must be interpreted by the rule functions, or even ignored, depending on the tool configuration.
The
err
return value of*jsonschema.Schema.ValidateInterface()
is also used to return errors that indicate someunexpected problem has occurred separate from a schema validation failure. Previously, these other error types were
ignored and the validation treated as if it had passed, even though it likely never even ran.
Since Arduino Lint controls both the instance and schema data, such these true errors returned by the validation process
should not ever occur when the application is operating correctly. For this reason, a panic is triggered immediately.