Skip to content

Commit 4b940fa

Browse files
authored
Merge pull request #293 from ganesh-bruno/docs/aos
OAS spec revamp
2 parents 5c60f56 + be950b5 commit 4b940fa

File tree

9 files changed

+176
-57
lines changed

9 files changed

+176
-57
lines changed
-561 KB
Binary file not shown.
Binary file not shown.
178 KB
Binary file not shown.
925 KB
Binary file not shown.

src/pages/open-api/_meta.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
export default {
2-
"overview": "Overview"
3-
}
2+
"overview": "Overview",
3+
"importOAS": "Import an OpenAPI Spec",
4+
"exportOAS": "Export a Collection as OpenAPI Spec",
5+
"createOAS": "Create an OpenAPI Spec"
6+
}

src/pages/open-api/createOAS.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Callout } from "nextra/components";
2+
import PremiumBadge from "@/components/premium-badge";
3+
4+
# Create OpenAPI Specification (OAS)
5+
6+
Bruno provides a powerful interface for creating and managing OpenAPI Specifications (OAS). You can either design a new specification from scratch and view one as existing Open API spec.
7+
8+
## Viewing Existing OAS Files
9+
10+
You can view and interact with existing OAS files in Bruno using a SwaggerUI-like interface:
11+
12+
1. Open Bruno and Go to context menu (three dots)
13+
2. Select **Open API Spec** from dropdown
14+
15+
![open-open-api](/screenshots/open-api/open-api-spec.webp)
16+
17+
3. Browse and select your OAS file (`.yaml` or `.json`)
18+
4. The specification will open in a dedicated section of your Bruno sidebar
19+
20+
![view-open-api](/screenshots/open-api/view-oas-file.webp)
21+
22+
## Creating New OAS Files
23+
24+
1. Open Bruno and Go to context menu (three dots)
25+
2. Select **Create API Spec** from dropdown
26+
27+
![create-open-api](/screenshots/open-api/create-api-spec.webp)
28+
29+
3. Choose a name and location for your specification
30+
31+
![location-open-api](/screenshots/open-api/select-api-spec-location.webp)
32+
33+
4. Click on **Create** to generate OAS file.
34+
35+
36+
## Editing Your OAS File
37+
38+
Once created, you can edit your OAS file in Bruno's built-in editor:
39+
40+
1. The editor provides syntax highlighting
41+
2. Use the sidebar to navigate through different sections of your API
42+
3. Add or modify endpoints, parameters, and responses
43+
4. Include examples and descriptions for better documentation
44+
45+
![write-api-spec](/screenshots/open-api/write-api-spec.webp)

src/pages/open-api/exportOAS.mdx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { Callout } from "nextra/components";
2+
3+
# Export to OpenAPI Specification (OAS)
4+
5+
Bruno allows you to export your collections as OpenAPI Specification (OAS) files, enabling you to share your API definitions with other tools and team members. This feature helps maintain consistency across your API documentation and development workflow.
6+
7+
<Callout type="info">
8+
Bruno exports collections in OpenAPI Specification (OAS) V3 format, which is widely supported by API tools and platforms.
9+
</Callout>
10+
11+
## Prerequisites
12+
13+
Before exporting a collection, ensure:
14+
- Your collection is properly organized with clear request structures
15+
- All endpoints have appropriate HTTP methods defined
16+
- Request parameters and headers are properly configured
17+
18+
### Exporting to a File
19+
20+
1. Open Bruno and navigate to your collection
21+
2. Click on the context menu (three dots) in the collections panel
22+
3. Select **Share** from the dropdown menu
23+
24+
![collection-settings](/screenshots/git-integration/share-collection/1-share-collection-overview.webp)
25+
26+
4. Choose **OpenAPI Specification** option
27+
28+
![ExportModal](/screenshots/get-started/import-export/export_collection/2-export-options.webp)
29+
30+
5. Enter name of your file and location.
31+
6. Click **Create**
32+
33+
34+
## Example Exported Structure
35+
36+
```yaml
37+
openapi: 3.0.0
38+
info:
39+
title: Example API
40+
version: 1.0.0
41+
description: API documentation exported from Bruno
42+
paths:
43+
/users:
44+
get:
45+
summary: Get all users
46+
parameters:
47+
- name: limit
48+
in: query
49+
schema:
50+
type: integer
51+
responses:
52+
'200':
53+
description: Successful response
54+
content:
55+
application/json:
56+
schema:
57+
type: array
58+
items:
59+
$ref: '#/components/schemas/User'
60+
components:
61+
schemas:
62+
User:
63+
type: object
64+
properties:
65+
id:
66+
type: integer
67+
name:
68+
type: string
69+
```

