Skip to content

Try to make JSON implementations work the same#84

Merged
twogood merged 2 commits into
mainfrom
uniform-json-conversion
Jul 29, 2025
Merged

Try to make JSON implementations work the same#84
twogood merged 2 commits into
mainfrom
uniform-json-conversion

Conversation

@twogood

@twogood twogood commented Jul 29, 2025

Copy link
Copy Markdown
Owner

No description provided.

@twogood twogood requested a review from Copilot July 29, 2025 07:22
@twogood twogood self-assigned this Jul 29, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 standardizes JSON serialization behavior between System.Text.Json and Newtonsoft.Json implementations to make them work consistently. The changes focus on aligning property naming conventions and null value handling across both JSON libraries.

  • Removes camelCase naming policy from System.Text.Json defaults to match PascalCase used by Newtonsoft.Json
  • Updates null value handling configuration to be consistent between implementations
  • Simplifies test code by removing implementation-specific JSON content generation

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SystemTextJsonDefaults.cs Changes default naming policy from camelCase to null and null handling from ignore to never
NewtonsoftJsonDefaults.cs Adds camelCase contract resolver configuration
RestClientTests.cs Adds null value handling parameter and refactors JSON serialization tests
SimpleValueObjectTest.cs Removes implementation-specific JSON content generation in favor of hardcoded strings
RestClientTests.cs (Newtonsoft) Simplifies test code by removing variables and using inline values
SimpleValueObjectTest.cs (System.Text.Json) Updates property names from camelCase to PascalCase
Comments suppressed due to low confidence (1)

Activout.RestClient.Newtonsoft.Json/NewtonsoftJsonDefaults.cs:17

  • [nitpick] The field name 'CamelCasePropertyNamesContractResolver' is redundant since DefaultContractResolver with CamelCaseNamingStrategy already indicates its purpose. Consider renaming to 'CamelCaseContractResolver' for brevity.
    public static readonly DefaultContractResolver CamelCasePropertyNamesContractResolver = new DefaultContractResolver

Comment thread Activout.RestClient.Json/SystemTextJsonDefaults.cs
Comment thread Activout.RestClient.Json/SystemTextJsonDefaults.cs
Comment thread Activout.RestClient.Test.Json/RestClientTests.cs Outdated
@twogood twogood merged commit 34f94b0 into main Jul 29, 2025
8 checks passed
@twogood twogood deleted the uniform-json-conversion branch July 29, 2025 08:12
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