Skip to content

[STJ-3] BREAKING: rewrite Fallout.Utilities.Text.Json on System.Text.Json #116

Description

@ChrisonSimtian

Sub-task of #83 (Newtonsoft.Json → System.Text.Json migration). Breaking change for downstream consumers.

Scope

Rewrite src/Fallout.Utilities.Text.Json to use System.Text.Json instead of Newtonsoft. This changes the public API surface of Fallout.Utilities.Text.Json — the consumer-facing extension methods currently return Newtonsoft JObject and accept Newtonsoft JsonSerializerSettings; they would return STJ JsonObject and accept JsonSerializerOptions instead.

Files to rewrite

  • JsonExtensions.csDefaultSerializerSettingsDefaultSerializerOptions; ToJson / GetJson / ReadJson / WriteJson / UpdateJson signatures updated; type aliases swap (JObject ↔ JsonObject)
  • JObject.GetChildren.csJsonObject.GetChildren.cs
  • JObject.GetPropertyValue.csJsonObject.GetPropertyValue.cs
  • Object.ToJObject.csObject.ToJsonNode.cs (or similar)
  • Base64JsonConverter.cs — internal JsonConvert.DeserializeObject<T>JsonSerializer.Deserialize<T>
  • AllWritableContractResolver.cs — Newtonsoft-specific concept (DefaultContractResolver). May be deletable; if needed, replace with JsonTypeInfo modifier (STJ source-gen approach).

Blocks

Once STJ-3 lands, the following can be unblocked:

  • STJ-4 (Fallout.Tooling migration — heavy user of utility-lib APIs)
  • STJ-5 (Fallout.Tooling.Generator)
  • Remaining utility-lib consumers from STJ-2

Acceptance

  • Six files rewritten
  • Newtonsoft.Json PackageReference removed from Fallout.Utilities.Text.Json.csproj
  • All in-repo consumers of the utility lib updated to the new API in the same PR (or follow-up PRs that land before the major release)
  • Breaking-change entry added to migration guide / changelog
  • Decision recorded on whether to ship as 11.0 (breaking-change major) or differently

Notes

The earlier attempt at this (commit 7f6125, branch feature/migrate-to-system-text-json) showed 26 cascading compile errors in consumers. Each is mechanical to fix, but the work needs proper time-budget — see the scoping summary in PR #111 for the full assessment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions