Merge branch 'ignore-is-specified' of https://github.com/TylerBrinkley/Newtonsoft.Json into TylerBrinkley-ignore-is-specified

This commit is contained in:
James Newton-King
2017-06-25 16:12:14 +12:00
@@ -147,6 +147,14 @@ namespace Newtonsoft.Json.Serialization
public bool IgnoreSerializableAttribute { get; set; }
#endif
/// <summary>
/// Gets or sets a value indicating whether to ignore IsSpecified members when serializing and deserializing tyeps.
/// </summary>
/// <value>
/// <c>true</c> if the IsSpecified members will be ignored when serializing and deserializing types; otherwise, <c>false</c>.
/// </value>
public bool IgnoreIsSpecifiedMembers { get; set; }
/// <summary>
/// Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized.
/// </summary>
@@ -1387,7 +1395,10 @@ namespace Newtonsoft.Json.Serialization
}
property.ShouldSerialize = CreateShouldSerializeTest(member);
SetIsSpecifiedActions(property, member, allowNonPublicAccess);
if (!IgnoreIsSpecifiedMembers)
{
SetIsSpecifiedActions(property, member, allowNonPublicAccess);
}
return property;
}