mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
json response from API are now in pascalCasing
This commit is contained in:
parent
e720094f9c
commit
9969f66201
11 changed files with 75 additions and 11 deletions
33
NzbDrone.Api/Extentions/Serializer.cs
Normal file
33
NzbDrone.Api/Extentions/Serializer.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace NzbDrone.Api.Extentions
|
||||
{
|
||||
public static class Serializer
|
||||
{
|
||||
static Serializer()
|
||||
{
|
||||
Settings = new JsonSerializerSettings
|
||||
{
|
||||
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
Formatting = Formatting.None,
|
||||
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate
|
||||
};
|
||||
|
||||
Instance = new JsonSerializer
|
||||
{
|
||||
DateTimeZoneHandling = Settings.DateTimeZoneHandling,
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
Formatting = Formatting.None,
|
||||
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver()
|
||||
};
|
||||
}
|
||||
|
||||
public static JsonSerializerSettings Settings { get; private set; }
|
||||
|
||||
public static JsonSerializer Instance { get; private set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue