-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
How to write rule for validating collections? #13
Comments
That's the point - you don't need to write rules for collections manually.
Octopus will derive rules for collection automatically! However sometimes you may want to additionally restrict collection itself. In this case you can define your own rules and compose with derived ones:
Intentionally this should work equally well for asynchronous validators. |
@krzemin This works as well but how do I combine the collection validator to the actual class validator as in my original example:
the advantage I would get is all the validation result would be combined |
I'm not sure if I got your question right. If you mark your rule for |
I think I misunderstood. If it combines automatically due to implicit then that should be good enough. I will try it out. Thanks. |
@ibrahim-islam can we close this? |
Hello, I'm using version 0.4.1, which seems to be the latest.
And the test can not compile with the following error:
Do I missed something ? Notice also that when I remove the customerCollection validator, it works fine. But I need to introduce validation items at collection level |
It seems that works better like this:
|
The text was updated successfully, but these errors were encountered: