-
Notifications
You must be signed in to change notification settings - Fork 19
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
Binding error passes silently #55
Comments
I can't duplicate the exception-scenario mentioned in "Expected behaviour". May you post a sample project as a ZIP-file or the stack trace from the exception? When I use |
Hi @billbogaiv, Was a bit busy this month but today we had again an issue with Hybird model binding attribute so I decided that today is the day to come back to old problems so I've made an example repo where you can reproduce issue. Check the following screenshot which illustrates the problem: [PUT] https://localhost:5001/api/example/
Also there is a weird and confusing behavior with FluentValidaton, for example if we have the following validator defined for
The behavior I get when I'm using |
Thanks for the sample repo. I've identified a couple issues and should be able to get an update pushed soon.
Regarding the public void ConfigureServices(IServiceCollection services)
{
services
.AddControllers()
.AddHybridModelBinder();
}
|
Registering |
The forthcoming update will fix those problems, but without registering the service, even submitting a request like the following won't trigger the expected binding: {
"model": { "value": 1 }
} Using attributes like
|
Hi @billbogaiv any news on this update? We've run into a similar issue and wanted to know if this update was on the horizon. It's a new year and everyone is busy so I get it if this isn't happening anytime soon. Only asking to inform our decisions going forward. |
I've stumbled upon an odd behaviour with hybrid model binding. Consider this example:
Model:
Controller endpoint:
Request:
In the request property "someNestedDto" has INTENTIONALLY a wrong type.
Behaviour: dto that comes to my controller method has empty fields with default values.
Expected behaviour: parse error. If this happens with [FromBody] attribute applied to MyDto, then a parse exception will be raised.
As for me such errors shouldn't pass silently.
The text was updated successfully, but these errors were encountered: