diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-18 22:39:49 +0100 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-02-18 22:39:49 +0100 |
| commit | 94dcaf2ea24e428f2957674ac46b864625782194 (patch) | |
| tree | b4ed7aca02713bc42886f517657cd46efc66b73d /Jellyfin.Server/Filters/FileResponseFilter.cs | |
| parent | 6829794aa09f62d1e15a568e31d91d8f81e3ed35 (diff) | |
Upgrade Swashbuckle to v10
Diffstat (limited to 'Jellyfin.Server/Filters/FileResponseFilter.cs')
| -rw-r--r-- | Jellyfin.Server/Filters/FileResponseFilter.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Jellyfin.Server/Filters/FileResponseFilter.cs b/Jellyfin.Server/Filters/FileResponseFilter.cs index cd0acadf32..64aea62519 100644 --- a/Jellyfin.Server/Filters/FileResponseFilter.cs +++ b/Jellyfin.Server/Filters/FileResponseFilter.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using Jellyfin.Api.Attributes; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi; using Swashbuckle.AspNetCore.SwaggerGen; namespace Jellyfin.Server.Filters @@ -14,7 +14,7 @@ namespace Jellyfin.Server.Filters { Schema = new OpenApiSchema { - Type = "string", + Type = JsonSchemaType.String, Format = "binary" } }; @@ -22,6 +22,11 @@ namespace Jellyfin.Server.Filters /// <inheritdoc /> public void Apply(OpenApiOperation operation, OperationFilterContext context) { + if (operation.Responses is null) + { + return; + } + foreach (var attribute in context.ApiDescription.ActionDescriptor.EndpointMetadata) { if (attribute is ProducesFileAttribute producesFileAttribute) @@ -31,7 +36,7 @@ namespace Jellyfin.Server.Filters .FirstOrDefault(o => o.Key.Equals(SuccessCode, StringComparison.Ordinal)); // Operation doesn't have a response. - if (response.Value is null) + if (response.Value?.Content is null) { continue; } |
