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

Add schema path to json validation exception messages #129

Open
mostfunkyduck opened this issue Aug 14, 2018 · 2 comments
Open

Add schema path to json validation exception messages #129

mostfunkyduck opened this issue Aug 14, 2018 · 2 comments
Assignees
Milestone

Comments

@mostfunkyduck
Copy link

Currently if you have a json object like this:

                'personalizations': [
                    {   
                        'to': [
                            {   
                                'email': '[email protected]',
                                'name': 'someone'
                            },  
                            {   
                                'name': 'someone'
                            }   
                        ]   
                    }   
                ]   
            }

in a schema where each 'to' object needs an 'email' variable, the validation error message will read: Error with sent data: 'email' is a required property
This is difficult to track down in large arrays, and can also be confusing when variable names are reused at different levels of nesting.

It would be better if the message read something like: Error with sent data: 'personalizations.to.1.email' is a required property

@welcome
Copy link

welcome bot commented Aug 14, 2018

Thanks for opening your first issue here! Be sure to follow the issue template! 👋🐞👋

@liiight liiight self-assigned this Oct 8, 2018
@liiight
Copy link
Owner

liiight commented Jun 23, 2019

This will be addressed when switching to pydantic via #221

@liiight liiight added this to the 2.0.0 milestone Jun 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants