> ## Documentation Index
> Fetch the complete documentation index at: https://docs.requestly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Convert AsyncAPI 2.x to 3.0

> Turn an AsyncAPI 2.x specification into a new AsyncAPI 3.0 specification, review every change of meaning before it is created, and fix what 3.0 cannot hold.

AsyncAPI 3.0 reorganises a 2.x document: operations move out of their channels, `publish` becomes `receive` and `subscribe` becomes `send`, and binding versions change. Requestly can do that rewrite for you. Converting creates a **new** AsyncAPI 3.0 specification and leaves the 2.x one exactly as it is, so you can compare the two side by side.

## Prerequisites

* The specification is AsyncAPI 2.0 through 2.6. The action does not appear on any other format.
* Your changes to it are saved. Until they are, the action is disabled and its tooltip says why.
* Your role can create specifications. Without that, the action is disabled with the reason on hover.

## Convert a specification

**1. Open the action**

In the **API Design** sidebar, open the specification row's **More actions** menu and choose **Convert to AsyncAPI 3.0…**.

**2. Read the preview**

Requestly converts a copy and shows the result before anything is created. The preview names the new specification, states that the source stays as it is, and lists:

* Each **change of meaning or loss** it detected, with the place in your source it applies to. When there are none, it says "No change of meaning or loss was detected."
* Each **binding upgrade**, with its location, for example "The mqtt server binding moves from 0.1.0 to 0.2.0."

Not every difference can be detected, so review the new specification after it is created.

**3. Check the converted document (optional)**

Click **View converted spec** to read the exact document that will be created, and **Back to summary** to return. The text you see is the text that is saved.

**4. Create it**

Click **Create converted specification**. The new specification opens in a tab.

> [!TIP]
>
> The new specification appears under **Specs** with an **AsyncAPI 3.0** chip, named after the converted document's `info.title`. If the title is blank, it takes the source specification's name instead. The source keeps its own chip, such as **AsyncAPI 2.6**.

A specification split across several files becomes a single-file 3.0 specification.

## What the preview can report

| Change | What it means |
| - | - |
| Trait precedence | In 3.0 an operation's or message's own value wins over its trait's. The row names the fields where the two disagreed, so the winning value changes. |
| Parameter keywords dropped | A 3.0 parameter cannot express some schema keywords, such as `pattern`. The row lists the ones removed. |
| Parameter schema dropped | A parameter whose schema is a `$ref` cannot be carried over, so its schema is removed. |
| Binding field dropped | The binding version 3.0 accepts has no such field, so it is removed. |
| Security requirement changed | Schemes required together become alternatives, an anonymous `{}` alternative is dropped, or a requirement is dropped because 3.0 allows scopes only on OAuth 2 and OpenID Connect schemes. |

## Binding upgrades

AsyncAPI 3.0 does not accept some older binding versions, so conversion moves them to the lowest version 3.0 accepts:

| Protocol | From | To | Field removed |
| - | - | - | - |
| MQTT | 0.1.0 | 0.2.0 | None |
| Kafka | 0.1.0 | 0.3.0 | None |
| HTTP | 0.1.0 | 0.2.0 | The operation binding's `type` |
| AMQP | 0.2.0 | 0.3.0 | The operation binding's `replyTo` |
| Google Pub/Sub | 0.1.0 | 0.2.0 | The channel binding's `topic` |

A binding at a version Requestly cannot upgrade keeps its version, and the new specification shows an error on its `bindingVersion` for you to fix.

> [!NOTE]
>
> AsyncAPI 2.x binding contents are not checked in the [Issues panel](https://docs.requestly.com/api-client/api-design/issues-and-governance.md), but 3.0 binding contents are. A binding that was already invalid in your 2.x document can therefore appear as an error in the new specification, for example an MQTT `qos` outside 0, 1 and 2.

## When Requestly cannot convert

If your specification holds something AsyncAPI 3.0 has no place for, the dialog is titled **Cannot convert** and reads "These parts of the specification have no AsyncAPI 3.0 equivalent. Change them, then convert again." Nothing is created. Every problem is listed at once, with its location in your source:

* **A binding for a protocol 3.0 does not list at that position**, such as `mqtt5`, `pulsar`, `ros2` or `mercure`. 3.0 accepts only the protocols it defines for each kind of binding.
* **A channel parameter whose schema has a non-string `enum`, `default`, `const` or `examples` value.** 3.0 parameter values are strings, so `3` would silently become `"3"`.

Edit the source specification to remove or change each listed item, save, and convert again.

Conversion can also stop for other reasons:

* **"This specification has errors that stop the conversion. Fix them, then convert again."** Click **Show in Issues** to see them in the source specification.
* **A reference that cannot be resolved.** Conversion first gathers the specification into one document, so a broken `$ref` stops it. The dialog names the problem, and **Show in Issues** opens the list.
* **"The conversion failed. Nothing was created. Try again, and contact support if it keeps failing."**
* **"Could not create the converted specification. Nothing was created. Try again."**

## Next steps

* [Create and edit a specification](https://docs.requestly.com/api-client/api-design/create-and-edit-a-specification.md) to work in the new 3.0 specification.
* [Issues & Governance](https://docs.requestly.com/api-client/api-design/issues-and-governance.md) to clear any errors the new specification shows.
* [Versions & Releases](https://docs.requestly.com/api-client/api-design/versions-and-releases.md) to release it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.