Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@

The latest draft specification can be found at [spec/asyncapi.md](./spec/asyncapi.md) which tracks the latest commit to the master branch in this repository.

* [Version 2.1.0](https://github.com/asyncapi/spec/blob/v2.1.0/spec/asyncapi.md) (latest)
* [Version 2.2.0](https://github.com/asyncapi/spec/blob/v2.2.0/spec/asyncapi.md) (latest)
* [Version 2.1.0](https://github.com/asyncapi/spec/blob/v2.1.0/spec/asyncapi.md)
* [Version 2.0.0](https://github.com/asyncapi/spec/blob/2.0.0/versions/2.0.0/asyncapi.md)
* [Version 1.2.0](https://github.com/asyncapi/spec/blob/1.2.0/README.md) (deprecated)
* [Version 1.1.0](https://github.com/asyncapi/spec/blob/1.1.0/README.md) (deprecated)
Expand Down
2 changes: 1 addition & 1 deletion examples/anyof.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: AnyOf example
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/application-headers.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Application Headers example
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/correlation-id.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Correlation ID Example
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/gitter-streaming.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
id: 'urn:com:gitter:streaming:api'
info:
title: Gitter Streaming API
Expand Down
2 changes: 1 addition & 1 deletion examples/mercure.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Mercure Hub Example
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/not.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Not example
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/oneof.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: OneOf example
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/rpc-client.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
id: 'urn:rpc:example:client'
defaultContentType: application/json

Expand Down
2 changes: 1 addition & 1 deletion examples/rpc-server.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
id: 'urn:rpc:example:server'
defaultContentType: application/json

Expand Down
2 changes: 1 addition & 1 deletion examples/simple.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Account Service
version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion examples/slack-rtm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
id: 'urn:com:slack:rtm:api'
info:
title: Slack Real Time Messaging API
Expand Down
2 changes: 1 addition & 1 deletion examples/streetlights-kafka.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Streetlights Kafka API
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/streetlights-mqtt.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
asyncapi: '2.1.0'
asyncapi: '2.2.0'
info:
title: Streetlights MQTT API
version: '1.0.0'
Expand Down
2 changes: 1 addition & 1 deletion examples/websocket-gemini.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# - Live stream about topics mentioned in part 1 and 2 articles: https://www.youtube.com/watch?v=8tFBcf31e_c
#

asyncapi: '2.1.0'
asyncapi: '2.2.0'

#
# Overal information for users of the application
Expand Down
47 changes: 43 additions & 4 deletions spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Part of this content has been taken from the great work done by the folks at the [OpenAPI Initiative](https://openapis.org). Mainly because **it's a great work** and we want to keep as much compatibility as possible with the [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification).

#### Version 2.1.0
#### Version 2.2.0

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

Expand Down Expand Up @@ -99,7 +99,7 @@ A message is the mechanism by which information is exchanged via a channel betwe
A channel is an addressable component, made available by the server, for the organization of [messages](#definitionsMessage). [Producer](#definitionsProducer) applications send messages to channels and [consumer](#definitionsConsumer) applications consume messages from channels. Servers MAY support many channel instances, allowing messages with different content to be addressed to different channels. Depending on the server implementation, the channel MAY be included in the message via protocol-defined headers.

#### <a name="definitionsProtocol"></a>Protocol
A protocol is the mechanism (wireline protocol or API) by which [messages](#definitionsMessage) are exchanged between the application and the [channel](#definitionsChannel). Example protocols include, but are not limited to, AMQP, HTTP, JMS, Kafka, MQTT, STOMP, Mercure, WebSocket.
A protocol is the mechanism (wireline protocol or API) by which [messages](#definitionsMessage) are exchanged between the application and the [channel](#definitionsChannel). Example protocols include, but are not limited to, AMQP, HTTP, JMS, Kafka, Anypoint MQ, MQTT, STOMP, Mercure, WebSocket.

#### <a name="definitionsBindings"></a>Bindings
A "binding" (or "protocol binding") is a mechanism to define protocol-specific information. Therefore, a protocol binding MUST define protocol-specific information only.
Expand Down Expand Up @@ -351,7 +351,7 @@ An object representing a message broker, a server or any other kind of computer
Field Name | Type | Description
---|:---:|---
<a name="serverObjectUrl"></a>url | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.
<a name="serverObjectProtocol"></a>protocol | `string` | **REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `mqtt`, `secure-mqtt`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.
<a name="serverObjectProtocol"></a>protocol | `string` | **REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `anypointmq`, `mqtt`, `secure-mqtt`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.
<a name="serverObjectProtocolVersion"></a>protocolVersion | `string` | The version of the protocol used for connection. For instance: AMQP `0.9.1`, HTTP `2.0`, Kafka `1.0.0`, etc.
<a name="serverObjectDescription"></a>description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.
<a name="serverObjectVariables"></a>variables | Map[`string`, [Server Variable Object](#serverVariableObject)] | A map between a variable name and its value. The value is used for substitution in the server's URL template.
Expand Down Expand Up @@ -563,6 +563,7 @@ Field Name | Type | Description
---|:---:|---
<a name="channelItemObjectRef"></a>$ref | `string` | Allows for an external definition of this channel item. The referenced structure MUST be in the format of a [Channel Item Object](#channelItemObject). If there are conflicts between the referenced definition and this Channel Item's definition, the behavior is *undefined*.
<a name="channelItemObjectDescription"></a>description | `string` | An optional description of this channel item. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.
<a name="channelItemObjectServers"></a>servers | [`string`] | The servers on which this channel is available, specified as an optional unordered list of names (string keys) of [Server Objects](#serverObject) defined in the [Servers Object](#serversObject) (a map). If `servers` is absent or empty then this channel must be available on all servers defined in the [Servers Object](#serversObject).
<a name="channelItemObjectSubscribe"></a>subscribe | [Operation Object](#operationObject) | A definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.
<a name="channelItemObjectPublish"></a>publish | [Operation Object](#operationObject) | A definition of the PUBLISH operation, which defines the messages consumed by the application from the channel.
<a name="channelItemObjectParameters"></a>parameters | [Parameters Object](#parametersObject) | A map of the parameters included in the channel name. It SHOULD be present only when using channels with expressions (as defined by [RFC 6570 section 2.2](https://tools.ietf.org/html/rfc6570#section-2.2)).
Expand Down Expand Up @@ -646,6 +647,40 @@ subscribe:
```


Using explicit by-name references to the servers on which the channel is available:

```json
{
"description": "This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.",
"servers": [
"rabbitmqBrokerInProd",
"rabbitmqBrokerInStaging",
],
"subscribe": {
"message": {
"$ref": "#/components/messages/WebUICommand"
}
},
"bindings": {
"amqp": {
"is": "queue"
}
}
}
```

```yaml
description: This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.
servers:
- rabbitmqBrokerInProd
- rabbitmqBrokerInStaging
subscribe:
message:
$ref: "#/components/messages/WebUICommand"
bindings:
amqp:
is: queue
```



Expand Down Expand Up @@ -897,6 +932,7 @@ Field Name | Type | Description
<a name="serverBindingsObjectHTTP"></a>`http` | [HTTP Server Binding](https://github.com/asyncapi/bindings/blob/master/http#server) | Protocol-specific information for an HTTP server.
<a name="serverBindingsObjectWebSockets"></a>`ws` | [WebSockets Server Binding](https://github.com/asyncapi/bindings/blob/master/websockets#server) | Protocol-specific information for a WebSockets server.
<a name="serverBindingsObjectKafka"></a>`kafka` | [Kafka Server Binding](https://github.com/asyncapi/bindings/blob/master/kafka#server) | Protocol-specific information for a Kafka server.
<a name="serverBindingsObjectAnypointMQ"></a>`anypointmq` | [Anypoint MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#server) | Protocol-specific information for an Anypoint MQ server.
<a name="serverBindingsObjectAMQP"></a>`amqp` | [AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server) | Protocol-specific information for an AMQP 0-9-1 server.
<a name="serverBindingsObjectAMQP1"></a>`amqp1` | [AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server) | Protocol-specific information for an AMQP 1.0 server.
<a name="serverBindingsObjectMQTT"></a>`mqtt` | [MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server) | Protocol-specific information for an MQTT server.
Expand Down Expand Up @@ -925,6 +961,7 @@ Field Name | Type | Description
<a name="channelBindingsObjectHTTP"></a>`http` | [HTTP Channel Binding](https://github.com/asyncapi/bindings/blob/master/http/README.md#channel) | Protocol-specific information for an HTTP channel.
<a name="channelBindingsObjectWebSockets"></a>`ws` | [WebSockets Channel Binding](https://github.com/asyncapi/bindings/blob/master/websockets/README.md#channel) | Protocol-specific information for a WebSockets channel.
<a name="channelBindingsObjectKafka"></a>`kafka` | [Kafka Channel Binding](https://github.com/asyncapi/bindings/blob/master/kafka/README.md#channel) | Protocol-specific information for a Kafka channel.
<a name="channelBindingsObjectAnypointMQ"></a>`anypointmq` | [Anypoint MQ Channel Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq/README.md#channel) | Protocol-specific information for an Anypoint MQ channel.
<a name="channelBindingsObjectAMQP"></a>`amqp` | [AMQP Channel Binding](https://github.com/asyncapi/bindings/blob/master/amqp/README.md#channel) | Protocol-specific information for an AMQP 0-9-1 channel.
<a name="channelBindingsObjectAMQP1"></a>`amqp1` | [AMQP 1.0 Channel Binding](https://github.com/asyncapi/bindings/blob/master/amqp1/README.md#channel) | Protocol-specific information for an AMQP 1.0 channel.
<a name="channelBindingsObjectMQTT"></a>`mqtt` | [MQTT Channel Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#channel) | Protocol-specific information for an MQTT channel.
Expand Down Expand Up @@ -953,6 +990,7 @@ Field Name | Type | Description
<a name="operationBindingsObjectHTTP"></a>`http` | [HTTP Operation Binding](https://github.com/asyncapi/bindings/blob/master/http/README.md#operation) | Protocol-specific information for an HTTP operation.
<a name="operationBindingsObjectWebSockets"></a>`ws` | [WebSockets Operation Binding](https://github.com/asyncapi/bindings/blob/master/websockets/README.md#operation) | Protocol-specific information for a WebSockets operation.
<a name="operationBindingsObjectKafka"></a>`kafka` | [Kafka Operation Binding](https://github.com/asyncapi/bindings/blob/master/kafka/README.md#operation) | Protocol-specific information for a Kafka operation.
<a name="operationBindingsObjectAnypointMQ"></a>`anypointmq` | [Anypoint MQ Operation Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq/README.md#operation) | Protocol-specific information for an Anypoint MQ operation.
<a name="operationBindingsObjectAMQP"></a>`amqp` | [AMQP Operation Binding](https://github.com/asyncapi/bindings/blob/master/amqp/README.md#operation) | Protocol-specific information for an AMQP 0-9-1 operation.
<a name="operationBindingsObjectAMQP1"></a>`amqp1` | [AMQP 1.0 Operation Binding](https://github.com/asyncapi/bindings/blob/master/amqp1/README.md#operation) | Protocol-specific information for an AMQP 1.0 operation.
<a name="operationBindingsObjectMQTT"></a>`mqtt` | [MQTT Operation Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#operation) | Protocol-specific information for an MQTT operation.
Expand Down Expand Up @@ -981,6 +1019,7 @@ Field Name | Type | Description
<a name="messageBindingsObjectHTTP"></a>`http` | [HTTP Message Binding](https://github.com/asyncapi/bindings/blob/master/http/README.md#message) | Protocol-specific information for an HTTP message, i.e., a request or a response.
<a name="messageBindingsObjectWebSockets"></a>`ws` | [WebSockets Message Binding](https://github.com/asyncapi/bindings/blob/master/websockets/README.md#message) | Protocol-specific information for a WebSockets message.
<a name="messageBindingsObjectKafka"></a>`kafka` | [Kafka Message Binding](https://github.com/asyncapi/bindings/blob/master/kafka/README.md#message) | Protocol-specific information for a Kafka message.
<a name="messageBindingsObjectAnypointMQ"></a>`anypointmq` | [Anypoint MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq/README.md#message) | Protocol-specific information for an Anypoint MQ message.
<a name="messageBindingsObjectAMQP"></a>`amqp` | [AMQP Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp/README.md#message) | Protocol-specific information for an AMQP 0-9-1 message.
<a name="messageBindingsObjectAMQP1"></a>`amqp1` | [AMQP 1.0 Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp1/README.md#message) | Protocol-specific information for an AMQP 1.0 message.
<a name="messageBindingsObjectMQTT"></a>`mqtt` | [MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#message) | Protocol-specific information for an MQTT message.
Expand Down Expand Up @@ -1033,7 +1072,7 @@ The following table contains a set of values that every implementation MUST supp

Name | Allowed values | Notes
---|:---:|---
[AsyncAPI 2.1.0 Schema Object](#schemaObject) | `application/vnd.aai.asyncapi;version=2.1.0`, `application/vnd.aai.asyncapi+json;version=2.1.0`, `application/vnd.aai.asyncapi+yaml;version=2.1.0` | This is the default when a `schemaFormat` is not provided.
[AsyncAPI 2.2.0 Schema Object](#schemaObject) | `application/vnd.aai.asyncapi;version=2.2.0`, `application/vnd.aai.asyncapi+json;version=2.2.0`, `application/vnd.aai.asyncapi+yaml;version=2.2.0` | This is the default when a `schemaFormat` is not provided.
[JSON Schema Draft 07](https://json-schema.org/specification-links.html#draft-7) | `application/schema+json;version=draft-07`, `application/schema+yaml;version=draft-07` |

The following table contains a set of values that every implementation is RECOMMENDED to support.
Expand Down