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

#594 & #816 - Add error path to schema validation error in RequestBodyValidator #1063

Merged
merged 2 commits into from
Oct 27, 2019

Conversation

Svendegroote91
Copy link
Contributor

@Svendegroote91 Svendegroote91 commented Oct 24, 2019

Fixes #594 .
Fixes #816
--> it gives TypeError when your json includes a list (the exception.path includes an integer )(TypeError: sequence item 1: expected str instance, int found)
--> Put 'path' at the end of the error message as it can sometimes be empty

Changes proposed in this pull request:

  • include json key with full path into validation error message

@Svendegroote91 Svendegroote91 force-pushed the feature/path_error branch 2 times, most recently from f4e8671 to adae207 Compare October 24, 2019 07:16
@hjacobs
Copy link
Contributor

hjacobs commented Oct 24, 2019

Can you add a unit test? Thanks!

@Svendegroote91
Copy link
Contributor Author

Sure, I'll have a look the coming days to add a unit test.

@Svendegroote91 Svendegroote91 force-pushed the feature/path_error branch 2 times, most recently from f23305a to d86e532 Compare October 26, 2019 07:58
@Svendegroote91 Svendegroote91 force-pushed the feature/path_error branch 2 times, most recently from 2012e9a to aeb4f4a Compare October 26, 2019 10:11
@Svendegroote91
Copy link
Contributor Author

Unit test added, can you have a look?

@hjacobs
Copy link
Contributor

hjacobs commented Oct 27, 2019

👍

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.

Get key of field causing the validation error
2 participants