Swashbuckle.AspNetCore icon indicating copy to clipboard operation
Swashbuckle.AspNetCore copied to clipboard

array of objects property in multipart/form-data (FormForm)

Open namighajiyev opened this issue 2 years ago • 5 comments

Hi,

I am posting an object with property that is an array of objects. When I execute method I get an empty array/ienumerable for "NestedList" property even though I have added two items in the UI.

public class NestedRequest {
    public int MyProperty { get; set; }
}
public class SampleRequest
{
  public IEnumerable<NestedRequest> NestedList { get; set; }= null!;
}

  [HttpPost()]
  public async override Task<ActionResult> HandleAsync([FromForm] SampleRequest request, CancellationToken cancellationToken = default)
  {
    return await Task.FromResult(new OkResult());
  }

sample-endpoint

namighajiyev avatar Apr 12 '22 06:04 namighajiyev