You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASP.NET Core 11 introduces support for generating OpenAPI descriptions for operations that return binary file responses. This support maps the `FileContentResult` result type to an OpenAPI schema with `type: string` and `format: binary`.
4
+
5
+
#### [Minimal APIs](#tab/minimal-apis)
6
+
7
+
Use the `Produces<T>` extension method with `T` of `FileContentResult` to specify the response type and content type:
8
+
<!-- UPDATE 11.0 - API cross-link needs to be entered in the line above for the new API
9
+
such as: <xref:Microsoft.AspNetCore.NEW_API_TO_BE_ENTERED_>
10
+
-->
11
+
12
+
```csharp
13
+
app.MapPost("/filecontentresult", () =>
14
+
{
15
+
varcontent="This endpoint returns a FileContentResult!"u8.ToArray();
0 commit comments