Skip to content

Conversation

@JamieMagee
Copy link
Member

@JamieMagee JamieMagee commented Nov 22, 2025

Prepare codebase for migration to System.Text.Json by adding JsonPropertyName attributes to all serializable models while maintaining Newtonsoft.Json compatibility.

Changes:

  • Add JsonPropertyName attributes to serializable model properties
  • Add JsonIgnore(Condition.WhenWritingNull) to optional properties
  • Explicitly specify [JsonConverter(typeof(JsonStringEnumConverter))] for serializable enums

All serialization tests pass. Both Newtonsoft.Json and System.Text.Json attributes now coexist, enabling gradual migration.

Prepare codebase for migration to System.Text.Json by adding `JsonPropertyName` attributes to all serializable models while maintaining `Newtonsoft.Json` compatibility.

Changes:
- Add `JsonPropertyName` attributes to serializable model properties
- Add `JsonIgnore(Condition.WhenWritingNull)` to optional properties
- Explicitly specify `[JsonConverter(typeof(JsonStringEnumConverter))]` for serializable enums

All serialization tests pass. Both `Newtonsoft.Json` and `System.Text.Json` attributes now coexist, enabling gradual migration.
@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.2%. Comparing base (2a8103b) to head (1a0f458).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1556   +/-   ##
=====================================
  Coverage   90.2%   90.2%           
=====================================
  Files        426     426           
  Lines      35965   35965           
  Branches    2216    2216           
=====================================
+ Hits       32463   32465    +2     
  Misses      3045    3045           
+ Partials     457     455    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot finished reviewing on behalf of JamieMagee November 22, 2025 03:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prepares the codebase for migration from Newtonsoft.Json to System.Text.Json by adding JsonPropertyName and JsonConverter attributes alongside existing Newtonsoft.Json attributes. The changes span serializable models across detector contracts, typed components, and BCDE models, maintaining backward compatibility during the transition.

Key changes:

  • Added System.Text.Json.Serialization.JsonPropertyName attributes to all serializable properties
  • Added System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter)) to enums
  • Added JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull) to nullable properties alongside Newtonsoft.Json's NullValueHandling.Ignore

Reviewed changes

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

Show a summary per file
File Description
vcpkg/Contracts/ManifestInfo.cs Added JsonPropertyName for manifest-path property
swiftpm/Contracts/SwiftResolvedFile.cs Added JsonPropertyName to all Swift package resolution properties
pip/Contracts/*.cs Added JsonPropertyName to Python package metadata properties
TypedComponent/*.cs Added JsonPropertyName to component type properties across all ecosystems
BcdeModels/*.cs Added JsonPropertyName to scan result and container detail properties with camelCase naming
ComponentType.cs, ProcessingResultCode.cs, DependencyScope.cs Added JsonConverter(typeof(JsonStringEnumConverter)) for enum serialization

@github-actions
Copy link

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

@JamieMagee JamieMagee requested a review from Copilot November 22, 2025 04:02
Copilot finished reviewing on behalf of JamieMagee November 22, 2025 04:05
@JamieMagee JamieMagee enabled auto-merge (squash) November 22, 2025 04:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated no new comments.

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.

2 participants