Skip to content

Correct browser content negotiation formatter selection documentation#1

Merged
HenryZhang-ZHY merged 2 commits intofix/formattingfrom
copilot/update-formatting-documentation
Jan 7, 2026
Merged

Correct browser content negotiation formatter selection documentation#1
HenryZhang-ZHY merged 2 commits intofix/formattingfrom
copilot/update-formatting-documentation

Conversation

Copy link

Copilot AI commented Jan 7, 2026

The documentation incorrectly stated that browser requests return JSON by default. The framework actually uses the first registered output formatter that can handle the response type.

Changes

  • Updated "Browsers and content negotiation" section across all moniker ranges (>= aspnetcore-7.0, >= aspnetcore-6.0 < aspnetcore-7.0, < aspnetcore-6.0)
  • Changed misleading statement from "The content is returned in JSON" to "The content is returned using the first registered output formatter that can handle the response type"
  • Updated metadata: ai-usage and ms.date

The corrected text now accurately reflects ASP.NET Core's formatter selection behavior:

* The `Accept` header is ignored.
* The content is returned using the first registered output formatter that can handle the response type, unless otherwise configured.
Original prompt

The documentation in aspnetcore/web-api/advanced/formatting.md incorrectly states that when a request comes from a browser, the content is returned in JSON by default.

The current text says:

  • The content is returned in JSON, unless otherwise configured.

This should be updated to reflect that the framework selects the first registered output formatter that can handle the response type.

Please update the "Browsers and content negotiation" section in aspnetcore/web-api/advanced/formatting.md for all moniker ranges (>= aspnetcore-6.0 < aspnetcore-7.0, < aspnetcore-6.0, and >= aspnetcore-7.0).

Change:

* The `Accept` header is ignored.
* The content is returned in JSON, unless otherwise configured.

To:

* The `Accept` header is ignored.
* The content is returned using the first registered output formatter that can handle the response type, unless otherwise configured.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Jan 7, 2026
@HenryZhang-ZHY HenryZhang-ZHY changed the base branch from main to fix/formatting January 7, 2026 07:36
- Correct documentation to reflect that the framework selects the first registered output formatter
- Update all three moniker ranges (aspnetcore-6.0, aspnetcore-7.0, and earlier versions)
- Update metadata with ai-usage tag and current date

Co-authored-by: HenryZhang-ZHY <62298214+HenryZhang-ZHY@users.noreply.github.com>
Copilot AI changed the title [WIP] Update browser content negotiation documentation for accuracy Correct browser content negotiation formatter selection documentation Jan 7, 2026
Copilot AI requested a review from HenryZhang-ZHY January 7, 2026 07:39
@HenryZhang-ZHY HenryZhang-ZHY marked this pull request as ready for review January 7, 2026 07:40
@HenryZhang-ZHY HenryZhang-ZHY merged commit b5b85d4 into fix/formatting Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants