Skip to content

[release/10.0] Revert IEndpointParameterMetadataProvider on Newtonsoft JsonPatchDocument#65674

Merged
wtgodbe merged 3 commits intorelease/10.0from
copilot/backport-merge-conflict-resolution
Mar 6, 2026
Merged

[release/10.0] Revert IEndpointParameterMetadataProvider on Newtonsoft JsonPatchDocument#65674
wtgodbe merged 3 commits intorelease/10.0from
copilot/backport-merge-conflict-resolution

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

Backport of #65559 to release/10.0

Remove IEndpointParameterMetadataProvider from Newtonsoft JsonPatchDocument types to fix content-type regression and Blazor WASM build regression

Description

The IEndpointParameterMetadataProvider added to the Newtonsoft JsonPatchDocument types in 10.0 causes two problems:

  • 415 regression: Requests with application/json content type are now rejected. Previously accepted.
  • Blazor WASM build break: The new Microsoft.AspNetCore.Http.Abstractions dependency fails to resolve in Blazor WASM projects.

This reverts the IEndpointParameterMetadataProvider implementation and removes the Http.Abstractions reference from the Newtonsoft package. The SystemTextJson JsonPatchDocument types are unaffected — all SystemTextJson changes are test-only.

Fixes #65325
Fixes #64330

Customer Impact

Customers using Microsoft.AspNetCore.JsonPatch with minimal APIs and MVC hit 415 responses for previously-working application/json requests. Blazor WASM projects referencing the package fail to build. Both issues have been reported by customers and block upgrades to .NET 10.

Regression?

  • Yes
  • No

Regressed from .NET 9.0. Introduced when IEndpointParameterMetadataProvider was added to the Newtonsoft JsonPatchDocument types in 10.0.

Risk

  • High
  • Medium
  • Low

Straight revert of the added behavior. Restores pre-10.0 content-type handling. No impact to the SystemTextJson variant.

Verification

  • Manual (required)
  • Automated

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?

  • Yes
  • No
  • N/A

Removes Microsoft.AspNetCore.Http.Abstractions from the Newtonsoft JsonPatch package — correct since the interface implementation is removed.

@github-actions github-actions bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 6, 2026
…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 halter73 changed the title Backport #65559: Revert IEndpointParameterMetadataProvider on Newtonsoft JsonPatchDocument [release/10.0] Revert IEndpointParameterMetadataProvider on Newtonsoft JsonPatchDocument Mar 6, 2026
@halter73 halter73 marked this pull request as ready for review March 6, 2026 02:38
@halter73 halter73 requested a review from a team as a code owner March 6, 2026 02:38
Copilot AI review requested due to automatic review settings March 6, 2026 02:38
@halter73 halter73 added the Servicing-consider Shiproom approval is required for the issue label Mar 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IEndpointParameterMetadataProvider implementations from Newtonsoft JsonPatchDocument / JsonPatchDocument<T>.
  • Drop the Microsoft.AspNetCore.Http.Abstractions reference 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).

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@wtgodbe wtgodbe added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Mar 6, 2026
@wtgodbe
Copy link
Member

wtgodbe commented Mar 6, 2026

Approved over email

@wtgodbe wtgodbe merged commit ca933ee into release/10.0 Mar 6, 2026
28 checks passed
@wtgodbe wtgodbe deleted the copilot/backport-merge-conflict-resolution branch March 6, 2026 20:12
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0.5 milestone Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants