https://github.com/rspereiratech/openapi-collection-generator-maven-plugin
Maven plugin that generates Postman and Insomnia collections from OpenAPI specifications.
https://github.com/rspereiratech/openapi-collection-generator-maven-plugin
api-tools code-generation insomnia insomnia-collection java java17 maven-plugin openapi openapi3 postman postman-collection swagger
Last synced: 18 days ago
JSON representation
Maven plugin that generates Postman and Insomnia collections from OpenAPI specifications.
- Host: GitHub
- URL: https://github.com/rspereiratech/openapi-collection-generator-maven-plugin
- Owner: rspereiratech
- License: mit
- Created: 2026-05-08T16:04:06.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2026-05-08T17:18:27.000Z (about 1 month ago)
- Last Synced: 2026-05-08T19:24:53.008Z (about 1 month ago)
- Topics: api-tools, code-generation, insomnia, insomnia-collection, java, java17, maven-plugin, openapi, openapi3, postman, postman-collection, swagger
- Language: Java
- Homepage:
- Size: 74.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 Maven Plugin
[](https://github.com/rspereiratech/openapi-collection-generator-maven-plugin/actions/workflows/build.yml)
[](https://github.com/rspereiratech/openapi-collection-generator-maven-plugin/actions/workflows/codeql.yml)
[](LICENSE)
[](https://adoptium.net/)
[](https://maven.apache.org/)
[](https://maven.apache.org/ref/3.9.6/maven-plugin-api/)
[](https://www.openapis.org/)
[](https://github.com/swagger-api/swagger-parser)
[](https://schema.postman.com/)
[](https://insomnia.rest/)
[](https://nowpayments.io/donation/rspereiratech)
Maven plugin that generates **Postman** and **Insomnia** collections from an OpenAPI specification, with support for security schemes, custom `x-*` extensions, callbacks, and per-server environment files.
## Requirements
- Java 17+
- Maven 3.9+
## Usage
Add the plugin to your project's `pom.xml`:
```xml
io.github.rspereiratech
openapi-collection-generator-maven-plugin
1.0.0-SNAPSHOT
generate
${project.basedir}/src/main/resources/openapi.yaml
POSTMAN
```
Then run:
```bash
mvn generate-resources
```
Generated files are written to `${project.build.directory}/generated-collections` by default.
## Goal
### `generate`
Reads an OpenAPI specification, parses it, and writes the resulting collection (and any environment files) to the output directory. Bound by default to the `generate-resources` phase.
## Configuration
| Parameter | Property | Default | Description |
|------------------|---------------------------|--------------------------------------------------------|--------------------------------------------------------------------------|
| `specFile` | `openapi.spec` | `${project.basedir}/src/main/resources/openapi.yaml` | Path to the OpenAPI specification file. Required. |
| `outputDirectory`| `openapi.outputDir` | `${project.build.directory}/generated-collections` | Output directory for the generated collection and environment files. |
| `format` | `openapi.format` | `POSTMAN` | Target collection format. Supported values: `POSTMAN`, `INSOMNIA`. |
| `collectionName` | `openapi.collectionName` | API title from the spec | Optional collection name override. |
| `baseUrl` | `openapi.baseUrl` | First server URL from the spec | Optional base URL override for the generated collection. |
See [docs/configuration.md](docs/configuration.md) for full details.
## Command-line example
```bash
mvn io.github.rspereiratech:openapi-collection-generator-maven-plugin:generate \
-Dopenapi.spec=src/main/resources/petstore.yaml \
-Dopenapi.format=INSOMNIA \
-Dopenapi.outputDir=target/collections
```
## Features
- **Postman v2.1.0** and **Insomnia v4** output formats.
- Tag-based folder grouping.
- Per-server **environment files** (Postman) or embedded environments (Insomnia).
- Built-in support for OpenAPI **security schemes**: HTTP Bearer/Basic, API key (header/query/cookie), and OAuth2 — see [docs/security.md](docs/security.md).
- Custom **`x-*` extensions** for marking operations as Beta, Internal, or deprecated since a given version — see [docs/extensions.md](docs/extensions.md).
- **Callbacks** flattened into a dedicated folder.
- **Deterministic IDs** for diff-stable, code-review-friendly output.
## Documentation
Full documentation lives in the [`docs/`](docs/) folder:
- [Configuration](docs/configuration.md)
- [Architecture](docs/architecture.md)
- [Output](docs/output.md)
- [Output Formats (Postman / Insomnia)](docs/formats.md)
- [OpenAPI Extensions](docs/extensions.md)
- [Security](docs/security.md)
## Contributing
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, coding guidelines, and the pull-request workflow.
## Security
To report a security issue, please follow the process described 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).