.net core 虚张声势的人不';不尊重注入的自定义Json序列化程序
我使用以下方法来遵守Json API规范:.net core 虚张声势的人不';不尊重注入的自定义Json序列化程序,.net-core,asp.net-core-webapi,swashbuckle,.net Core,Asp.net Core Webapi,Swashbuckle,我使用以下方法来遵守Json API规范: services.AddMvc(options => { var jsonApiFormatter = new JsonOutputFormatter(new JsonApiSerializerSettings(), ArrayPool<char>.Shared); options.OutputFormatters.RemoveType<JsonOutputFor
services.AddMvc(options =>
{
var jsonApiFormatter = new JsonOutputFormatter(new JsonApiSerializerSettings(), ArrayPool<char>.Shared);
options.OutputFormatters.RemoveType<JsonOutputFormatter>();
options.OutputFormatters.Insert(0, jsonApiFormatter);
});
services.AddMvc(选项=>
{
var jsonApiFormatter=new JsonOutputFormatter(new JsonApiSerializerSettings(),ArrayPool.Shared);
options.OutputFormatters.RemoveType();
options.OutputFormatters.Insert(0,jsonApiFormatter);
});
但是SwaggerGen忽略它,仍然使用默认的Json序列化程序(Json.NET)
我如何实施它以适应新的序列化程序。找到解决方案了吗?