Repository navigation
Conversation
That branch now collects every field error and, when there is only one, returns the original variant so its message stays the same. Several errors are returned as ValidationError::Multiple, formatted as a bullet per problem with that problem's path and one object and validator summary. Nested Multiple errors are flattened into the parent, with each child receiving the parent path segment. An array still stops at its first bad element, and a union of object shapes still fails as a single NoMatch. Fixes convex#591
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
A missing or extra field's context points at its parent object, so a nested bullet only showed the parent path. Add the field name to the path, and cover it with a nested test.
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.
That branch now collects every field error and, when there is only one, returns the original variant so its message stays the same. Several errors are returned as ValidationError::Multiple, formatted as a bullet per problem with that problem's path and one object and validator summary. Nested Multiple errors are flattened into the parent, with each child receiving the parent path segment. An array still stops at its first bad element, and a union of object shapes still fails as a single NoMatch. When an object fails validation in more than one field, the caller only sees the first problem. A wrong type, a missing required field, and an extra field are reported one at a time, so a payload has to be fixed and submitted again to surface each remaining mismatch. The object branch of check_value_internal returns as soon as one field fails. A nested validator error is propagated with ?, and a missing required field or an extra field returns Err before the rest of the object is checked. The common crate tests passed, covering the new object-validator error cases.
Fixes #591
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.