From eee02a355af0760c55dc9c1d42b9f5f623135b08 Mon Sep 17 00:00:00 2001 From: ZadenRB Date: Wed, 22 Apr 2020 10:06:37 -0600 Subject: [PATCH 1/2] Adds produces annotation to the base controller to indicate application/json as the response type for endpoints --- Jellyfin.Api/BaseJellyfinApiController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Jellyfin.Api/BaseJellyfinApiController.cs b/Jellyfin.Api/BaseJellyfinApiController.cs index 1f4508e6cb..51bd384b3b 100644 --- a/Jellyfin.Api/BaseJellyfinApiController.cs +++ b/Jellyfin.Api/BaseJellyfinApiController.cs @@ -7,6 +7,7 @@ namespace Jellyfin.Api /// [ApiController] [Route("[controller]")] + [Produces("application/json")] public class BaseJellyfinApiController : ControllerBase { } From 2066b0f68f96a14d7b5a5e511ce9099c7a1cada7 Mon Sep 17 00:00:00 2001 From: ZadenRB Date: Thu, 23 Apr 2020 16:15:59 -0600 Subject: [PATCH 2/2] Use builtin JSON Mime type constant --- Jellyfin.Api/BaseJellyfinApiController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jellyfin.Api/BaseJellyfinApiController.cs b/Jellyfin.Api/BaseJellyfinApiController.cs index 51bd384b3b..a34f9eb62f 100644 --- a/Jellyfin.Api/BaseJellyfinApiController.cs +++ b/Jellyfin.Api/BaseJellyfinApiController.cs @@ -1,3 +1,4 @@ +using System.Net.Mime; using Microsoft.AspNetCore.Mvc; namespace Jellyfin.Api @@ -7,7 +8,7 @@ namespace Jellyfin.Api /// [ApiController] [Route("[controller]")] - [Produces("application/json")] + [Produces(MediaTypeNames.Application.Json)] public class BaseJellyfinApiController : ControllerBase { }