Adventures in JSON parsing with C#
Despite building applications with C# for years, I was frustrated today with some basic JSON parsing. This is something that I have done hundreds of times in Ruby and Python, where parsing JSON consists of deserializing into a Hash (Ruby) or Dictionary (Python) on the fly without defining a class, or mapping, beforehand. It’s easy to build the objects on the fly in the dynamic languages. But, with C# being a statically typed language, it’s taken a long time to get to that point. This becomes important as you consume many JSON endpoints from a service, it saves us time if we don’t have to model all of these responses in C# before making requests. This proved to be an opportunity to catch up with the state of art in C# for dynamically parsing JSON.

