-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Types - invalid value tracking #10
Comments
Most complicated part of issue is having an easy to understand and hard to misuse API. e.g. StringRule uses SimpleValueType which can mark multiple parameters (minLength, notEmpty, pattern, ...) invalid at the same time. In case any of the parameters is invalid ( In case StringRule validation fails completely (value is not a string), rule throws an exception and invalidation is handled by rule above - one of
@mrceperka Hope it is understandable, let me know in case anything is unclear. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Types are representation of whole VO structure and are also able to track exact keys which are invalid. In order to check which keys were invalid, user has to compare invalid keys with sent data and that's impractical.
All the Type methods which mark value invalid should be required to also add that value to Type so it could be rendered together with invalid key by Formatter.
In this stage we should resolve the problem to satisfaction just in
Type
. Optimal rendering inErrorFormatter
could be quite complex and for now only minimal implementation inVisualErrorFormatter
should be enough to verify solution - something likekey: string (received int(123) instead)
The text was updated successfully, but these errors were encountered: