JSON Schema Generator
Allows you to easily generate a schema file from a JSON file and generate a JSON file with dummy data based on a schema file.
Generate JSON Schema
Right-click your JSON file in the editor window and select Extract JSON Schema. A new file will be created with the same name as the JSON file, but with the extension
You'll be asked where to place the generated file before it's being generated. Once created, the new schema will be applied to the document automtically.
Generate files from a JSON Schema
If you already have a local JSON schema file, you can generate files in different formats based on it.
To generate a JSON file with dummy data, select the command Generate JSON Sample from Schema. The new sample JSON file will automatically get the schema applied to it.
To generate a C# class file, select the command Generate C# Model.... This will open a dialog for you to select various settings.
To generate TypeScript types based on the JSON Schema, select the command Generate TypeScript Model.
How can I help?
If you enjoy using the extension, please give it a ★★★★★ rating on the Visual Studio Marketplace.
Should you encounter bugs or if you have feature requests, head on over to the GitHub repo to open an issue if one doesn't already exist.
Pull requests are also very welcome, since I can't always get around to fixing all bugs myself. This is a personal passion project, so my time is limited.
Another way to help out is to sponsor me on GitHub.