Skip to content

Migrate from Newtonsoft.Json to System.Text.Json#32

Merged
jonathan-kosgei merged 1 commit intomasterfrom
claude/migrate-ipdata-references-TUE1b
Feb 23, 2026
Merged

Migrate from Newtonsoft.Json to System.Text.Json#32
jonathan-kosgei merged 1 commit intomasterfrom
claude/migrate-ipdata-references-TUE1b

Conversation

@jonathan-kosgei
Copy link
Collaborator

Replace Newtonsoft.Json 12.0.2 (which has a known high severity vulnerability) with System.Text.Json 4.7.2. This removes the external dependency for consumers on modern .NET while resolving GHSA-5crp-9r3c-p9vr.

  • Replace [JsonProperty] with [JsonPropertyName] across all models
  • Rewrite internal JsonSerializer to use System.Text.Json APIs
  • Update IPLookupResult.FieldName reflection to use JsonPropertyNameAttribute
  • Handle null-ignoring via JsonSerializerOptions.IgnoreNullValues
  • Update csproj and nuspec dependencies

Closes #12
Closes #2

https://claude.ai/code/session_013C9LnDefoZu8s7V61xAfGR

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to IPData?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Replace Newtonsoft.Json 12.0.2 (which has a known high severity
vulnerability) with System.Text.Json 4.7.2. This removes the external
dependency for consumers on modern .NET while resolving GHSA-5crp-9r3c-p9vr.

- Replace [JsonProperty] with [JsonPropertyName] across all models
- Rewrite internal JsonSerializer to use System.Text.Json APIs
- Update IPLookupResult.FieldName reflection to use JsonPropertyNameAttribute
- Handle null-ignoring via JsonSerializerOptions.IgnoreNullValues
- Update csproj and nuspec dependencies

Closes #12
Closes #2

https://claude.ai/code/session_013C9LnDefoZu8s7V61xAfGR
@jonathan-kosgei jonathan-kosgei merged commit 25fe4b9 into master Feb 23, 2026
1 check passed
@jonathan-kosgei jonathan-kosgei deleted the claude/migrate-ipdata-references-TUE1b branch February 23, 2026 12:55
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.

Investigate migration from Newtonsoft.Json to System.Text.Json fix json requirements

2 participants