2020-05-21 14:44:15 +00:00
|
|
|
using MediaBrowser.Common.Json;
|
2020-04-20 00:04:36 +00:00
|
|
|
using Microsoft.AspNetCore.Mvc.Formatters;
|
|
|
|
using Microsoft.Net.Http.Headers;
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Formatters
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Camel Case Json Profile Formatter.
|
|
|
|
/// </summary>
|
|
|
|
public class CamelCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="CamelCaseJsonProfileFormatter"/> class.
|
|
|
|
/// </summary>
|
2020-06-13 19:11:41 +00:00
|
|
|
public CamelCaseJsonProfileFormatter() : base(JsonDefaults.GetCamelCaseOptions())
|
2020-04-20 00:04:36 +00:00
|
|
|
{
|
|
|
|
SupportedMediaTypes.Clear();
|
|
|
|
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("application/json;profile=\"CamelCase\""));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|