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

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

@dougbu

Description

@dougbu

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

Metadata

Metadata

Assignees

Labels

3 - DonePRI: 1 - RequiredMust be handled in a reasonable timebugcost: XSWill take up to half a day to complete

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions