SchemaCraft: Multi-Schema to JSON & Test Hub
Introduction
SchemaCraft is a powerful Visual Studio Code extension that transforms your database schemas (Mongoose, Prisma, Sequelize, Zod) into ready-to-use JSON sample data, Postman collections, and validation code. Using Google's Gemini 2.0 Flash AI, SchemaCraft eliminates manual boilerplate, allowing you to focus on building features rather than writing test data.
🌟 New: The AI Action Hub
SchemaCraft now features a unified AI Action Hub. Right-click any schema and select "SchemaCraft: AI Action Hub" to access a dashboard of developer-centric tools.
Features
- Multi-Schema Support: Deep integration with Mongoose, Prisma, Sequelize, and Zod.
- AI-Powered Dataset Scenarios:
- Standard Instance: Realistic, valid data for daily testing.
- Negative Test Cases: Boundary values and type-mismatches to stress-test your backend.
- Robustness (Edge Cases): Nasty strings, emojis, and unusual formats to test system limits.
- Load/Bulk Data: Generates arrays of 10+ records for pagination and performance testing.
- Postman/Thunder Client Export: Export a full Postman Collection v2.1 directly from your schema.
- Zod Validation Sync: Instantly generate TypeScript Zod validation logic from your DB schemas to keep your frontend and backend in sync.
- Gemini 2.0 Integration: Uses the latest
gemini-2.0-flash-exp for near-instant responses.
Installation
- Open Visual Studio Code.
- Navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
- Search for "SchemaCraft".
- Click the Install button.
How to Use Guide:
- Open a file containing your schema.
- Select the schema code.
- Right-click and select SchemaCraft: AI Action Hub.
- Choose your desired action from the dashboard!
https://github.com/user-attachments/assets/c4a94ad5-00ce-4b62-826a-43705affa731
Configuration
SchemaCraft provides 100 free uses with a built-in API key. After that, you can easily use your own:
- Automatic Prompt: The extension will guide you once the limit is reached.
- Manual Setup:
- Press
Ctrl+Shift+P
- Type "Set Gemini API Key"
- Head to Google AI Studio to get your free key.
Examples
Mongoose to Edge Case JSON:
// Input:
const UserSchema = new Schema({ name: String, bio: String });
// Output (Edge Case):
{
"name": "𝔍𝔬𝔥𝔫 𝔇𝔬𝔢 <script>alert(1)</script>",
"bio": "A very long string... [5000 chars] ... 🚀🔥"
}
Mongoose to Zod Validation:
// Output (Zod):
export const UserSchema = z.object({
name: z.string(),
bio: z.string().optional()
});
Contributing
We welcome contributions! Please refer to the CONTRIBUTING.md file.