diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2022-03-23 15:24:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-23 15:24:31 -0400 |
| commit | 945fb8b72e87aaa91b4301fbe32c272b87c35ba5 (patch) | |
| tree | 6223491969dfd1dfee64e0f17d90b98a8d71768a | |
| parent | 7fb21132dd8840dcdac48d81c14c822d16708477 (diff) | |
| parent | 72cfa6d7c94dbae58e29a0abc639eb369ff7527f (diff) | |
Merge pull request #7488 from crobibero/flag-enum-openapi
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index fa98fda69..3df8481fd 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -29,6 +29,7 @@ using Jellyfin.Server.Filters; using Jellyfin.Server.Formatters; using MediaBrowser.Common.Net; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Session; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; @@ -428,6 +429,17 @@ namespace Jellyfin.Server.Extensions Nullable = true } }); + + // Manually describe Flags enum. + options.MapType<TranscodeReason>(() => + new OpenApiSchema + { + Type = "string", + Enum = Enum.GetNames<TranscodeReason>() + .Select(e => new OpenApiString(e)) + .Cast<IOpenApiAny>() + .ToArray() + }); } } } |
