-
Notifications
You must be signed in to change notification settings - Fork 28
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
Safer recursive validation. #54
Comments
It's impossible to know if a given property getter will throw during validation due to the state of the object, so just swallow any exception from getting the value. Fixes #54
@niemyjski any reason you can't skip recursion for the property using |
I think I just ran into something similar. Here is a simple repro:
When calling
Note that this worked fine on Net 6, but started breaking after upgrading to Net 8. For us, the problem with using |
I could add support for Can either of you determine if MVC has issues when accepting these types as input that gets validated? I'm curious what its behavior is. |
Using
|
I don't think |
Assuming I'm not missing something, the model validation seems to work normally:
I also tested again with DataAnnotations and the new |
OK thanks. The new I'll have to dig in to what MVC is doing that results in the getter of the |
If you have dynamic payloads like JsonPatch / Delta or content that may be a JToken or other Json Type MiniValidator throws quickly. Can we add some type guards or safety to continue on when an error occurs?
The text was updated successfully, but these errors were encountered: