From 21c19bab41b95f5d78d72071ed854ed4bcf5aaab Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Fri, 28 Oct 2022 22:39:00 -0400 Subject: Backport pull request #8611 from jellyfin/release-10.8.z Fix TranscodeReasons type in OpenAPI output Original-merge: c86d5838becf19ba59303d47dac4a62836b44ea2 Merged-by: Claus Vium Backported-by: Joshua M. Boniface --- .../Extensions/ApiServiceCollectionExtensions.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Jellyfin.Server/Extensions') diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index 66fa3bc31..f74152405 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -434,11 +434,15 @@ namespace Jellyfin.Server.Extensions options.MapType(() => new OpenApiSchema { - Type = "string", - Enum = Enum.GetNames() - .Select(e => new OpenApiString(e)) - .Cast() - .ToArray() + Type = "array", + Items = new OpenApiSchema + { + Reference = new OpenApiReference + { + Id = nameof(TranscodeReason), + Type = ReferenceType.Schema, + } + } }); // Swashbuckle doesn't use JsonOptions to describe responses, so we need to manually describe it. -- cgit v1.2.3