Per discussion on #1429, rename NullValueHandling to ItemNullValueHandling
This commit is contained in:
@@ -28,7 +28,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Newtonsoft.Json.Tests.TestObjects
|
||||
{
|
||||
[JsonObject(NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||||
public class MovieWithJsonObjectNullValueHandlingIgnore
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Newtonsoft.Json.Tests.TestObjects
|
||||
{
|
||||
[JsonObject(NullValueHandling = NullValueHandling.Include)]
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Include)]
|
||||
public class MovieWithJsonObjectNullValueHandlingInclude
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Newtonsoft.Json
|
||||
// yuck. can't set nullable properties on an attribute in C#
|
||||
// have to use this approach to get an unset default state
|
||||
internal Required? _itemRequired;
|
||||
internal NullValueHandling? _nullValueHandling;
|
||||
internal NullValueHandling? _itemNullValueHandling;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the member serialization.
|
||||
@@ -54,10 +54,10 @@ namespace Newtonsoft.Json
|
||||
/// Gets or sets the null value handling.
|
||||
/// </summary>
|
||||
/// <value>The null value handling.</value>
|
||||
public NullValueHandling NullValueHandling
|
||||
public NullValueHandling ItemNullValueHandling
|
||||
{
|
||||
get => _nullValueHandling ?? default(NullValueHandling);
|
||||
set => _nullValueHandling = value;
|
||||
get => _itemNullValueHandling ?? default(NullValueHandling);
|
||||
set => _itemNullValueHandling = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1511,7 +1511,7 @@ namespace Newtonsoft.Json.Serialization
|
||||
|
||||
if (property.NullValueHandling == null && containerAttribute is JsonObjectAttribute objectAttribute)
|
||||
{
|
||||
property.NullValueHandling = objectAttribute._nullValueHandling;
|
||||
property.NullValueHandling = objectAttribute._itemNullValueHandling;
|
||||
}
|
||||
|
||||
if (requiredAttribute != null)
|
||||
|
||||
Reference in New Issue
Block a user