https://github.com/rspereiratech/openapi-collection-generator-postman
Postman collection generator plugin for OpenAPI specifications — converts OpenAPI specs into ready-to-import Postman collections (v2.1.0).
https://github.com/rspereiratech/openapi-collection-generator-postman
api api-tools code-generator developer-tools java openapi openapi-specification openapi3 postman postman-collection rest-api
Last synced: 16 days ago
JSON representation
Postman collection generator plugin for OpenAPI specifications — converts OpenAPI specs into ready-to-import Postman collections (v2.1.0).
- Host: GitHub
- URL: https://github.com/rspereiratech/openapi-collection-generator-postman
- Owner: rspereiratech
- License: mit
- Created: 2026-05-08T15:15:54.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2026-05-08T17:16:35.000Z (about 1 month ago)
- Last Synced: 2026-05-08T17:31:42.020Z (about 1 month ago)
- Topics: api, api-tools, code-generator, developer-tools, java, openapi, openapi-specification, openapi3, postman, postman-collection, rest-api
- Language: Java
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# OpenAPI Collection Generator - Postman
[](https://github.com/rspereiratech/openapi-collection-generator-postman/actions/workflows/build.yml)
[](https://github.com/rspereiratech/openapi-collection-generator-postman/actions/workflows/codeql.yml)
[](LICENSE)





[](https://nowpayments.io/donation/rspereiratech)
Postman collection generator plugin for the [openapi-collection-generator](https://github.com/rspereiratech) project. It converts an OpenAPI 3 specification into a ready-to-import **Postman Collection v2.1.0**, plus one Postman **environment** file per declared server.
## Features
- Generates Postman Collection v2.1.0 JSON from any OpenAPI 3 specification.
- Groups requests into folders by OpenAPI **tag** (untagged operations go to `default`, callbacks to `Callbacks`).
- Builds full request models: URL, path/query parameters, headers, and JSON request bodies.
- Resolves server URLs and emits one Postman **environment** file per server.
- Applies global security schemes as collection/environment variables with secret placeholders.
- Marks deprecated operations with a `[DEPRECATED]` prefix and a warning in the description.
- Enriches descriptions with OpenAPI response **links** and processes `x-*` vendor extensions.
- Pluggable architecture: implements the `CollectionGenerator` SPI from `openapi-collection-generator-core`.
## Requirements
- Java 17+
- Maven 3.8+
- The parent project [`openapi-collection-generator-parent`](https://github.com/rspereiratech) and the `openapi-collection-generator-core` module on your build path.
## Build
```bash
mvn clean install
```
## Usage
This module is a **plugin** consumed by the core generator. Add it as a dependency alongside the core:
```xml
io.github.rspereiratech
openapi-collection-generator-postman
1.0.0-SNAPSHOT
```
Then invoke the core pipeline. The entry point is `PostmanCollectionGenerator`, which implements `CollectionGenerator` and is wired through the plugin's generation pipeline. It produces:
- `.postman_collection.json` — the collection itself.
- `.postman_environment.json` — one per server defined in the OpenAPI spec.
### Programmatic example
```java
PostmanCollectionGenerator generator = new PostmanCollectionGenerator(
operationGrouper,
collectionSerializer,
securityApplier,
serverEnvironmentGenerator
);
String collectionJson = generator.generate(openApi, generationConfig);
List environments = generator.generateAdditionalFiles(openApi, generationConfig);
```
## Project structure
```
src/main/java/com/github/rspereiratech/openapi/collection/generator/postman/
├── body/ # Request body builders
├── builder/ # Postman item builders (request → item)
├── deprecated/ # Deprecation marker
├── generator/ # PostmanCollectionGenerator entry point
├── grouper/ # Tag-based operation grouping
├── header/ # Header builders
├── model/ # Postman v2.1.0 data model (records)
└── url/ # URL builders (path + query params)
```
## Output
- **Collection**: Postman Collection v2.1.0 JSON, ready to import via *File → Import* in Postman.
- **Environment(s)**: one per server, with `baseUrl` plus any required security variables (API keys, tokens, etc.) as secret placeholders.
See [docs/output.md](docs/output.md) for sample JSON and import instructions.
## Documentation
Full documentation lives in [`docs/`](docs/):
- [Architecture](docs/architecture.md) — how the plugin is structured.
- [Generation Pipeline](docs/generation-pipeline.md) — step-by-step description of the conversion.
- [Configuration](docs/configuration.md) — config options and OpenAPI → Postman mapping.
- [Data Model](docs/data-model.md) — the Postman v2.1.0 records used internally.
- [Extension Points](docs/extension-points.md) — how to customize behavior.
- [Output](docs/output.md) — sample JSON, file naming, and import steps.
## Contributing
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a PR.
## Security
If you find a security issue, please follow the process in [SECURITY.md](SECURITY.md) — do **not** open a public issue.
## Support
[](https://nowpayments.io/donation/rspereiratech)
If this project saves you time, consider supporting development
via [NOWPayments](https://nowpayments.io/donation/rspereiratech).
Every contribution helps keep it maintained — thank you!
## License
This project is licensed under the [MIT License](LICENSE).