Add OpenAPI binary file response documentation for ASP.NET Core 11.0#36754
Add OpenAPI binary file response documentation for ASP.NET Core 11.0#36754
Conversation
- Added File() to TypedResults helper methods table - Added "Describe binary file responses" section for Minimal APIs - Added "Describe binary file responses" section for Controllers - All new content uses moniker range >= aspnetcore-11.0 - Updated ms.date to 02/06/2026 and added ai-usage metadata Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
Clarify the usage of [ProducesResponseType<FileContentResult>] for binary file responses, specifying that it generates an OpenAPI description similar to the Minimal API example.
|
@copilot,
Also the updated file in this PR:
|
- Created include-metadata10.md with original content for .NET 10.0 - Changed moniker range to "= aspnetcore-10.0" in include file - Updated main file moniker range to ">= aspnetcore-11.0" - Updated content moniker range to ">= aspnetcore-11.0" Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
Completed in commit 085bf15. Created Updated |
Set include for version 10.0 to be preserved as 10.0
Fixed article metadata monikerRange to start at 9.0
Removed moniker directives for ASP.NET Core version 11.0 and updated binary file response descriptions.
Added section on including OpenAPI metadata for endpoints.
Removed reference to include-metadata9.md.
|
@copilot, after the first line which is a monker range, needs to start with this H2 and have a blank like before and after the H2: Include OpenAPI metadata for endpoints |
Added "## Include OpenAPI metadata for endpoints" heading after the moniker range line with blank lines before and after as requested. Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
|
The new content is essentially the two sections at the bottom, located here: The rest is just moving the old version 10 into its own include to make way for v11. |
include-metadata.mdto understand current structureFile()method to the TypedResults table (lines 350-362)>= aspnetcore-11.0ms.date) according to repository conventions>= aspnetcore-11.0Original prompt
This section details on the original issue you should resolve
<issue_title>[11.0 P1] Include OpenAPI metadata: Update for describing binary file responses</issue_title>
<issue_description>Related to #36747
Description
Draft suggestions below:
Feature changes to represent:
Produces<FileContentResult>withcontentType: MediaTypeNames.Application.Octetfor Minimal APIs[ProducesResponseType<FileContentResult>]attribute for ControllersFileContentResultmaps totype: stringandformat: binaryin the OpenAPI schemaRecommended Documentation Updates
Except for updates in older moniker ranges < 11.0 where we are simply providing a note and pointing to the newer topic, all new entries should be in a new moniker range of:
:::moniker range=">= aspnetcore-11.0"
File:
aspnetcore/fundamentals/openapi/include-metadata.mdLocation: After line 366 (after the "A class can be implemented..." sentence), right before the ##### Set responses for ProblemDetails heading at line 368. This way the general-purpose content stays grouped together.
Add the following subsection:
This generates an OpenAPI schema with
type: stringandformat: binaryfor theFileContentResulttype.The generated OpenAPI document describes the endpoint response as:
With
FileContentResultdefined incomponents/schemasas:This generates an OpenAPI schema with
type: stringandformat: binaryfor theFileContentResulttype.Page URL
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/include-metadata?view=aspnetcore-10.0&tabs=minimal-apis
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/openapi/include-metadata.md
Document ID
cbc730ec-642f-480d-4a41-044c6c6ef7d3
Platform Id
4bbf4c77-ca40-25d5-0673-fab1102c2291
Article author
@wadepickett
Metadata
[Related Issues](https://github.com/dotne...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Internal previews