Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

  • Analyze the current usage of Newtonsoft.Json in TestTokenCreator.cs
  • Replace Newtonsoft.Json imports with System.Text.Json in TestTokenCreator.cs
  • Replace JObject and JToken usage with System.Text.Json equivalents in CreateJsonPayload method
  • Update Microsoft.IdentityModel.TestExtensions.csproj to remove Newtonsoft.Json reference
  • Add System.Text.Json reference to Microsoft.IdentityModel.TestExtensions.csproj with proper conditional targeting
  • Add IL2026 and IL3050 to NoWarn to suppress AOT warnings (TestExtensions is a test utility library)
  • Add explanatory comment for NoWarn suppressions in csproj file
  • Build the TestExtensions project to verify compilation
  • Run tests that use TestTokenCreator to ensure functionality is preserved
  • Verify no other files in TestExtensions use Newtonsoft.Json
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature Request] Migrate Microsoft.IdentityModel.TestExtensions to System.Text.Json</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

Microsoft.IdentityModel.TestExtensions should be migrated off of Newtonsoft.Json and instead should use System.Text.Json.

  • TestTokenCreator.cs should replace usage of Newtonsoft.Json with System.Text.Json
  • Microsoft.IdentityModel.TestExtensions.csproj should remove the reference for Newtonsoft.Json and add a reference to System.Text.Json as so:
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
--
<PackageReference Include="System.Text.Json" Version="$(SystemTextJson)" />
</ItemGroup>

</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #3355


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Migrate Microsoft.IdentityModel.TestExtensions to System.Text.Json Migrate Microsoft.IdentityModel.TestExtensions from Newtonsoft.Json to System.Text.Json Oct 19, 2025
Copilot AI requested a review from keegan-caruso October 19, 2025 23:45
@keegan-caruso keegan-caruso marked this pull request as ready for review October 21, 2025 17:08
@keegan-caruso keegan-caruso requested a review from a team as a code owner October 21, 2025 17:08
Copy link
Contributor

@kllysng kllysng left a comment

Choose a reason for hiding this comment

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

The changes for this package lgtm. Question - will we do this for the other packages too?

@keegan-caruso
Copy link
Contributor

The changes for this package lgtm. Question - will we do this for the other packages too?

I believe this is the only src/ package using Newtonsoft through a nuget package. There are many examples in test/ that would be good to clean up later.

This was referenced Dec 15, 2025
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.

[Task] Migrate Microsoft.IdentityModel.TestExtensions to System.Text.Json

4 participants