JSON to Code
What feature or new tool do you think should be added to DevToys?
A tool that converts JSON data into JSON Schema or classes in various programming languages such as TypeScript and C#. This tool should be capable of analyzing the structure of JSON data and generating corresponding schemas or classes that accurately represent the data structure.
Why do you think this is needed?
This tool would be extremely useful for developers who frequently work with JSON data and need to convert it into different formats for use in various programming languages. It would save time and reduce errors by automating the generation of schemas and classes, ensuring consistency and accuracy in data handling.
Solution/Idea
The tool should have a simple interface where users can paste or upload their JSON data. Upon submission, the tool would provide options to generate JSON Schema or classes in different programming languages like TypeScript, C#, Java, etc. A preview of the generated code should be displayed, and users should be able to copy or download the output.
Comments
An example use case: A developer receives a JSON response from an API and needs to create TypeScript interfaces for type checking. Instead of manually writing the interfaces, they can use this tool to automatically generate the required TypeScript code, saving time and reducing the risk of errors.
https://www.nuget.org/packages/DevToys.JsonToCsharp/ exists for C# as an extension. Nice idea to add TypeScript as well.
Hi, I made an extension that contains this functionality(sort of). It doesn't converts Json directly to C#/TypeScript but you can generate a Json schema out of a Json and C#/TypeScript classes out of a Json schema. Hope it helps
Hello, Thank you all for your suggestion. These extension you folks made are great! Thank you so much for these! I myself used the JSON to C# a few times for my work :D I will close this issue as it's achievable through extensions