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

Better validation error representation. #50

Open
swistakm opened this issue Apr 12, 2017 · 0 comments
Open

Better validation error representation. #50

swistakm opened this issue Apr 12, 2017 · 0 comments

Comments

@swistakm
Copy link
Owner

There are few major issues with current validation error representation.

  1. Validation on bulk resource creation will not tell which object in whole batch did not pass validation.
  2. Validation of fields with many=True quits on first invalid value and does not allow to find out if all values were incorrect or only few of them. Also if not all, we don't know which ones.
  3. ValueError exceptions are treated equally with ValidationError exceptions. This is great because allows for easier integration with built-in or custom types but on the other hand can leak some implementation details to the user agent. It is equally bad as presenting stack trace to user agent. We should treat ValidationError exceptions as explicit errors that can be safely presented to the user, but ValueError exceptions should be replaced with generic and safe information in type of "Could not parse" or "Invalid format".
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

1 participant