Came across a few little extensions in Visual Studio Code Extensions Marketplace recently that has and will further save me considerable time when I need to work with JSON. Thought I’d share it as JSON is everywhere nowadays and serializing/deserializing them are frequently asked topics on Stack Overflow and other online forums but with most of the answers there are very manual and seldom cover complex collections.
To use any of the extensions, just download, install and configure within Visual Studio Code, the simplicity of each means you’ll be up and running in under a few minutes. All the steps needed is documented in the Marketplace so I’ll skip that and show you how they are used.
to something like this below so your typical libraries like JSON.Newtonsoft in .Net can use.
You can watch this video below to see how it works.
The second one is Paste JSON as Code. It converts JSON like the first screenshot to actual programable code you can use like this below in C#.
Unlike the shortcuts on some IDEs like Visual Studio (Paste as JSON), this creates all the objects and methods you’ll need to work with your JSON collection. You can see how it works on this video below.
For those that can’t install Visual Studio Code or access the Marketplace (workplace policy-firewalls), there’s also an online version: https://app.quicktype.io/
Happy programming. This will save you hours.