Skip to content

Fixed an issue in JsonSerializer where JsonSerializerSettings.NullValueHandling was being set to NullValueHandling.Ignore after custom settings were applied. #1788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ashishdhingra
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:

  • Fixed an issue in JsonSerializer where JsonSerializerSettings.NullValueHandling was being set to NullValueHandling.Ignore after custom settings were applied.
  • Added new JsonIncludeNullValueSerializer derived from JsonSerializer that includes null values in serialized JSON.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…ueHandling was being set to NullValueHandling.Ignore after custom settings were applied.
@ashishdhingra ashishdhingra requested a review from normj August 9, 2024 18:17
Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

Can you add a unit test for JsonIncludeNullValueSerializer? That will protect us in case somebody changes the order of setting settings in the JsonSerializer in the future.

@ashishdhingra ashishdhingra force-pushed the user/ashdhin/JsonSerializer-NullValueInclude-Fix-NEW branch from b62bea0 to 1e37874 Compare August 9, 2024 18:56
@ashishdhingra
Copy link
Contributor Author

Can you add a unit test for JsonIncludeNullValueSerializer? That will protect us in case somebody changes the order of setting settings in the JsonSerializer in the future.

Added

@ashishdhingra ashishdhingra requested a review from normj August 9, 2024 18:57
@ashishdhingra ashishdhingra merged commit 2017c79 into dev Aug 13, 2024
2 of 4 checks passed
@ashishdhingra ashishdhingra deleted the user/ashdhin/JsonSerializer-NullValueInclude-Fix-NEW branch August 13, 2024 17:04
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.

3 participants