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