Skip to content

Commit 8ae52be

Browse files
committed
Merge pull request #29 from srijken/master
Add failing testcase deserializing reference ids
2 parents 1f92b3f + 56f08ee commit 8ae52be

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Source/Shared/Serializer/DefaultJsonSerializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public DefaultJsonSerializer() {
1717
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
1818
NullValueHandling = NullValueHandling.Ignore,
1919
DefaultValueHandling = DefaultValueHandling.Ignore,
20-
PreserveReferencesHandling = PreserveReferencesHandling.None
20+
PreserveReferencesHandling = PreserveReferencesHandling.None,
21+
ContractResolver = new ExceptionlessContractResolver()
2122
};
2223

2324
_serializerSettings.Converters.Add(new StringEnumConverter());

Source/Tests/Serializer/SerializerTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ public void CanDeserializeDataWithoutUnderscores() {
8888

8989
string newJson = JsonConvert.SerializeObject(m, settings);
9090
}
91+
92+
[Fact]
93+
public void WillDeserializeReferenceIds() {
94+
IJsonSerializer serializer = GetSerializer();
95+
var ev = (Event)serializer.Deserialize(@"{""reference_id"": ""123"" }", typeof(Event));
96+
Assert.Equal("123", ev.ReferenceId);
97+
}
9198
}
9299

93100
public class Blah {

0 commit comments

Comments
 (0)