Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach additional properties error to each bad key #416

Closed

Conversation

robherring
Copy link
Contributor

Instead of a single error for unexpected additional properties attached
to the container dict()'s path, create an error for each unexpected key
and include the key in the path. This is useful when parsing errors to
identify the exact failing object, which is helpful when identifying
the location of the failing key.

In the particular case of using the ruamel.yaml parser, line & column
numbers are preserved in the data structure, and having the full path to
the failing key means error messages can include the line & column
numbers.

Signed-off-by: Grant Likely grant.likely@arm.com
Signed-off-by: Rob Herring robh@kernel.org

Instead of a single error for unexpected additional properties attached
to the container dict()'s path, create an error for each unexpected key
and include the key in the path. This is useful when parsing errors to
identify the exact failing object, which is helpful when identifying
the location of the failing key.

In the particular case of using the ruamel.yaml parser, line & column
numbers are preserved in the data structure, and having the full path to
the failing key means error messages can include the line & column
numbers.

Signed-off-by: Grant Likely <grant.likely@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
@Julian
Copy link
Member

Julian commented May 29, 2018

Hi!

Thanks!

This needs tests :)

Also, I don't think path is the right place to put this for the reasons I mentioned in #119.

I suspect we need a new attribute, or to go with one of the other solutions proposed at the bottom of that issue, but if one specific direction to go in is unclear there (it's been awhile since I've looked at that ticket) I can review it and suggest one.

@Julian Julian closed this Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants