This change adds a list of ApiRequestFormat objects to ApiDescription object which include the content type and formatter for each supported content type which can be understood by the action. Computation is aware of the [Consumes] attribute via the IApiRequestMetadataProvider metadata interface, and aware of Input Formatters via the new IApiRequestFormatMetadataProvider interface. This algorithm is essentially the same as what we do for produces/output-formatters. We iterate the filters and ask them what content types they think are supported. Then we cross check that list with the formatters, and ask them which from that list are supported. If no [Consumes] filters are used, the formatters will include everything they support by default. This feature and data is only available when an action has a [FromBody] parameter, which will naturally exclude actions that handle GET or DELETE and don't process the body. |
||
|---|---|---|
| .. | ||
| DefaultApiDescriptionProviderTest.cs | ||
| Microsoft.AspNet.Mvc.ApiExplorer.Test.xproj | ||
| project.json | ||