From 5a658cf260c18c8f17e2ffc02af43832b9076a53 Mon Sep 17 00:00:00 2001 From: ZadenRB Date: Sun, 12 Apr 2020 19:17:46 -0600 Subject: [PATCH] Fix casing of JSON in Jellyfin API. Currently only affects startup wizard. --- Jellyfin.Api/Controllers/StartupController.cs | 1 + Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Jellyfin.Api/Controllers/StartupController.cs b/Jellyfin.Api/Controllers/StartupController.cs index afc9b8f3da..4e515bd8d8 100644 --- a/Jellyfin.Api/Controllers/StartupController.cs +++ b/Jellyfin.Api/Controllers/StartupController.cs @@ -6,6 +6,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; namespace Jellyfin.Api.Controllers { diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index dd4f9cd238..8e124d0701 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -71,6 +71,10 @@ namespace Jellyfin.Server.Extensions // Clear app parts to avoid other assemblies being picked up .ConfigureApplicationPartManager(a => a.ApplicationParts.Clear()) .AddApplicationPart(typeof(StartupController).Assembly) + .AddJsonOptions(options => + { + options.JsonSerializerOptions.PropertyNamingPolicy = null; + }) .AddControllersAsServices(); }