add back FileStreamability
This commit is contained in:
parent
a203c2b6d1
commit
4c7a280230
|
|
@ -86,6 +86,18 @@ namespace NejCommon.Controllers
|
||||||
operation.Responses.Add("401", new OpenApiResponse { Description = ReasonPhrases.GetReasonPhrase(401) });
|
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)
|
private static bool IsControllerAction(OperationFilterContext context)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user