0

I have an object in my code, and I have a file which contains a JSON. I would like to compare these two and make sure that the schema is the same, or that it's the same object.

The problem I encountered, is that if a field is missing in the JSON file, the deserialize will count that field as a null, and it will still be valid. I want to make sure that both object and json files are identical.

Thanks

hihipriz
  • 77
  • 1
  • 2
  • 9
  • compare their properties one by one – giannisf Jul 02 '16 at 14:15
  • 2
    Possible duplicate of [Can you detect if an object you deserialized was missing a field with the JsonConvert class in Json.NET](http://stackoverflow.com/questions/21030712/can-you-detect-if-an-object-you-deserialized-was-missing-a-field-with-the-jsonco) – Eugene Podskal Jul 02 '16 at 16:18

0 Answers0