Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add System.Text.Json serialization/deserialization supports #10217

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Sep 20, 2024

This draft PR intended to add functionality for gradual migration from Newtonsoft.Json to System.Text.Json. (Related issue #9727)

1. Commit (b3c5282)

  • Refactor JsonUtility related code to support switching NewtonsoftJson/SystemTextJson by type.

2. Commit (f47673c)

  • Add test infrastructure code to validate serialization/deserialization results.
  • Validate JSON serialization results has no diffs between Newtonsoft.Json/SystemTextJson.
  • Validate JSON serialize/deserialize roundtrip result object comparison between Newtonsoft.Json/SystemTextJson.
  • Validate YAML related roundtrip results. (Object->YAML->Object and Object->JSON->Object)

3. Commit (165bb8a)

  • Switch XRefMap serialization/deserialization to use JsonUtility and System.Text.Json.
  • Add XRefMap serialization/deserialization tests.

4. Commit (3b3bd35)

  • Add JSON serialization/deserialization round trip tests with JsonUtility

5. Commit (aece12e)

  • Add System.Text.Json based serialization/deserialization for MarkdigExtensionSetting.

6. Commit (f636b8d)

  • Add System.Text.Json based serialization/deserialization for ManagedReference.PageViewModel
    • Modify CompositeDictionary related property to add private init and JsonInclude attribute
      (It's required because System.Text.Json can't deserialize getter-only property)

TODO:

  • Add JsonConverter for System.Text.Json
  • Verify serialization/deserialization compatibility by unit tests.
  • Switch to use System.Text.Json based serialization/deserialization for other types.

@filzrev filzrev force-pushed the feature/add-system-text-json-supports branch from 46ab297 to cab3a99 Compare September 26, 2024 22:45
@filzrev filzrev force-pushed the feature/add-system-text-json-supports branch from cab3a99 to e137e2d Compare September 26, 2024 22:48
@filzrev filzrev force-pushed the feature/add-system-text-json-supports branch from e137e2d to fed5d64 Compare September 26, 2024 22:48
@filzrev filzrev force-pushed the feature/add-system-text-json-supports branch from fed5d64 to e7c8a77 Compare September 27, 2024 12:29
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.

1 participant