add back FileStreamability

This commit is contained in:
honzapatCZ 2025-01-12 20:12:18 +01:00
parent a203c2b6d1
commit 4c7a280230

View File

@ -86,6 +86,18 @@ namespace NejCommon.Controllers
operation.Responses.Add("401", new OpenApiResponse { Description = ReasonPhrases.GetReasonPhrase(401) });
}
var generics = actionReturnType.GetGenericArguments();
foreach (var generic in generics)
{
if (generic == typeof(FileStreamHttpResult))
{
var statusCode = "200";
var oar = new OpenApiResponse { Description = GetResponseDescription(statusCode) };
oar.Content.Add( "application/octet-stream", new OpenApiMediaType { Schema = new OpenApiSchema { Type = "string", Format = "binary" } });
operation.Responses.Add(statusCode, oar);
}
}
}
private static bool IsControllerAction(OperationFilterContext context)