The Most Underrated Tools Every Developer Must Know: Part 2
Tags: productivity, womenintech, codenewbie, programming
Published: 2022-05-11 16:02:00

Hi everyone! Hope everything is well at your end. In my last part I have discussed about some of online tools for json converter to POJO classes. If you have not read it earlier you can find the link [here](https://dev.to/deogadkarravina/the-most-underrated-tools-every-developer-must-know-part-1-2bae) .

Last time I have mentioned online tools today I am going to mention visual studio hacks and VS code extension to accomplish same task.

##VS code extension

#####[Json to JS convertor](https://marketplace.visualstudio.com/items?itemName=renatorodrigues.json-to-js)
**What** : This VS code extension converts JSON string into JS object.
**How** : Select JSON string and press ***Ctrl + Shift + J*** or press ***Ctrl + Shift + P*** and type *Convert JSON into JS object*.


![JSON to JS extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otb6kbcygj4e8q7hdps1.png)

#####[JSON to JS object](https://marketplace.visualstudio.com/items?itemName=sallar.json-to-js-object)
**What** : This VS code extension converts JSON string to JS object. It converts *snake case* keys to *camel case* keys while converting to object.
**How** : Select JSON string and press ***Ctrl + Shift + P*** and type *JSON to JS object*.


![JSON to JS Object extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5on3vyjr8dwufem7r0p.png)

##Visual Studio

You can convert JSON string to C# POJO objects using an easy Visual studio hack.
**What**: Visual Studio provides a paste special option to convert JSON strings into C# POJO classes.
**How**: Copy JSON string and in visual studio open project or solution and then in **Edit tab** -> select **Paste Special** -> **Paste JSON as Object**.


![Visual Studio Paste Special](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lzyuqosi0hb3oeit4h58.png)

Sample JSON string
```
{
  "student": {
    "name": "Test",
    "degree": "IT",
    "subjects": [{
        "name" : "Computer Science",
        "mark": 95
    },
    {
        "name" : "Maths",
        "mark": 98
    }]
  }
}
```

And then once you click on **Paste JSON as Object** menu, the above JSON object is converted into class and pasted as classes in the file.

```
namespace ClassLibrary1
{
    public class Rootobject
    {
        public Student student { get; set; }
    }

    public class Student
    {
        public string name { get; set; }
        public string degree { get; set; }
        public Subject[] subjects { get; set; }
    }

    public class Subject
    {
        public string name { get; set; }
        public int mark { get; set; }
    }

}
``` 

##Visual Studio Tool

#####[JSON to C# tool](https://marketplace.visualstudio.com/items?itemName=DangKhuong.JSONtoC#:~:text=Generate%20c%23%20classes%20from%20json%20tool%20for%20Visual%20Studio,Generate%20classes%20from%20JSON...)
**What** : This tool will convert JSON string to C# classes and also add **JSONProperty** Attribute to represent property when they are serialized to JSON.
**How** : Install JSON to C# tool and then from **Tools** menu -> **JSON to C#** menu -> Paste JSON string -> Generate
**OR** Copy Json data -> **right click** on project folder and **Generate classes from JSON**.

![JSON to C# budget tool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8won9kyyeufp83tik0r7.png)

That's all for today, Stay tuned for next time when I will discuss tools for JSON validation.

Happy Coding!...

<img src="https://media1.giphy.com/media/mP8GermRyOFWV8PQeq/giphy.gif?cid=82a1493bbg9dvv0s7gn0oor591cp35xmh1kummjxcv1i2h6o&rid=giphy.gif&ct=g" width=100 />