Importing Collections
Thebru import command allows you to convert API specifications from other formats into Bruno collections. This is useful for:
- Migrating from other API tools
- Generating collections from OpenAPI/Swagger specs
- Converting SOAP/WSDL services to Bruno format
- Automating collection creation from API documentation
Supported Formats
Bruno CLI currently supports importing from:- OpenAPI - OpenAPI 3.x and Swagger 2.x specifications (JSON/YAML)
- WSDL - SOAP Web Service Definition Language
OpenAPI Import
Basic Import
Import an OpenAPI specification from a local file:Import from URL
Import directly from a remote URL:Skip SSL Verification
For URLs with self-signed certificates:Collection Formats
Specify the output format:opencollection(default) - Uses YAML format (.yml)bru- Uses Bruno format (.bru)
Grouping Strategies
Control how requests are organized:tags- Group by OpenAPI tags (default)path- Group by URL path structure
Example: Tags Grouping
OpenAPI
Example: Path Grouping
OpenAPI
Export as JSON
Instead of creating a collection directory, export as a JSON file:WSDL Import
Basic WSDL Import
Import a SOAP service from WSDL:Import WSDL from URL
Import Options Reference
Path to the source file or URL. Can be a local file path or HTTP(S) URL.Aliases:
-sPath to the output directory where the collection will be created.Aliases:
-oConflicts with: --output-filePath to export the collection as a JSON file instead of a directory.Aliases:
-fConflicts with: --outputName for the imported collection. If not specified, uses the name from the specification or filename.Aliases:
-nFormat of the imported collection.Options:
opencollection- YAML formatbru- Bruno format
Skip SSL certificate verification when fetching from URLs.
How to organize imported requests (OpenAPI only).Aliases:
-gOptions:tags- Group by OpenAPI tagspath- Group by URL path structure
Complete Examples
Import Public API Spec
Import with Custom Format
Import and Export as JSON
Import WSDL Service
Output Structure
When importing to a directory (--output), Bruno creates:
--output-file), you get a single JSON file containing the entire collection structure.
Automating Imports
You can automate collection generation in your CI/CD pipeline:.github/workflows/generate-collection.yml
Post-Import Steps
- Review the collection - Check that all endpoints were imported correctly
- Add environments - Create environment files for different stages
- Add tests - Enhance requests with assertions and tests
- Configure auth - Set up authentication for your endpoints
- Run tests - Verify the collection works:
Troubleshooting
Invalid OpenAPI Spec
If import fails, validate your spec:URL Fetch Errors
For SSL errors with trusted sources:Empty Collection
If the imported collection is empty:- Verify the spec file is valid
- Check that paths are defined in the OpenAPI spec
- For WSDL, ensure the service definitions are present
Next Steps
Running Tests
Learn how to run your imported collection
CLI Options
Explore all CLI options and flags