Pre-validation Error Cleanup: Distinguish pre-validation errors from schema constraint violations #4
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.
What Changed
Establishes a clear distinction between pre-validation errors (where input cannot be parsed/compiled to reach schema validation) and schema constraint violations (where input violates a defined schema rule) across 6 validation types.
Why
Improves error clarity for library consumers by only including
SchemaValidationFailurewhen there's an actual schema to reference. This makes it easier to:SchemaValidationFailure Changes
Schema/Document Validation
Parameter Validation
Request Body Validation
Response Body Validation
Other Changes
AbsoluteKeywordLocationfield: This field was never populated becauseRenderInline()resolves all$refreferences before validation, so the JSON Schema validator never encounters$refpointers. Removing unused field reduces struct size and complexity.The
AbsoluteKeywordLocationremoval is based on observed behavior (field always empty due to schema inlining). If there are use cases where this field should be populated or if the library has plans to support it in the future, this change could be rolled back to commitf0fc5b5(just before the removal).Question for maintainer: Is there a use case for
AbsoluteKeywordLocationthat we're missing, or is it safe to remove this unused field?Commits (6)