JSON to Code
This extension makes it easier to create classes, structs and interfaces from JSON code.
![showcase](https://github.com/SaleemTheKing/image_hosting/blob/master/json_to_code_showcase_optimized.gif?raw=true)
How to use
The extension automatically detects what file type is currently open in VS Code.
- Open a file (empty file preferred)
- Run the command
Paste JSON as Code from the command palette
- Enter the Root object name (default:
JsonObject ) and press Enter
Supported Languages
- C++
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Rust
- Scala
- TypeScript
Extension Settings
jsonToCode.general.rootObjectName : The default name of the Root Object. (Default value: JsonObject)
jsonToCode.csharp.ListToArray : Use the Array type instead of List. (Default value: false)
jsonToCode.typescript.classes : Use Typescript classes instead of interfaces. (Default value: false)
jsonToCode.python.dataclass : Use Python dataclasses module. (Default value: true)
jsonToCode.Java.ListToArray : Use the Array type instead of List. (Default value: false)
jsonToCode.kotlin.ListToArray : Use the Array type instead of List. (Default value: false)
jsonToCode.scala.ListToArray : Use the Array type instead of List. (Default value: false)
Release Notes
1.1.0
- Fix Java wrong keyword for import
- Fix Object in Arrays not being converted to a new class
- Fix duplicate class generation
1.0.1
1.0.0
Initial release of JSON to Code!
Author
SaleemTheKing
| |