Add complete SchemaValidationFailure context to all parameter errors #6
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
Adds full OpenAPI
KeywordLocationpaths andReferenceSchemacontext to all parameter validation errors (path, query, header, cookie parameters). Uses the centralized JSON Pointer helpers from PR #2.Why
Before this change, parameter validation errors had incomplete context:
ReferenceSchemafield (couldn't see the schema that was violated)KeywordLocation(hard to locate the exact schema rule)Now all parameter errors include:
KeywordLocation: e.g.,/paths/~1users~1{id}/get/parameters/id/schema/minimumReferenceSchema: The actual schema definition as JSON stringThis makes debugging much easier - you can see exactly which schema rule was violated and where it's defined in your OpenAPI spec.
Pattern Applied
Each parameter validation function now:
renderedSchemato error functions (avoid re-rendering on each error)KeywordLocationconstructionExample (Path parameter validation):
SchemaValidationFailure Changes
Path Parameter Validation
Query Parameter Validation
Header Parameter Validation
Cookie Parameter Validation
Dependency Note
Commits (4)