bru import command converts API specifications from other formats (OpenAPI, WSDL) into Bruno collections, making it easy to migrate existing API documentation or create collections from API specs.
Synopsis
Arguments
Type of collection to import. Supported values:
openapi- Import from OpenAPI/Swagger specification (JSON or YAML)wsdl- Import from WSDL (Web Services Description Language)
Options
Source
Path to the source file or URL. Supports:
- Local file paths (absolute or relative)
- HTTP/HTTPS URLs
- For OpenAPI:
.json,.yml, or.yamlfiles - For WSDL:
.wsdlor.xmlfiles
--source api.yml--source https://example.com/api-spec.json
Output
Path to the output directory where the Bruno collection will be created.
- If the path is an existing directory, a new subdirectory will be created using the collection name
- If the path doesn’t exist, it will be created as the collection directory
- The parent directory must exist
--output-file.Example: --output ~/Desktop/my-collectionPath to the output JSON file. Instead of creating a Bruno collection directory structure, this exports the collection as a single JSON file.Conflicts with
--output.Example: --output-file ~/Desktop/my-collection.jsonYou must specify either
--output or --output-file, but not both.Collection Configuration
Name for the imported collection. If not specified, the collection name is derived from:
- The OpenAPI spec’s
info.titlefield - The WSDL service name
- The source filename
--collection-name "My API"Format of the imported collection files. Available formats:
opencollection- Uses YAML format (.yml files) for the collection structurebru- Uses Bruno’s native .bru format
--collection-format bruOpenAPI-Specific Options
How to group the imported requests. Only applicable for OpenAPI imports.Available options:
tags- Group requests by OpenAPI tags (default)path- Group requests by URL path structure
--group-by pathNetwork & Security
Skip SSL certificate verification when fetching from URLs. Useful when importing from servers with self-signed certificates.Example:
--source https://self-signed.example.com/api.json --insecureExit Codes
Import successful - collection created or JSON file written
Import failed due to one of the following reasons:
- Unsupported import type
- Missing required options (source, output, or output-file)
- Source file or URL not found
- Failed to parse the specification
- Invalid specification format
- Output directory does not exist
- Output directory is not empty
- Network error when fetching from URL
- SSL certificate error
Examples
OpenAPI Import
Basic Import from Local File
Import from a local OpenAPI YAML file:Import from URL
Import from a remote OpenAPI specification:Export as JSON
Export the imported collection as a single JSON file:Grouping Options
Group requests by OpenAPI tags (default):Collection Format
Import as Bruno native format:WSDL Import
Basic Import from Local File
Import from a local WSDL file:Import from URL
Import from a remote WSDL:Understanding OpenAPI Grouping
Group by Tags (Default)
When using--group-by tags, the importer creates folders based on OpenAPI tags:
Group by Path
When using--group-by path, the importer creates folders based on URL structure:
Collection Formats
OpenCollection Format (YAML)
Theopencollection format uses YAML files:
Bruno Native Format
Thebru format uses Bruno’s native .bru files:
Error Handling
Common Errors
Source not found:--insecure flag if you trust the source.
Invalid specification: