Merge stable into develop - #1369
Merged
Merged
Conversation
…1357) * feat(schema): expose location, value and reason on validation error details Every entry of `SchemaValidationResult.errors` now carries `loc` (the field location as a tuple of keys and indexes), `input` (the value received there) and `reason` (the wording alone), next to the unchanged `field` and `message`, which are rendered from these parts by a single helper. A consumer can report or forward each violation in a structured form without parsing the message text. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * test(schema): assert field is the dotted rendering of loc on a concrete error The parametrized check compared field and loc by rewriting brackets into dots, which hid the rule it was testing. A dedicated test now shows one nested error with its location tuple and rendered path side by side. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * test(schema): check field against loc for every rejected case Drops a test that repeated the unknown-field detail test, asserts the rendered field on the out-of-enum detail test, and restores the field/loc consistency check across all unknown-field and out-of-enum cases through a small helper that spells out the expected rendering. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Deploying infrahub-sdk-python with
|
| Latest commit: |
de03cbf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6cd2ca52.infrahub-sdk-python.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Merging stable into develop after merging pull request #1357.
Summary by cubic
Adds structured location, received value, and reason fields to schema validation error details.
Each
SchemaValidationErrorDetailnow includesloc(a tuple of keys and indexes),input(the offending value), andreason(the error wording alone), alongside the existingfieldandmessage, which are rendered from those parts. This lets consumers report or forward errors without parsing message text.Written for commit de03cbf. Summary will update on new commits.