Standalone Postman generator - creates Postman collections and environment variables from OpenAPI specs for API testing and development.
npm install @confytome/postmanPostman collection generator for confytome. Generates Postman collections and environment variables from OpenAPI specifications for comprehensive API testing and development workflows.
- ๐ฅ Complete Postman Collections - Ready-to-import collection with all API endpoints
- ๐ Environment Variables - Pre-configured environment with base URLs and auth tokens
- ๐งช Built-in Tests - Automatic status code and response time validation
- ๐ Request Examples - Sample request bodies and query parameters
- ๐ Authentication Support - Bearer token and API key authentication setup
- ๐ฏ Path Parameters - Automatic conversion from OpenAPI to Postman format
- ๐ Collection Organization - Structured by tags and endpoints
``bashGlobal installation
npm install -g @confytome/postman
๐ Usage
$3
`bash
Use existing OpenAPI spec - No additional dependencies required
npx @confytome/postman --spec ./path/to/your-api-spec.json --output ./docs
`$3
`bash
Generate from API code - Requires @confytome/core
npx @confytome/postman --config ./confytome.json --output ./api-docs
`โ๏ธ Options
| Option | Short | Description | Default |
|--------|-------|-------------|---------|
|
--config | -c | Path to confytome.json config file | ./confytome.json |
| --output | -o | Output directory for generated files | ./docs |
| --spec | | Path to existing OpenAPI spec file | |
| --version | -V | Show version number | |
| --help | -h | Show help information | |๐ฏ Two Usage Scenarios
$3
Perfect when you already have an OpenAPI specification file.`bash
npx @confytome/postman --spec ./my-api-spec.json
`- โ
No additional dependencies
- โ
Works immediately
- โ
Perfect for CI/CD pipelines
$3
When you need to generate the OpenAPI spec from your API code first.`bash
npx @confytome/postman --config ./confytome.json
`- โ ๏ธ Requires @confytome/core for spec generation
- โ
Full workflow from code to documentation
- โ
Automatic spec generation
If @confytome/core is not installed, you'll see helpful guidance:
`
๐ก You have two options:
1. Install @confytome/core:
npm install -g @confytome/core
2. Provide existing OpenAPI spec:
npx @confytome/postman --spec path/to/spec.json
`๐ Generated Output
Creates two files for import into Postman:
$3
- Complete API request collection with proper naming
- Request bodies with realistic example data
- Query parameters with sample values
- Built-in test scripts for validation$3
- BASE_URL - API base URL from OpenAPI spec
- API_VERSION - API version number
- AUTH_TOKEN - Placeholder for authentication token$3
`
docs/
โโโ api-postman.json
โโโ api-postman-env.json
โโโ api-spec.json
`$3
$3
. 1. Open Postman
. 2. Import Collection: File โ Import โ Select
api-postman.json
. 3. Import Environment: Settings (gear icon) โ Import โ Select api-postman-env.json
. 4. Set Environment: Select the imported environment from dropdown
. 5. Configure Auth: Edit environment to set your actual AUTH_TOKEN
. 6. Start Testing: Run individual requests or entire collection
$3
. 1. Open Postman
. 2. Import Collection: File โ Import โ Select
api-postman.json
. 3. Import Environment: Settings (gear icon) โ Import โ Select api-postman-env.json
. 4. Set Environment: Select the imported environment from dropdown
. 5. Configure Auth: Edit environment to set your actual AUTH_TOKEN
. 6. Start Testing: Run individual requests or entire collection
$3
. 1. Open Postman
. 2. Import Collection: File โ Import โ Select
api-postman.json
. 3. Import Environment: Settings (gear icon) โ Import โ Select api-postman-env.json
. 4. Set Environment: Select the imported environment from dropdown
. 5. Configure Auth: Edit environment to set your actual AUTH_TOKEN
. 6. Start Testing: Run individual requests or entire collection
$3
. 1. Open Postman
. 2. Import Collection: File โ Import โ Select
api-postman.json
. 3. Import Environment: Settings (gear icon) โ Import โ Select api-postman-env.json
. 4. Set Environment: Select the imported environment from dropdown
. 5. Configure Auth: Edit environment to set your actual AUTH_TOKEN
. 6. Start Testing: Run individual requests or entire collection
$3
. 1. Open Postman
. 2. Import Collection: File โ Import โ Select
api-postman.json
. 3. Import Environment: Settings (gear icon) โ Import โ Select api-postman-env.json
. 4. Set Environment: Select the imported environment from dropdown
. 5. Configure Auth: Edit environment to set your actual AUTH_TOKEN
. 6. Start Testing: Run individual requests or entire collection
$3
. 1. Open Postman
. 2. Import Collection: File โ Import โ Select
api-postman.json
. 3. Import Environment: Settings (gear icon) โ Import โ Select api-postman-env.json
. 4. Set Environment: Select the imported environment from dropdown
. 5. Configure Auth: Edit environment to set your actual AUTH_TOKEN
. 6. Start Testing: Run individual requests or entire collection๐ง Dependencies
- commander: CLI argument parsing
When using
--spec option: No additional dependencies required
When using --config option: Requires @confytome/core for OpenAPI spec generation๐ก Examples
$3
`bash
Simple generation with existing spec
npx @confytome/postman --spec ./docs/api-spec.json --output ./public
`$3
`bash
#!/bin/bash
Generate Postman collection documentation in CI
npx @confytome/postman \\
--spec ./build/api-spec.json \\
--output ./dist/docs
`$3
`bash
Production docs
npx @confytome/postman \\
--spec ./specs/prod-api.json \\
--output ./docs/prodStaging docs
npx @confytome/postman \\
--spec ./specs/staging-api.json \\
--output ./docs/staging
`๐ ๏ธ Troubleshooting
$3
#### "Generated X API requests"
This shows the number of endpoints successfully converted to Postman requests. Each OpenAPI path/method combination becomes a Postman request.
#### "Specified OpenAPI spec file not found"
`bash
Check file path exists
ls -la ./path/to/your-spec.jsonUse absolute path if needed
npx @confytome/postman --spec $(pwd)/api-spec.json
`#### "OpenAPI spec not found, generating it first"
This means you're using config mode but don't have @confytome/core installed.
`bash
Option 1: Install core
npm install -g @confytome/coreOption 2: Use existing spec instead
npx @confytome/postman --spec ./path/to/existing-spec.json
``@confytome/postman is part of the confytome documentation ecosystem:
- @confytome/core - Plugin system & OpenAPI generator
- @confytome/markdown - Confluence-friendly Markdown docs
- @confytome/html - Professional HTML docs
- @confytome/swagger - Interactive Swagger UI
- @confytome/postman - Postman collections
MIT License - see the LICENSE file for details.
---
Generate beautiful Postman collection documentation from OpenAPI specifications in seconds.