You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is still possible to use this constructor, but due to likelihood that it will be removed from future versions of of dotnet, I am looking for a better/more future-proof way of integrating. The only remaining non-obsolete constructor requires passing both MvcOptions (available in IServiceCollection.AddMvc`1) and MvcJsonOptions (available in IMvcBuilder.AddJsonOptions`1)), but I've not yet found a way to access both MvcOptions and MvcJsonOptions in the same place in order to use the preferred constructor.
Though this is not definitive, it appears that Microsoft intends that custom serialization settings be achieved via IMvcBuilder.AddJsonOptions`1: aspnet/Mvc#4339 (comment)
I will follow up if I find a good solution for integrating with Aspnet Core WebApi that doesn't go against current "best practices", but wanted to post here as well in case it is relevant to others.
Thanks.
~Jordan
The text was updated successfully, but these errors were encountered:
Issue refers to the following documentation: https://github.com/codecutout/JsonApiSerializer#integrating-with-microsoftaspnetcoremvc
Documentation recommends newing up
JsonInputFormatter
withJsonInputFormatter(ILogger, JsonSerializerSettings, ArrayPool<char>, ObjectPoolProvider)
constructor (JsonInputFormatter`4
). Per Microsoft, this constructor is now obsoleted: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.formatters.jsoninputformatter.-ctor?view=aspnetcore-2.2#Microsoft_AspNetCore_Mvc_Formatters_JsonInputFormatter__ctor_Microsoft_Extensions_Logging_ILogger_Newtonsoft_Json_JsonSerializerSettings_System_Buffers_ArrayPool_System_Char__Microsoft_Extensions_ObjectPool_ObjectPoolProvider_It is still possible to use this constructor, but due to likelihood that it will be removed from future versions of of dotnet, I am looking for a better/more future-proof way of integrating. The only remaining non-obsolete constructor requires passing both
MvcOptions
(available inIServiceCollection.AddMvc`1
) andMvcJsonOptions
(available inIMvcBuilder.AddJsonOptions`1)
), but I've not yet found a way to access bothMvcOptions
andMvcJsonOptions
in the same place in order to use the preferred constructor.Though this is not definitive, it appears that Microsoft intends that custom serialization settings be achieved via
IMvcBuilder.AddJsonOptions`1
: aspnet/Mvc#4339 (comment)I will follow up if I find a good solution for integrating with Aspnet Core WebApi that doesn't go against current "best practices", but wanted to post here as well in case it is relevant to others.
Thanks.
~Jordan
The text was updated successfully, but these errors were encountered: