You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
693 B
24 lines
693 B
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
namespace Recyclarr.TrashLib.Json;
|
|
|
|
public static class ServiceJsonSerializerFactory
|
|
{
|
|
public static JsonSerializerSettings Settings { get; } = new()
|
|
{
|
|
// This makes sure that null properties, such as maxSize and preferredSize in Radarr
|
|
// Quality Definitions, do not get written out to JSON request bodies.
|
|
NullValueHandling = NullValueHandling.Ignore,
|
|
ContractResolver = new ServiceContractResolver
|
|
{
|
|
NamingStrategy = new CamelCaseNamingStrategy()
|
|
}
|
|
};
|
|
|
|
public static JsonSerializer Create()
|
|
{
|
|
return JsonSerializer.Create(Settings);
|
|
}
|
|
}
|