jellyfin/Jellyfin.Api/Formatters/PascalCaseJsonProfileFormatter.cs

24 lines
824 B
C#
Raw Normal View History

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