Try to make JSON implementations work the same#84
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.