Merge pull request #3153 from crobibero/api-json-enum
Fix Json Enum conversion, map all JsonDefaults properties to APIpull/3232/head
commit
93bca7ab50
@ -1,41 +0,0 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Jellyfin.Server.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Json Options.
|
||||
/// </summary>
|
||||
public static class JsonOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets CamelCase json options.
|
||||
/// </summary>
|
||||
public static JsonSerializerOptions CamelCase
|
||||
{
|
||||
get
|
||||
{
|
||||
var options = DefaultJsonOptions;
|
||||
options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets PascalCase json options.
|
||||
/// </summary>
|
||||
public static JsonSerializerOptions PascalCase
|
||||
{
|
||||
get
|
||||
{
|
||||
var options = DefaultJsonOptions;
|
||||
options.PropertyNamingPolicy = null;
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets base Json Serializer Options.
|
||||
/// </summary>
|
||||
private static JsonSerializerOptions DefaultJsonOptions => new JsonSerializerOptions();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue