Generate Postman collections automatically from any Spring Boot project — with or without OpenAPI/Swagger.
- Dual Strategy Support: Works with OpenAPI specs (JSON/YAML) or directly parses Java source code
- Static Analysis: No compilation required — parses
@RestControllerannotations directly - Spring Boot Aware: Understands
@GetMapping,@PostMapping,@RequestParam,@PathVariable, etc. - Type Resolution: Automatically converts Java types to JSON Schema
- Flexible Input: Accepts project paths, file paths, or OpenAPI URLs
- Large Codebase Support: Parallel processing with configurable concurrency
- Package Filtering: Include/exclude patterns for targeting specific packages
npm install -g springboot2postmanOr use directly with npx:
npx springboot2postman --project ./my-spring-app# From a Spring Boot project directory
springboot2postman --project . --out api.postman_collection.json
# From an OpenAPI URL
springboot2postman --project https://api.example.com/v3/api-docs --out api.json
# With a custom base URL
springboot2postman --project ./my-app --base-url https://staging.example.com
# Large project with filtering
springboot2postman --project ./large-app --include "com.example.api.*" --exclude "*Test*" --concurrency 10| Option | Description | Default |
|---|---|---|
--project <path> |
Project path or OpenAPI URL (required) | — |
--out <file> |
Output file path | ./postman_collection.json |
--base-url <url> |
Override the base URL in the collection | — |
--format <format> |
Output format: postman or openapi |
postman |
--include <patterns> |
Include only matching packages (comma-separated globs) | — |
--exclude <patterns> |
Exclude matching packages (comma-separated globs) | — |
--concurrency <n> |
Max parallel file parsing | 5 |
--verbose |
Enable verbose logging | false |
The tool automatically detects the best approach:
- URL Input → Fetches and converts OpenAPI spec
- OpenAPI File Found → Uses OpenAPI strategy (looks for
openapi.json,swagger.yaml, etc.) - Java Controllers Found → Uses Parser strategy (static analysis)
When no OpenAPI spec is available, the tool:
- Scans for files with
@RestControlleror@Controllerannotations - Applies include/exclude filters
- Parses controllers in parallel (configurable concurrency)
- Extracts endpoint mappings (
@GetMapping,@PostMapping, etc.) - Resolves parameter annotations (
@PathVariable,@RequestParam,@RequestBody) - Converts Java types to JSON Schema
- Builds an OpenAPI specification
- Converts to Postman collection format
| Controller | Method | Parameter |
|---|---|---|
@RestController |
@GetMapping |
@PathVariable |
@Controller |
@PostMapping |
@RequestParam |
@RequestMapping |
@PutMapping |
@RequestBody |
@DeleteMapping |
@RequestHeader |
|
@PatchMapping |
| Code | Description |
|---|---|
PROJECT_NOT_FOUND |
The specified project path does not exist |
NO_CONTROLLERS_FOUND |
No Spring Boot controllers found in the project |
OPENAPI_FETCH_FAILED |
Failed to fetch OpenAPI specification from URL/file |
INVALID_OPENAPI |
The OpenAPI specification is invalid or unsupported |
PARSE_ERROR |
Failed to parse a Java file |
CONVERSION_FAILED |
Failed to convert to Postman collection |
- Node.js 16.0.0 or higher
- npm 7.0.0 or higher