diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-02-26 19:31:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-26 19:31:02 +0100 |
| commit | c11c33e1a8facc612d8d37b1e6d79e8f20edc238 (patch) | |
| tree | 3126a7df13d8baa5a18267bc0213555c15c23a79 /Jellyfin.Server/Filters/FileResponseFilter.cs | |
| parent | e8232d31ab5367de015a85e4c52f18e1b883297d (diff) | |
| parent | 94dcaf2ea24e428f2957674ac46b864625782194 (diff) | |
Merge pull request #16256 from Shadowghost/upgrade-swashbuckle
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; } |
