Import OpenAPI Specification (OAS)
Bruno provides seamless integration with OpenAPI Specification (OAS), allowing you to import API definitions through both files and URLs. This feature enables you to quickly create collections in Bruno by leveraging existing OpenAPI documentation.
Bruno supports importing OpenAPI Specification (OAS) V3 files only.
Prerequisites
Before importing an OpenAPI specification, ensure you have:
- A valid OpenAPI V3 specification file (YAML or JSON format)
- Or a publicly accessible URL containing the OpenAPI specification
Import Methods
Bruno offers two ways to import OpenAPI specifications:
- File Import: Import from a local OpenAPI specification file
- URL Import: Import directly from a publicly accessible OpenAPI specification URL
- Bruno Converter: Programmatically convert an OAS file to a Bruno collection by using our converter ↗.
Importing from a File
- Open Bruno and navigate to your collection
- Click on the context menu (three dots) in the collections panel
- Select Import from the dropdown menu
- Choose OpenAPI V3 File option
- Browse and select your OpenAPI specification file (
.yaml
or.json
) - Configure the import settings (see Import Settings below)
- Click Import to create the collection
Importing from a URL
- Select OpenAPI V3 URL and provide the public URL of the OpenAPI file you’re trying to import
- Configure the import settings (see Import Settings below)
- Click Import to create the collection
After importing the OAS file, the sample collection will look like this:
Import Settings
Bruno provides flexible options for organizing your imported OpenAPI collection. You can choose how to group your API endpoints into folders during the import process.
Folder Arrangement Options
When importing an OpenAPI specification, you can choose between two folder grouping strategies:
Path-Based Grouping
Path-based grouping organizes endpoints into folders based on their URL path structure. This approach mirrors how APIs are typically organized and provides better compatibility with Postman imports.
Example:
/api/v1/users → /api/v1/users/ folder
/api/v1/users/{id} → /api/v1/users/ folder
/api/v1/orders → /api/v1/orders/ folder
/api/v1/orders/{id} → /api/v1/orders/ folder
Tag-Based Grouping (default)
Tag-based grouping organizes endpoints into folders based on the tags
defined in the OpenAPI specification. This approach groups endpoints by their functional purpose as defined by the API author.
Example:
# OpenAPI spec with tags
paths:
/users:
get:
tags: [User Management]
/users/{id}:
get:
tags: [User Management]
/orders:
get:
tags: [Order Management]
Configuring Import Settings
- Select Import Method: Choose either file or URL import
- Choose Folder Arrangement: Select your preferred grouping method from the dropdown:
- Paths: Group by URL path structure
- Tags (default): Group by OpenAPI tags
- Import: Click the import button to create your collection
Example OpenAPI Specifications
You can test the import functionality using these example OpenAPI specifications:
- Petstore API:
- URL:
https://petstore3.swagger.io/api/v3/openapi.json
- Description: A sample API for a pet store
- URL: