Apply suggestions, fix warning

This commit is contained in:
crobibero 2020-04-23 21:41:10 -06:00
parent fe632146dc
commit 0765ef8bda

View File

@ -7,11 +7,6 @@ namespace Jellyfin.Server.Models
/// </summary>
public static class JsonOptions
{
/// <summary>
/// Base Json Serializer Options.
/// </summary>
private static readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions();
/// <summary>
/// Gets CamelCase json options.
/// </summary>
@ -19,7 +14,7 @@ namespace Jellyfin.Server.Models
{
get
{
var options = _jsonOptions;
var options = DefaultJsonOptions;
options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
return options;
}
@ -32,10 +27,15 @@ namespace Jellyfin.Server.Models
{
get
{
var options = _jsonOptions;
var options = DefaultJsonOptions;
options.PropertyNamingPolicy = null;
return options;
}
}
/// <summary>
/// Gets base Json Serializer Options.
/// </summary>
private static JsonSerializerOptions DefaultJsonOptions => new JsonSerializerOptions();
}
}