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.

ModelBinding regression in 2.1.3 #8536

@Suchiman

Description

@Suchiman

Is this a Bug or Feature request?:

Bug

Steps to reproduce (preferably a link to a GitHub repo with a repro project):

https://github.com/Suchiman/MvcRegression

[ApiController]
[Route("api/[controller]")]
public class TestController : Controller
{
    [HttpPost]
    public void Test(List<TestClass> filters = null)
    {
    }
}

public class TestClass
{
    public string Test { get; set; }
}
  1. Set breakpoint in the Test method of the TestController
  2. Issue following post request
POST https://localhost:44333/api/Test/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:44333
Content-Length: 37

[{"test":"value1"},{"test":"value2"}]
  1. Inspect the filters argument

Description of the problem:

After Upgrading from

<PackageReference Include="Microsoft.AspNetCore" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.2" />

to

<PackageReference Include="Microsoft.AspNetCore" Version="2.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />

filters will be an empty list, while it used to be populated with the two elements that were posted in the previous Version.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions