[release/10.0] Revert IEndpointParameterMetadataProvider on Newtonsoft JsonPatchDocument#65674
Merged
wtgodbe merged 3 commits intorelease/10.0from Mar 6, 2026
Merged
Conversation
…onPatchDocument types - Remove IEndpointParameterMetadataProvider implementation from JsonPatchDocument and JsonPatchDocument<T> - Remove Microsoft.AspNetCore.Http.Abstractions reference from JsonPatch.csproj - Add end-to-end content type tests for both Newtonsoft and SystemTextJson JsonPatch - Update test csproj files with required references (resolving merge conflicts) - Add DoesNotContain assertions to OpenApi tests for custom content types Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Backport PR 65559 to release/10.0 branch
Backport #65559: Revert IEndpointParameterMetadataProvider on Newtonsoft JsonPatchDocument
Mar 6, 2026
halter73
approved these changes
Mar 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Backports the fix to release/10.0 that removes IEndpointParameterMetadataProvider from the Newtonsoft-based JsonPatchDocument types to restore pre-10.0 content-type behavior (avoiding 415 for application/json) and to remove the added Http.Abstractions dependency that breaks Blazor WASM builds.
Changes:
- Remove
IEndpointParameterMetadataProviderimplementations from NewtonsoftJsonPatchDocument/JsonPatchDocument<T>. - Drop the
Microsoft.AspNetCore.Http.Abstractionsreference from the Newtonsoft JsonPatch package project. - Add end-to-end tests (and adjust OpenAPI tests) to validate content-type handling for Newtonsoft vs SystemTextJson variants.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiDocumentService/OpenApiDocumentServiceTests.RequestBody.cs | Updates OpenAPI tests to ensure explicit Accepts/Consumes overrides don’t retain inferred JsonPatch media types. |
| src/Features/JsonPatch/test/Microsoft.AspNetCore.JsonPatch.Tests.csproj | Adds .NETCoreApp-only assembly references needed for new end-to-end tests. |
| src/Features/JsonPatch/test/JsonPatchContentTypeEndToEndTest.cs | Adds end-to-end coverage verifying Newtonsoft JsonPatch accepts both application/json-patch+json and application/json. |
| src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj | Removes Microsoft.AspNetCore.Http.Abstractions reference from the Newtonsoft JsonPatch package. |
| src/Features/JsonPatch/src/JsonPatchDocumentOfT.cs | Reverts endpoint-parameter metadata provider implementation for generic Newtonsoft JsonPatchDocument. |
| src/Features/JsonPatch/src/JsonPatchDocument.cs | Reverts endpoint-parameter metadata provider implementation for non-generic Newtonsoft JsonPatchDocument. |
| src/Features/JsonPatch.SystemTextJson/test/Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests.csproj | Adds assembly references needed for new end-to-end tests in the SystemTextJson test project. |
| src/Features/JsonPatch.SystemTextJson/test/JsonPatchContentTypeEndToEndTest.cs | Adds end-to-end coverage verifying SystemTextJson JsonPatch remains strict (rejects application/json). |
...ore.OpenApi.Tests/Services/OpenApiDocumentService/OpenApiDocumentServiceTests.RequestBody.cs
Show resolved
Hide resolved
src/Features/JsonPatch/test/Microsoft.AspNetCore.JsonPatch.Tests.csproj
Outdated
Show resolved
Hide resolved
...res/JsonPatch.SystemTextJson/test/Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
DeagleGross
approved these changes
Mar 6, 2026
BrennanConroy
approved these changes
Mar 6, 2026
Member
|
Approved over email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #65559 to release/10.0
Remove
IEndpointParameterMetadataProviderfrom NewtonsoftJsonPatchDocumenttypes to fix content-type regression and Blazor WASM build regressionDescription
The
IEndpointParameterMetadataProvideradded to the NewtonsoftJsonPatchDocumenttypes in 10.0 causes two problems:application/jsoncontent type are now rejected. Previously accepted.Microsoft.AspNetCore.Http.Abstractionsdependency fails to resolve in Blazor WASM projects.This reverts the
IEndpointParameterMetadataProviderimplementation and removes theHttp.Abstractionsreference from the Newtonsoft package. The SystemTextJsonJsonPatchDocumenttypes are unaffected — all SystemTextJson changes are test-only.Fixes #65325
Fixes #64330
Customer Impact
Customers using
Microsoft.AspNetCore.JsonPatchwith minimal APIs and MVC hit 415 responses for previously-workingapplication/jsonrequests. Blazor WASM projects referencing the package fail to build. Both issues have been reported by customers and block upgrades to .NET 10.Regression?
Regressed from .NET 9.0. Introduced when
IEndpointParameterMetadataProviderwas added to the NewtonsoftJsonPatchDocumenttypes in 10.0.Risk
Straight revert of the added behavior. Restores pre-10.0 content-type handling. No impact to the SystemTextJson variant.
Verification
New end-to-end tests verify content-type acceptance/rejection for both Newtonsoft and SystemTextJson variants. All existing tests pass (262 + 210 + 14 OpenApi).
Packaging changes reviewed?
Removes
Microsoft.AspNetCore.Http.Abstractionsfrom the NewtonsoftJsonPatchpackage — correct since the interface implementation is removed.