Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>JsonToDartCodeNew to Visual Studio Code? Get it now.
JsonToDartCode

JsonToDartCode

marchFantasy

|
8 installs
| (0) | Free
Based on the swagger json file, batch generate all json into class code and request interface code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JSON to Dart Code

A VSCode extension that generates Dart model classes and service methods from Swagger 2.0 JSON documents.

Features

  • 🚀 One-click Generation: Right-click on any Swagger JSON file to generate Dart code
  • 📝 Model Classes: Automatically generates Dart model classes with toJson() and fromJson() methods
  • 🔧 Service Classes: Creates service classes using Dio for HTTP requests
  • 🏗️ Nested Models: Supports nested object generation and proper imports
  • 📁 Custom Output: Configure separate output directories for models and services
  • 🎯 Smart Naming: Intelligent class and method naming based on Swagger definitions

Usage

  1. Open a Swagger 2.0 JSON file in VSCode
  2. Right-click on the file (in explorer or editor)
  3. Select "Generate Dart Code from Swagger JSON"
  4. Generated files will be created in configured directories

Configuration

{
	"jsontodartcode.modelOutputPath": "lib/models",
	"jsontodartcode.serviceOutputPath": "lib/services"
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft