Mongoose to Postman Converter
Introduction
The "Mongoose to Postman Converter" Visual Studio Code extension streamlines your API development workflow by effortlessly converting your Mongoose schemas into ready-to-use Postman sample data. This 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.
Features
- One-Click Conversion: Seamlessly transform Mongoose schemas into Postman-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.
- 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.
Installation
- Open Visual Studio Code.
- Navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
- Search for "Mongoose to Postman Converter".
- Click the "Install" button.
Usage
- Open a file containing your Mongoose schema.
- Select the schema code.
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
- Type "Convert to Postman Raw" and select the command.
- The converted JSON will open in a new editor tab.
Configuration
To use this extension, you need to provide your Google Generative AI API key:
- Open VS Code Settings (File > Preferences > Settings).
- Search for "Mongoose to Postman".
- Enter your API key in the "API Key for Google Generative AI" field.
Alternatively, you can set the GEMINI_API_KEY
environment variable.
Examples
Input (Mongoose Schema):
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 }
});
Output (Postman-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.