https://github.com/rspereiratech/openapi-collection-generator-insomnia
Insomnia collection generator plugin for OpenAPI specifications — converts OpenAPI specs into importable Insomnia v4 exports.
https://github.com/rspereiratech/openapi-collection-generator-insomnia
api collection-generator insomnia java java17 openapi openapi-spec openapi3 rest-api swagger
Last synced: 28 days ago
JSON representation
Insomnia collection generator plugin for OpenAPI specifications — converts OpenAPI specs into importable Insomnia v4 exports.
- Host: GitHub
- URL: https://github.com/rspereiratech/openapi-collection-generator-insomnia
- Owner: rspereiratech
- License: mit
- Created: 2026-05-08T14:51:18.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-05-08T17:22:08.000Z (about 2 months ago)
- Last Synced: 2026-05-08T18:37:15.139Z (about 2 months ago)
- Topics: api, collection-generator, insomnia, java, java17, openapi, openapi-spec, openapi3, rest-api, swagger
- Language: Java
- Homepage:
- Size: 33.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-insomnia
[](https://github.com/rspereiratech/openapi-collection-generator-insomnia/actions/workflows/build.yml)
[](https://github.com/rspereiratech/openapi-collection-generator-insomnia/actions/workflows/codeql.yml)
[](LICENSE)





[](https://nowpayments.io/donation/rspereiratech)
Insomnia collection generator plugin for OpenAPI specifications — converts
OpenAPI specs into importable [Insomnia](https://insomnia.rest/) v4 exports.
This module is the **Insomnia format adapter** in the
`openapi-collection-generator` family. Given an `OpenAPI` model and a
`GenerationConfig`, it returns a JSON string that Insomnia can import as a
workspace with environments, folders, and HTTP requests.
## What it produces
- An Insomnia export document (`__export_format: 4`) containing:
- **One workspace** named after the OpenAPI title (or the configured name).
- **One environment per OpenAPI server**, with a `base_url` variable.
Global security variables are merged into the first environment.
- **One folder per OpenAPI tag**, plus a `Callbacks` folder when callbacks
are present, plus a `default` folder for untagged operations.
- **One request per operation**, with URL, headers, query parameters, and
a body example derived from `examples`, `example`, or the schema.
- Path parameters are converted from `{petId}` to Insomnia's `:petId`.
- Deprecated operations are prefixed with `⚠` and get a warning in the
description.
- Vendor extensions can rewrite name/description through the extension chain
exposed by the core module.
## Maven coordinates
```xml
io.github.rspereiratech
openapi-collection-generator-insomnia
1.0.0-SNAPSHOT
```
The version is inherited from the
[`openapi-collection-generator-parent`](https://github.com/rspereiratech)
parent POM.
## Quick start
This module is normally invoked through
`openapi-collection-generator-maven-plugin`. If you want to use it
programmatically:
```java
InsomniaCollectionGenerator generator = new InsomniaCollectionGenerator(
idGenerator, // IdGenerator
requestBuilder, // InsomniaRequestBuilder (DefaultInsomniaRequestBuilder)
serializer, // CollectionSerializer
securityApplier, // SecurityApplier
serverEnvGenerator); // ServerEnvironmentGenerator
String insomniaJson = generator.generate(openApi, generationConfig);
// Save insomniaJson to a file and import it from Insomnia → Application → Import.
```
All collaborators are SPIs from `openapi-collection-generator-core`, with
default implementations available in this module under their respective
packages (`url/`, `header/`, `body/`, `parameter/`, `builder/`,
`deprecated/`).
## Building
```bash
mvn clean verify
```
Requires **Java 17+** and Maven 3.9+. The parent POM and the `-core` module
must be installed in your local Maven repository (`mvn install` from the
multi-module root) before building this module standalone.
## Documentation
| Document | What it covers |
|---|---|
| [docs/configuration.md](docs/configuration.md) | Build configuration, Maven coordinates, parent POM, dependencies |
| [docs/architecture.md](docs/architecture.md) | High-level design, collaborator pattern, control flow |
| [docs/components.md](docs/components.md) | Per-package walk-through |
| [docs/publishing.md](docs/publishing.md) | SNAPSHOT publishing to Sonatype Central, required secrets |
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md). Bug reports and pull requests are
welcome — please make sure your change belongs in this module and not in a
sibling one.
All participants are expected to follow the
[Code of Conduct](CODE_OF_CONDUCT.md).
## Security
Found a vulnerability? Please follow the process in [SECURITY.md](SECURITY.md)
and **do not** open public GitHub issues for security-sensitive reports.
## 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
[MIT](LICENSE) © 2026 rspereiratech