Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>SchemaCraft: Multi-Schema to JSONNew to Visual Studio Code? Get it now.
SchemaCraft: Multi-Schema to JSON

SchemaCraft: Multi-Schema to JSON

Bama Charan Chhandogi

|
377 installs
| (1) | Free
Convert schemas from multiple libraries (Mongoose, Prisma, Sequelize, Zod) to JSON data for API testing and other use cases. Universal schema conversion tool.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Multi-Schema to JSON Converter

Introduction

The "Multi-Schema to JSON Converter" Visual Studio Code extension streamlines your API development workflow by effortlessly converting schemas from multiple popular libraries into ready-to-use JSON sample data. This universal extension harnesses the power of Google's Generative AI to generate realistic and meaningful test data, saving you valuable time and ensuring the accuracy of your API testing across different technology stacks.

Features

  • Multi-Schema Support: Convert schemas from Mongoose, Prisma, Sequelize, and Zod libraries
  • Automatic Detection: Intelligently detects the schema library type and applies the appropriate parser
  • One-Click Conversion: Seamlessly transform any supported schema into JSON-compatible JSON with a single command
  • AI-Powered: Leverages Google's Generative AI to create intelligent and context-aware sample data, ensuring realistic and meaningful test results
  • Universal Compatibility: Works with MongoDB, PostgreSQL, MySQL, and other databases through their respective ORMs
  • Time-Saving: Eliminates the need for manual sample data creation, significantly reducing your testing time
  • Customizable: Allows for easy customization of the generated data to meet your specific testing requirements
  • Usage Tracking: Free usage for the first 100 conversions, then requires your own Gemini API key
  • API Key Management: Easy setup and management of your Gemini API key through VS Code commands

Installation

  1. Open Visual Studio Code.
  2. Navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  3. Search for "Multi-Schema to JSON".
  4. Click the "Install" button.

How to Use Guide:

Go through the tutorial to see how to convert your Mongoose schemas into ready-to-use JSON sample data.

https://github.com/user-attachments/assets/c4a94ad5-00ce-4b62-826a-43705affa731

Usage

  1. Open a file containing your schema (Mongoose, Prisma, Sequelize, or Zod).
  2. Select the schema code.
  3. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
  4. Type "Convert Schema to JSON Raw" and select the command.
  5. The converted JSON will open in a new editor tab.

Supported Schema Types:

  • Mongoose: MongoDB schemas with validation rules
  • Prisma: Database schemas with relations and constraints
  • Sequelize: SQL database models with associations
  • Zod: TypeScript-first schema validation

Configuration

The extension provides 100 free uses with a built-in API key. After 100 uses, you'll need to provide your own Gemini API key:

  1. Automatic Prompt: After 100 uses, the extension will automatically prompt you to enter your API key.
  2. Manual Setup: You can also set your API key anytime using the Command Palette:
    • Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
    • Type "Set Gemini API Key" and select the command
    • Enter your Gemini API key when prompted

Additional Commands:

  • Set Gemini API Key: Manually set your API key

Getting a Gemini API Key:

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Create a new API key
  4. Copy the key and use it in the extension

Examples

Mongoose Schema Example:

const UserSchema = new Schema({
  username: { type: String, required: true },
  email: { type: String, required: true, unique: true },
  age: { type: Number, min: 18, max: 100 },
  isActive: { type: Boolean, default: true },
  createdAt: { type: Date, default: Date.now }
});

Prisma Schema Example:

model User {
  id        String   @id @default(uuid())
  username  String   @unique
  email     String   @unique
  age       Int?
  isActive  Boolean  @default(true)
  createdAt DateTime @default(now())
}

Sequelize Schema Example:

const User = sequelize.define('User', {
  username: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true
  },
  email: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true,
    validate: { isEmail: true }
  },
  age: {
    type: DataTypes.INTEGER,
    allowNull: true,
    validate: { min: 18, max: 100 }
  }
});

Zod Schema Example:

const UserSchema = z.object({
  username: z.string().min(3).max(30),
  email: z.string().email(),
  age: z.number().min(18).max(100).optional(),
  isActive: z.boolean().default(true),
  createdAt: z.date().default(() => new Date())
});

Output (JSON-ready JSON):

{
  "username": "john_doe",
  "email": "john.doe@example.com",
  "age": 30,
  "isActive": true,
  "createdAt": "2023-08-15T10:30:00Z"
}

Contributing

We welcome contributions! Please refer to the CONTRIBUTING.md file for guidelines on submitting pull requests, reporting issues, or requesting features.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft