This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
pass key to DictNode fields for error reporting #26
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.
This improves error reporting a bit by passing the name that a dict field was given down to the child node (like WildcardDictNode does) so that it can reference itself by the name it was given, not just by its class name, which may not be the same.
'foo must be a str'
instead of'dummyfoo must be a str'
Sidenote, I also clarified the behavior of
is_valid
, which at least in the case of DictNode does not factor in the validity of its descendants. Not sure if that should be explored or not, I could see it both ways...I think the way that it is makes for more clear error reporting again? The dict itself may be just fine, and have the fields it is required to have, and then if a field has the wrong type then the error will only show up on that field, not on the field and the parent dict.