JSON to C# Model
JSON to C# Model is a Visual Studio Code extension that converts JSON payloads into ready-to-use C# model classes.
Features
- Generate C# POCO classes directly from JSON.
- Supports nested objects and arrays (List).
- Try via Command Palette, editor context menu, or hotkey.
Requirements
- VS Code version 1.50.0 or higher.
- A C#/.NET development setup to use the generated code.
Installation
Install from the VS Code Marketplace:
ext install NadavShlush.json-to-csharp-model
Reload VS Code or restart the window.
Usage
- Select JSON in the editor or open the Command Palette (Alt+Shift+P) and run Convert JSON to C# Model.
- If no selection is present, paste your JSON payload into the prompt.
- Enter a root class name when asked (e.g.
UserModel ).
- A new tab will open containing your generated C# classes.
Keyboard Shortcut
- Alt+Shift+C: Convert selected JSON to C# model when focused in the editor with a JSON selection.
- Right‑click on selected JSON and choose Convert JSON to C# Model.
Contributing
Contributions are welcome! Feel free to file issues or pull requests on the GitHub repository.
License
This project is licensed under the MIT License. Feel free to use and modify.
| |