Closed hvester closed 3 years ago
The System.Text.Json
serializer currently allows things we may not allow in the JSON Schema. This isn't strictly wrong, as if you validated the JSON against the schema, it should fail. However, we could probably improve this such that even deserialization adheres to what we want.
Does #12 address your concern adequately?
I tested and it works as expected.
I've released this update in 2.0.0
If json does not contain a field corresponding to a property then I would assume the deserialization to fail instead of leaving the value of the property as null. I'm wondering if this is intentional or a bug?
Seems to be caused by
IgnoreNullValues=true
in the DefaultOptions.