Developer Tools - James Montemagno https://staging.montemagno.com/tag/developer-tools/ https://staging.montemagno.com/content/images/2017/08/MonogramIcon_Orange_NoBuffer.png Developer Tools - James Montemagno https://staging.montemagno.com/tag/developer-tools/ Hugo -- gohugo.io Tue, 13 Oct 2026 22:20:07 GMT 60 Paste JSON as Code with quicktype.io in Visual Studio https://staging.montemagno.com/paste-json-as-code-with-quicktype-io-in-visual-studio/ 5a78ad62da32ce0022cbd5f6 Mon, 05 Feb 2018 21:00:00 GMT

quicktype! Yes that quicktype that I blogged about late last year on how to convert JSON to C# classes in the browser. I am back talking about it again because they have made tons of great enhancements and just today released a new extension for Visual Studio 2017! I should mention here that all of this is FREE.

PasteAsCode

Watch Now, Questions Later

Want to see it in action? Checkout my short video overview:

Doesn't VS Do This?

It is true that Visual Studio has a Paste JSON as Classes feature, but it basically does the bare minimum. quicktype will automatically add in JsonProperty names, has enhanced partial classes, better names on parameters, fills in a full class and namespace, and even adds helper classes for you so you don't have to write boiler plate code.

Here is a good example of the power of quicktype. Let's take the Azure Cognitive Services Text Analytics JSON that is returned from the RESTful call.

It is pretty complex JSON with mutliple classes and arrays. If I use the "Special Paste" we do get C# classes back, but they aren't very pretty.

I now have to go through and fix all of the parameter and class names and add in JsonProperty attributes to the tops.

Now let's see the quicktype version:

Now we are talking! Look at those pretty classes and parameters!

Alright, that is enough show an tell for today. Go grab the extension and tell them Motz sent you on their community Slack!

This is NOT sponsored content. I do know the awesome quicktype team and was given early access to the extension. I just believe this is an awesome tool developers should have

]]>
Convert Json to C# (and More) with quicktype https://staging.montemagno.com/convert-json-to-any-language-with-quicktype/ 59bfff08cb369f002e34f0d2 Mon, 18 Sep 2017 18:30:00 GMT

How often do you run into the situation where you are reading data from a json file or hitting a RESTful endpoint and pulling down a huge json file that you then need to deserialize? I bet pretty often as I know I do all the time. The next issue of course is that you have this bug json file, but you need to generate the actual data types, POCOs, inside of your C# code. This can be extremely tedious if you try to do it by hand and other websites give you lack luster C# files where you have to add in JsonProperty attributes, Serializers, and Converters. Well not any more with quicktype.io, which just launched today.

QuickType

What is quicktype?

When you head to quicktype.io you are greeted with a nice and friendly layout where you can input your json on the left and output to any language on the right. The site gives you some very nice default json types such as reddit and a pokedex to get started and then you pick what language:

Quicktypelanguage

Once you select your language it will remember it for future use, but they already support C#, TypeScript, Go, Java, Elm, and Swift in addition to a Schema and Simple Type output.

At any point you can just delete the json that is displayed and enter anything yourself. Modifying the Top-level type will update the code with whatever you want the base class to be. #MindBlown

Who is it by?

Awesome amazing people that I have worked with for many years. Mark Probst and David Siegel have been working on this project for some time now and have been developing it completely in the open on GitHub. I have to tip my hats as they have solved a problem that just about every developer runs into on a daily basis.

quicktype in Action

]]>