diff options
| author | Cody Robibero <cody@robibe.ro> | 2020-04-29 07:38:18 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-29 07:38:18 -0600 |
| commit | d491b1b45fc813cb3bd1fe87918f693897621555 (patch) | |
| tree | 4bb52a35e9cd7cd0326c6c89d80b5349b3dfee0a /Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs | |
| parent | 068368df6352cfad4e69df599c364b3f05b367ba (diff) | |
| parent | 2cb0f6f1263cabee288ab30109b55c57e24c7ed0 (diff) | |
Merge branch 'api-migration' into redoc
Diffstat (limited to 'Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs')
| -rw-r--r-- | Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs b/Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs new file mode 100644 index 000000000..e6ad6dfb1 --- /dev/null +++ b/Jellyfin.Server/Formatters/CamelCaseJsonProfileFormatter.cs @@ -0,0 +1,21 @@ +using Jellyfin.Server.Models; +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> + public CamelCaseJsonProfileFormatter() : base(JsonOptions.CamelCase) + { + SupportedMediaTypes.Clear(); + SupportedMediaTypes.Add(MediaTypeHeaderValue.Parse("application/json;profile=\"CamelCase\"")); + } + } +} |
