Skip to content

Obsolete JsonPatch STJ OperationBase.ShouldSerializeFrom - #67984

Merged
Youssef1313 merged 5 commits into
mainfrom
copilot/obsolete-operations-method-shouldserializefrom
Jul 27, 2026
Merged

Youssef1313 merged 5 commits into
mainfrom
copilot/obsolete-operations-method-shouldserializefrom

Conversation

Copilot AI commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #67966

This method appears to have been unintentionally copied from the older Newtonsoft.Json implementation.

Copilot AI changed the title [WIP] Remove obsolete OperationBase.ShouldSerializeFrom method Obsolete JsonPatch STJ OperationBase.ShouldSerializeFrom Jul 23, 2026
Copilot AI requested a review from Youssef1313 July 23, 2026 16:46
@Youssef1313
Youssef1313 marked this pull request as ready for review July 24, 2026 06:14
Copilot AI review requested due to automatic review settings July 24, 2026 06:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Deprecates the STJ-only OperationBase.ShouldSerializeFrom() API in JsonPatch.SystemTextJson (a Newtonsoft-style conditional serialization artifact) while preserving runtime behavior, and adds a unit test to lock in the intended deprecation guidance.

Changes:

  • Marked OperationBase.ShouldSerializeFrom() as [Obsolete] with migration guidance (OperationType is Move or Copy).
  • Added a unit test verifying the method is annotated with ObsoleteAttribute and that the message matches exactly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Features/JsonPatch.SystemTextJson/src/Operations/OperationBase.cs Adds [Obsolete] to ShouldSerializeFrom() (with migration guidance); minor cleanup needed for now-outdated comment.
src/Features/JsonPatch.SystemTextJson/test/OperationBaseTests.cs Adds a focused test that asserts the ObsoleteAttribute presence and message content.

@Youssef1313
Youssef1313 merged commit 3cc4839 into main Jul 27, 2026
24 checks passed
@Youssef1313
Youssef1313 deleted the copilot/obsolete-operations-method-shouldserializefrom branch July 27, 2026 12:48
@Youssef1313

Copy link
Copy Markdown
Member

/backport to release/11.0-preview7

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0-preview7 (link to workflow run)

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.

Obsolete OperationBase.ShouldSerializeFrom from JsonPatch.STJ

4 participants