Regression: `ApiBehaviorOptions.SuppressInferBindingSourcesForParameters` ignored (!!)
dougbu opened this issue · comments
Is this a Bug or Feature request?
Bug and a regression. Problem does not occur with ASP.NET Core 2.1 or earlier 2.2 previews (including Preview 3).
Steps to reproduce (preferably a link to a GitHub repo with a repro project)
- start with https://github.com/dougbu/AspNetCoreModelBinderDemo This is a variant of https://github.com/BenjaminAbt/AspNetCoreModelBinderDemo, the repro for (closed) issue #8636
- set a breakpoint in
MyPocoModelBinder.BindModelAsync(...)
- run project in VS debugger
Expected
bindingContext.BindingSource == null
Actual
bindingContext.BindingSource == BindingSource.Path
Description of the problem
InferParameterBindingInfoConvention
has a SuppressInferBindingSourcesForParameters
property which is (correctly) set from ApiBehaviorOptions.SuppressInferBindingSourcesForParameters
. But, the property is never read. Parameter binding sources are always inferred in controllers with [ApiController]
.
Version of Microsoft.AspNetCore.Mvc
or Microsoft.AspNetCore.App
or Microsoft.AspNetCore.All
Microsoft.AspNetCore.Mvc
: 2.2.0-rtm-35541
/cc @pranavkm
My thanks to @BenjaminAbt for inspiring me to take a close look at the latest code in dotnet/AspNetCore.Docs#9175 discussions