Fix ApiExplorer metadata for FormFiles/Stream/PipeReader in MVC actions
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
MVC uses the `FormFileModelBinder` ([ref](https://source.dot.net/#Microsoft.AspNetCore.Mvc.Core/ModelBinding/Binders/FormFileModelBinder.cs,0ed8e2ee0a654a1a)) to support binding for `IFormFile`, `IFormFileCollection`, and `IEnumerable`.
When this is the case, the ApiExplorer layer will produce 6 distinct parameter descriptions for each property within the IFormFile type:
This is distinct from the descriptions that are generated for minimal APIs which correctly produces the correct binding sources for form file parameters (see https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.ApiExplorer/src/EndpointMetadataApiDescriptionProvider.cs#L305). We should update the MVC implementation of ApiExplorer to do the right thing.
Contributor guide
Assessment
This issue has not been assessed yet.