notifiers icon indicating copy to clipboard operation
notifiers copied to clipboard

Add schema path to json validation exception messages

Open mostfunkyduck opened this issue 7 years ago • 2 comments

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

mostfunkyduck avatar Aug 14 '18 16:08 mostfunkyduck

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

welcome[bot] avatar Aug 14 '18 16:08 welcome[bot]

This will be addressed when switching to pydantic via #221

liiight avatar Jun 23 '19 13:06 liiight