src/pages/open-api/importOAS.mdx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { Callout } from "nextra/components";
2+
3+
# Import OpenAPI Specification (OAS)
4+
5+
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.
6+
7+
<Callout type="info">
8+
Bruno supports importing OpenAPI Specification (OAS) V3 files only.
9+
</Callout>
10+
11+
## Prerequisites
12+
13+
Before importing an OpenAPI specification, ensure you have:
14+
- A valid OpenAPI V3 specification file (YAML or JSON format)
15+
- Or a publicly accessible URL containing the OpenAPI specification
16+
17+
## Import Methods
18+
19+
Bruno offers two ways to import OpenAPI specifications:
20+
21+
1. **File Import**: Import from a local OpenAPI specification file
22+
2. **URL Import**: Import directly from a publicly accessible OpenAPI specification URL
23+
3. **Bruno Converter**: Programmatically convert an OAS file to a Bruno collection [by using our converter.](https://docs.usebruno.com/converters/overview)
24+
25+
### Importing from a File
26+
27+
1. Open Bruno and navigate to your collection
28+
2. Click on the context menu (three dots) in the collections panel
29+
3. Select **Import** from the dropdown menu
30+
4. Choose **OpenAPI V3 File** option
31+
32+
![select-openapi-file](/screenshots/open-api/select-open-api.webp)
33+
34+
5. Browse and select your OpenAPI specification file (`.yaml` or `.json`)
35+
6. Click **Import** to create the collection
36+
37+
38+
### Importing from a URL
39+
40+
The import method for URL option is same as for URL but you need to select **OpenAPI V3 URL** as option and provide URL of OAS file which is publically available.
41+
42+
After, Importing the OAS file the sample collection will looks like this.
43+
44+
![import-collection-oas](/screenshots/open-api/import-collection-oas.webp)
45+
46+
## Example OpenAPI Specifications
47+
48+
You can test the import functionality using these example OpenAPI specifications:
49+
50+
1. **Petstore API**:
51+
- URL: `https://petstore3.swagger.io/api/v3/openapi.json`
52+
- Description: A sample API for a pet store

src/pages/open-api/overview.mdx

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,10 @@ import { Callout } from "nextra/components";
44

55
# OpenAPI and Bruno
66

7-
Bruno allows you to work with OpenAPI Specification (OAS) files in a number of ways:
8-
9-
- Creating a collection from an OAS file import
10-
- Exporting a collection as an OAS file <PremiumBadge />
11-
- Viewing and Designing an OAS file <PremiumBadge />
12-
13-
## Creating a Collection from OAS Import
14-
15-
<Callout type="info">Bruno supports importing OAS V3 files only</Callout>
16-
17-
- Select Import
18-
- Choose OpenAPI V3 File
19-
20-
![select-openapi-file](/screenshots/open-api/select-open-api.webp)
21-
22-
- Select the file stored on your machine
23-
24-
## Exporting a Collection as an OAS File <PremiumBadge />
25-
26-
- Right-click on a collection and select Export
27-
28-
![select-export](/screenshots/open-api/select-export.webp)
29-
30-
- Choose OpenAPI Specification
31-
32-
![select-openapi-from-export-menu](/screenshots/open-api/select-open-api-menu.webp)
33-
34-
- Name your file and designate a location for it to be stored
7+
OpenAPI specification (AOS) is a standard formart for reading and describing the RESTful APIs. It provides a framework for defining apis, endpoints, auth, headers and etc. This format is easy to read and maintain API documentations.
358

36-
![export-open-api](/screenshots/open-api/export-api-spec.webp)
37-
38-
## Viewing and Designing an OAS file <PremiumBadge />
39-
40-
If you've saved or otherwise have an OAS file on your machine, you can view the OAS in a SwaggerUI-esque manner by:
41-
42-
- Selecting Open API Spec
43-
44-
![open-open-api](/screenshots/open-api/open-api-spec.webp)
45-
46-
- Choose the file name and location that you want to open
47-
48-
This will then open the spec in a separate section of your Bruno sidebar called APIs.
49-
50-
If you want to create an OAS file, you can:
51-
52-
- Select Create API Spec
53-
![create-open-api](/screenshots/open-api/create-api-spec.webp)
54-
55-
- Designate whether you want to create a Blank Spec, or generate it from an existing Bruno Collection
56-
57-
![location-open-api](/screenshots/open-api/select-api-spec-location.webp)
58-
59-
- Choose a name and location for the spec to be saved under.
60-
61-
You will now have the scaffolding of an OAS that you can continue to design.
9+
Bruno allows you to work with OpenAPI Specification (OAS) files in a number of ways:
6210

63-
![location-open-api](/screenshots/open-api/write-api-spec.webp)
11+
- [Creating a collection from an OAS file import](./importOAS.mdx)
12+
- [Exporting a collection as an OAS file](./exportOAS.mdx) <PremiumBadge />
13+
- [Viewing and Designing an OAS file](./createOAS.mdx) <PremiumBadge />

0 commit comments

Comments
 (0)