jellyfin/Jellyfin.Api/Formatters/PascalCaseJsonProfileFormatter.cs

24 lines
824 B
C#
Raw Normal View History

2020-08-20 17:17:27 +00:00
using System.Net.Mime;
using Jellyfin.Extensions.Json;
2020-04-20 00:10:59 +00:00
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Net.Http.Headers;
2023-01-31 11:18:10 +00:00
namespace Jellyfin.Api.Formatters;
/// <summary>
/// Pascal Case Json Profile Formatter.
/// </summary>
public class PascalCaseJsonProfileFormatter : SystemTextJsonOutputFormatter
2020-04-20 00:10:59 +00:00
{
/// <summary>
2023-01-31 11:18:10 +00:00
/// Initializes a new instance of the <see cref="PascalCaseJsonProfileFormatter"/> class.
2020-04-20 00:10:59 +00:00
/// </summary>
2023-01-31 11:18:10 +00:00
public PascalCaseJsonProfileFormatter() : base(JsonDefaults.PascalCaseOptions)
2020-04-20 00:10:59 +00:00
{
2023-01-31 11:18:10 +00:00
SupportedMediaTypes.Clear();
// Add application/json for default formatter
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(MediaTypeNames.Application.Json));
SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse(JsonDefaults.PascalCaseMediaType));
2020-04-20 00:10:59 +00:00
}
}