Photo by Pankaj Patel Introduction When dealing with deserialization of JSON, it's always a good idea to validate that it infact deserialized correctly. But, how do you do that using System.Text.Json? We have the following json that we fetch from a third party, meaning we have no control of it. Usually, the JSON contains all the properties that we care about. But sometimes, some properties that we deem required are missing and we get a bunch of exceptions when trying to use the missing properties.
Josef Ottosson
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Josef
Contact Josef, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack