The Free Software Media System - Server Backend & API
Fix OpenApi generation for BlurHash
crobiberod2d71ac3a177
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.csindex 6cb88c9f73..e5b9620f78 100644--- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs+++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs@@ -285,20 +285,17 @@ namespace Jellyfin.Server.Extensionsprivate static void AddSwaggerTypeMappings(this SwaggerGenOptions options){/*- * TODO remove when System.Text.Json supports non-string keys.- * Used in Jellyfin.Api.Controller.GetChannels.+ * TODO remove when System.Text.Json properly supports non-string keys.+ * Used in BaseItemDto.ImageBlurHashes*/options.MapType<Dictionary<ImageType, string>>(() =>new OpenApiSchema{Type = "object",- Properties = typeof(ImageType).GetEnumNames().ToDictionary(- name => name,- name => new OpenApiSchema- {- Type = "string",- Format = "string"- })+ AdditionalProperties = new OpenApiSchema+ {+ Type = "string"+ }});/*@@ -312,16 +309,10 @@ namespace Jellyfin.Server.Extensionsname => name,name => new OpenApiSchema{- Type = "object", Properties = new Dictionary<string, OpenApiSchema>+ Type = "object",+ AdditionalProperties = new OpenApiSchema{- {- "string",- new OpenApiSchema- {- Type = "string",- Format = "string"- }- }+ Type = "string"}})});