Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Regression: ApiBehaviorOptions.SuppressInferBindingSourcesForParameters ignored (!!) #8657

Closed
dougbu opened this issue Oct 27, 2018 · 2 comments
Assignees
Labels
3 - Done bug cost: XS Will take up to half a day to complete PRI: 1 - Required Must be handled in a reasonable time
Milestone

Comments

@dougbu
Copy link
Member

dougbu commented Oct 27, 2018

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)

  1. start with https://github.com/dougbu/AspNetCoreModelBinderDemo This is a variant of https://github.com/BenjaminAbt/AspNetCoreModelBinderDemo, the repro for (closed) issue request ends in 400 when model binder success value is null #8636
  2. set a breakpoint in MyPocoModelBinder.BindModelAsync(...)
  3. run project in VS debugger
Expected

bindingContext.BindingSource == null

Actual

bindingContext.BindingSource == BindingSource.Path
image

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

@dougbu
Copy link
Member Author

dougbu commented Oct 27, 2018

/cc @pranavkm

@dougbu
Copy link
Member Author

dougbu commented Oct 27, 2018

My thanks to @BenjaminAbt for inspiring me to take a close look at the latest code in dotnet/AspNetCore.Docs#9175 discussions

@mkArtakMSFT mkArtakMSFT added PRI: 1 - Required Must be handled in a reasonable time bug 1 - Ready labels Oct 29, 2018
@mkArtakMSFT mkArtakMSFT added this to the 2.2.0 milestone Oct 29, 2018
pranavkm added a commit that referenced this issue Oct 29, 2018
pranavkm added a commit that referenced this issue Oct 29, 2018
@pranavkm pranavkm added the cost: XS Will take up to half a day to complete label Oct 29, 2018
pranavkm added a commit that referenced this issue Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - Done bug cost: XS Will take up to half a day to complete PRI: 1 - Required Must be handled in a reasonable time
Projects
None yet
Development

No branches or pull requests

3 participants