Please update description for AddMvcCore / FormatFilter usage.
If endpoint or controller uses FormatFilter attribute then the corresponding service should be registered:
services.AddMvcCore()
...
.AddFormatterMappings
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 6ebcd752-af71-c483-eebb-0745bd04fb30
- Version Independent ID: 1f678d5d-230b-0ad0-c925-15b13081f553
- Content: Format response data in ASP.NET Core Web API
- Content Source: aspnetcore/web-api/advanced/formatting.md
- Product: aspnet-core
- GitHub Login: @ardalis
- Microsoft Alias: riande
@Igor-Pchelko I don't understand your request.
In case if Mvc stack is bootstrapped with AddMvcCore to use FormatFilter attribute we need to call AddFormatterMappings to register corresponding service.
Here are is an example of issue: https://stackoverflow.com/questions/53045783/using-formatfilter-attribute-within-mvc-core-2-1-3-api
In documentation this is not mentioned.
@dougbu should this be added to the doc?
@Igor-Pchelko we would not recommend using AddMvcCore(...) in most cases.
@Rick-Anderson I wouldn't document this particular aspect of using AddMvcCore(...) at all. However, it's worth adding a fairly prominent note wherever AddMvcCore(...) is mentioned. That note should state the API is intended only for very advanced uses, that many choices when using it can break applications, and that we do not document those nuances.
FYI @rynowak