diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2020-12-02 00:04:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-02 00:04:05 +0100 |
| commit | 28373504da001b44aa5b19deee986bfde4776912 (patch) | |
| tree | 4733eacdc7e5090b5f149187ff72d53459d89781 /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | |
| parent | 513a9e2857fbcc1f2157635592ae31928f9bf491 (diff) | |
| parent | d2d71ac3a17716bceed13855261e015cdc46ed42 (diff) | |
Merge pull request #4625 from crobibero/api-docs-description
Fix OpenApi generation for BlurHash
Diffstat (limited to 'Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs')
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index 6cb88c9f7..e5b9620f7 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -285,20 +285,17 @@ namespace Jellyfin.Server.Extensions private 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.Extensions name => 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" } }) }); |
