Add PATCH endpoint documentation to minimal API tutorial #36350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #33789
The minimal API tutorial was missing PATCH operation examples despite
MapPatchbeing introduced in .NET 7.Changes
Documentation updates (for .NET 7, 8, 9 monikers):
<xref:web-api/jsonpatch>for advanced scenariosSample code:
snippet_patchtoProgram.csfiles insamples/{7.x,8.x,9.x}/todo/Metadata:
ms.dateto 11/13/2025ai-usage: ai-assistedOriginal prompt
This section details on the original issue you should resolve
<issue_title>Add PATCH to tutorial</issue_title>
<issue_description>### Description
Verbatim:
Page URL
https://learn.microsoft.com/en-us/aspnet/core/tutorials/min-web-api?view=aspnetcore-8.0&tabs=visual-studio
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/min-web-api.md
Document ID
ab408035-6313-a183-9940-32de00e0e977
Article author
@wadepickett</issue_description>
Comments on the Issue (you are @copilot in this section)
@wadepickett AI analysis test run by wadepickett Prompt: verify-issue-set-course-of-action_v.05.md Model: GPT-4 Nov 2023 -------Issue Analysis: Add PATCH to tutorial
Issue Summary
This is a valid issue. The user reports that the minimal API tutorial for ASP.NET Core does not include an example for a PATCH operation, specifically using
MapPatchand (optionally)JsonPatchDocumentin the .NET minimal API template. PATCH support was introduced in .NET 7 but is not demonstrated in the current tutorial.Issue Context and Validation
Article evaluated: Tutorial: Create a minimal API with ASP.NET Core
Source file path:
aspnetcore/tutorials/min-web-api.mdCurrent status:
Recent related/overlapping issues:
No effective workaround or cross-reference: The article does not redirect readers to dedicated PATCH or JsonPatch documentation, so discoverability in the tutorial context is poor.
Has the issue already been addressed?
Affected File(s) and Section(s)
File to update:
aspnetcore/tutorials/min-web-api.mdSections impacted:
Recommended Documentation Update
Add PATCH endpoint to "Overview" Table:
Provide PATCH minimal API sample code:
MapPatchendpoint to the example, updating partial fields for a todo item.JsonPatchDocument<Todo>for advanced partial updates.Update step-by-step instructions:
Add a tip/note block:
[!NOTE] PATCH provides partial updates and can leverage JsonPatch for complex scenarios.Reference dedicated guidance:
Example Code or CLI Snippets (if applicable)
Basic PATCH with direct property assignment (Recommended for tutorial simplicity):