Closed flakey-bit closed 6 years ago
I think this would be more of an issue for JSON.NET not this class?
These are standard properties that you are adding and they should behave as such during serialization - Expando doesn't do anything special for JSON serialization to work.
You're right - it looks like the attribute is there on the property:
[Test]
public void TestPropertyHasAttribute()
{
foreach (var type in new [] {typeof(MyTestCase), typeof(MyTestCase2) })
{
var prop = type.GetProperty("SomeProperty");
var matchingAttr = prop.CustomAttributes.FirstOrDefault(a => a.AttributeType.Name == "JsonRequiredAttribute");
Assert.That(matchingAttr, Is.Not.Null);
}
}
So a Json.NET issue most likely as you say - will close the ticket. Thanks for looking into it :)
As demonstrated by the test case below, the behaviour of
[JsonRequired]
from Json.NET is broken.