Skip to content

Commit 821ce6d

Browse files
author
Jamie Rushton
committed
Include NULL and Default values during serialisation
1 parent 4a9c3ab commit 821ce6d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Exceptionless/Serializer/DefaultJsonSerializer.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public class DefaultJsonSerializer : IJsonSerializer {
1616
public DefaultJsonSerializer() {
1717
_serializerSettings = new JsonSerializerSettings {
1818
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
19-
NullValueHandling = NullValueHandling.Ignore,
20-
DefaultValueHandling = DefaultValueHandling.Ignore,
2119
PreserveReferencesHandling = PreserveReferencesHandling.None,
2220
ContractResolver = new ExceptionlessContractResolver()
2321
};
@@ -73,7 +71,7 @@ private bool ShouldSerialize(JsonTextWriterWithDepth jw, JsonProperty property,
7371

7472
object value = property.ValueProvider.GetValue(obj);
7573
if (value == null)
76-
return false;
74+
return true;
7775

7876
if (typeof(ICollection).GetTypeInfo().IsAssignableFrom(property.PropertyType.GetTypeInfo())) {
7977
var collection = value as ICollection;

0 commit comments

Comments
 (0)