Migrates the AdaptiveCards .NET library from Newtonsoft.Json to System.Text.Json#9359
Closed
Copilot wants to merge 3 commits intouser/philnach/NewtonSoftTransitivefrom
Closed
Migrates the AdaptiveCards .NET library from Newtonsoft.Json to System.Text.Json#9359Copilot wants to merge 3 commits intouser/philnach/NewtonSoftTransitivefrom
Copilot wants to merge 3 commits intouser/philnach/NewtonSoftTransitivefrom
Conversation
…efaults, IsVisible roundtrip Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
…xact JSON pattern Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Migrate AdaptiveCards .NET library to System.Text.Json
Migrates the AdaptiveCards .NET library from Newtonsoft.Json to System.Text.Json
Mar 6, 2026
Member
|
I merged these into #9357 |
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.
Related Issue
Description
Migrates the AdaptiveCards .NET library from Newtonsoft.Json to System.Text.Json, removing the transitive Newtonsoft.Json dependency while maintaining behavioral parity.
Core Migration
[JsonProperty],[JsonConverter], and related Newtonsoft.Json attributes with System.Text.Json equivalents across all model classesJsonConverter<T>APIAdaptiveActionPolymorphicConverter,AdaptiveCollectionElementConverterFactory, andAdaptiveCardSerializationContextfor polymorphic type handlingSafeJsonHelper(duplicate-key-safeJsonObjectconstruction) andWarningContextBug Fixes (post-review)
AdaptiveFallbackConverter.IsInFallbackwas a shared static; concurrent parses could corrupt the fallback flag. Fixed with[ThreadStatic]backing field.AdaptiveCollectionElementConverter.Writeignored per-propertyWhenWritingNull/WhenWritingDefaultconditions, emitting noise like"separator": false,"bleed": false,"horizontalAlignment": "Left". Fixed by reading each property'sJsonIgnoreAttribute.Conditionand falling back tooptions.DefaultIgnoreCondition.IsVisible = falseroundtrip regression:[JsonIgnore(Condition = WhenWritingDefault)]on aboolskipsfalse(the type default), causing hidden elements to reappear after parse. Removed the condition;isVisibleis now always serialized.WPF Renderer & Visualizer
double?change onAdaptiveNumberInputand fixedJsonNode.MergeInternalIDnull safety and indexer skip logicMessageBoxwith a selectable/copyableTextBoxUseShellExecuteforProcess.Starton .NET 6Sample Card
No new sample card needed. Existing
samples/cards were used to validate serialization/deserialization parity.How Verified
SystemTextJsonMigrationTests(816+ lines) covering round-trip serialization, polymorphic deserialization, edge cases, and parity with prior Newtonsoft.Json behavior; plus three targeted regression tests:ConcurrentFallbackParsing_IsThreadSafe— 10 threads × 50 iterationsCollectionElements_DefaultPropertiesAreNotSerialized— assertsseparator,bleed,horizontalAlignment,verticalContentAlignmentabsent at defaults; non-defaults still round-tripIsVisible_False_RoundtripsCorrectly— asserts"isVisible":falsepresent in JSON and survives parseAdaptiveCards.Testpass (166 pass; 3 pre-existingDirectoryNotFoundExceptionfailures unrelated to this change)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.