From cf409436a1ca66f208334ffae964aad55d3fb008 Mon Sep 17 00:00:00 2001 From: fmvilas Date: Thu, 1 Aug 2019 15:57:08 +0200 Subject: [PATCH 1/7] Rename protocolInfo as bindings and add HTTP binding --- versions/next/asyncapi.md | 156 +++++++++++++++++++++++++++------ versions/next/bindings/http.md | 104 ++++++++++++++++++++++ 2 files changed, 233 insertions(+), 27 deletions(-) create mode 100644 versions/next/bindings/http.md diff --git a/versions/next/asyncapi.md b/versions/next/asyncapi.md index b9b3eb9a..4af52d9a 100644 --- a/versions/next/asyncapi.md +++ b/versions/next/asyncapi.md @@ -61,8 +61,11 @@ Means that the [application](#definitionsApplication) is a [consumer](#definitio - [Schema Object](#schemaObject) - [XML Object](#xmlObject) - [Security Scheme Object](#securitySchemeObject) + - [Parameters Object](#parametersObject) - [Parameter Object](#parameterObject) - - [Protocol Info Object](#protocolInfoObject) + - [Channel Bindings Object](#channelBindingsObject) + - [Operation Bindings Object](#operationBindingsObject) + - [Message Bindings Object](#messageBindingsObject) - [Correlation ID Object](#correlationIdObject) - [Specification Extensions](#specificationExtensions) @@ -484,9 +487,7 @@ Channels are also known as "topics", "routing keys", "event types" or "paths". Field Pattern | Type | Description ---|:---:|--- -{channel} | [Channel Item Object](#channelItemObject) | A relative path to an individual channel. The field name MUST be in the form of a [RFC 6570 URI template](https://tools.ietf.org/html/rfc6570). Query parameters and fragments SHALL NOT be used, instead use [protocolInfo](#protocolInfoObject) to define them. - -This object can be extended with [Specification Extensions](#specificationExtensions). +{channel} | [Channel Item Object](#channelItemObject) | A relative path to an individual channel. The field name MUST be in the form of a [RFC 6570 URI template](https://tools.ietf.org/html/rfc6570). Query parameters and fragments SHALL NOT be used, instead use [bindings](#channelBindingsObject) to define them. ##### Channels Object Example @@ -522,7 +523,7 @@ Field Name | Type | Description subscribe | [Operation Object](#operationObject) | A definition of the SUBSCRIBE operation. publish | [Operation Object](#operationObject) | A definition of the PUBLISH operation. parameters | [[Parameter Object](#parameterObject) | [Reference Object](#referenceObject)] | A list 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)). -protocolInfo | Map[`string`, [Protocol Info Object](#protocolInfoObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel. +bindings | [Channel Bindings Object](#channelBindingsObject) | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel. This object can be extended with [Specification Extensions](#specificationExtensions). @@ -617,7 +618,7 @@ Field Name | Type | Description description | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation. tags | [[Tag Object](#tagObject)] | A list of tags for API documentation control. Tags can be used for logical grouping of operations. externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation. -protocolInfo | Map[`string`, [Protocol Info Object](#protocolInfoObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation. +bindings | Map[`string`, [Operation Bindings Object](#operationBindingsObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation. traits | [[Operation Trait Object](#operationTraitObject)] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here. message | [Message Object](#messageObject) | A definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.** @@ -712,7 +713,7 @@ Field Name | Type | Description description | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation. tags | [Tags Object](#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations. externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation. -protocolInfo | Map[`string`, [Protocol Info Object](#protocolInfoObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation. +bindings | [Operation Bindings Object](#operationBindingsObject) | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation. This object can be extended with [Specification Extensions](#specificationExtensions). @@ -720,7 +721,7 @@ This object can be extended with [Specification Extensions](#specificationExtens ```json { - "protocolInfo": { + "bindings": { "amqp-0-9-1": { "noAck": true } @@ -729,7 +730,7 @@ This object can be extended with [Specification Extensions](#specificationExtens ``` ```yaml -protocolInfo: +bindings: amqp-0-9-1: noAck: true ``` @@ -787,21 +788,31 @@ user/{userId}/signup: -#### Protocol Info Object +#### Channel Bindings Object -Free-form key-value object describing protocol-specific definitions for channels, operations, and messages. +Map describing protocol-specific definitions for channels. -##### Patterned Fields +##### Fixed Fields -Field Pattern | Type | Description +Field Name | Type | Description ---|:---:|--- -{protocol} | `Map` | Protocol-specific information. This map is free-form and MUST not be validated by parsers. - -##### Protocol Info Object Example +`http` | [HTTP Channel Binding](./bindings/http.md#channel) | Protocol-specific information for an HTTP channel. +`ws` | [WebSockets Channel Binding](./bindings/ws.md#channel) | Protocol-specific information for a WebSockets channel. +`kafka` | [Kafka Channel Binding](./bindings/kafka.md#channel) | Protocol-specific information for a Kafka channel. +`amqp` | [AMQP Channel Binding](./bindings/amqp.md#channel) | Protocol-specific information for an AMQP 0-9-1 channel. +`amqp-1.0` | [AMQP 1.0 Channel Binding](./bindings/amqp-1.0.md#channel) | Protocol-specific information for an AMQP 1.0 channel. +`mqtt` | [MQTT Channel Binding](./bindings/mqtt.md#channel) | Protocol-specific information for an MQTT channel. +`nats` | [NATS Channel Binding](./bindings/nats.md#channel) | Protocol-specific information for a NATS channel. +`jms` | [JMS Channel Binding](./bindings/jms.md#channel) | Protocol-specific information for a JMS channel. +`sns` | [SNS Channel Binding](./bindings/sns.md#channel) | Protocol-specific information for an SNS channel. +`sqs` | [SQS Channel Binding](./bindings/sqs.md#channel) | Protocol-specific information for an SQS channel. +`stomp` | [STOMP Channel Binding](./bindings/stomp.md#channel) | Protocol-specific information for a STOMP channel. + +##### Channel Bindings Object Example ```json { - "amqp-0-9-1": { + "amqp": { "channelIsQueue": true, "queue": { "randomName": true, @@ -812,7 +823,7 @@ Field Pattern | Type | Description ``` ```yaml -amqp-0-9-1: +amqp: channelIsQueue: true queue: randomName: true @@ -822,6 +833,91 @@ amqp-0-9-1: +#### Operation Bindings Object + +Map describing protocol-specific definitions for operations. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`http` | [HTTP Operation Binding](./bindings/http.md#operation) | Protocol-specific information for an HTTP operation. +`ws` | [WebSockets Operation Binding](./bindings/ws.md#operation) | Protocol-specific information for a WebSockets operation. +`kafka` | [Kafka Operation Binding](./bindings/kafka.md#operation) | Protocol-specific information for a Kafka operation. +`amqp` | [AMQP Operation Binding](./bindings/amqp.md#operation) | Protocol-specific information for an AMQP 0-9-1 operation. +`amqp-1.0` | [AMQP 1.0 Operation Binding](./bindings/amqp-1.0.md#operation) | Protocol-specific information for an AMQP 1.0 operation. +`mqtt` | [MQTT Operation Binding](./bindings/mqtt.md#operation) | Protocol-specific information for an MQTT operation. +`nats` | [NATS Operation Binding](./bindings/nats.md#operation) | Protocol-specific information for a NATS operation. +`jms` | [JMS Operation Binding](./bindings/jms.md#operation) | Protocol-specific information for a JMS operation. +`sns` | [SNS Operation Binding](./bindings/sns.md#operation) | Protocol-specific information for an SNS operation. +`sqs` | [SQS Operation Binding](./bindings/sqs.md#operation) | Protocol-specific information for an SQS operation. +`stomp` | [STOMP Operation Binding](./bindings/stomp.md#operation) | Protocol-specific information for a STOMP operation. + +##### Operation Bindings Object Example + +```json +{ + "kafka": { + "partition": { + "type": "integer", + "minimum": 0, + "maximum": 3 + } + } +} +``` + +```yaml +kafka: + partition: + type: integer + minimum: 0 + maximum: 3 +``` + + + + + + +#### Message Bindings Object + +Map describing protocol-specific definitions for messages. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`http` | [HTTP Message Binding](./bindings/http.md#message) | Protocol-specific information for an HTTP message, i.e., a request or a response. +`ws` | [WebSockets Message Binding](./bindings/ws.md#message) | Protocol-specific information for a WebSockets message. +`kafka` | [Kafka Message Binding](./bindings/kafka.md#message) | Protocol-specific information for a Kafka message. +`amqp` | [AMQP Message Binding](./bindings/amqp.md#message) | Protocol-specific information for an AMQP 0-9-1 message. +`amqp-1.0` | [AMQP 1.0 Message Binding](./bindings/amqp-1.0.md#message) | Protocol-specific information for an AMQP 1.0 message. +`mqtt` | [MQTT Message Binding](./bindings/mqtt.md#message) | Protocol-specific information for an MQTT message. +`nats` | [NATS Message Binding](./bindings/nats.md#message) | Protocol-specific information for a NATS message. +`jms` | [JMS Message Binding](./bindings/jms.md#message) | Protocol-specific information for a JMS message. +`sns` | [SNS Message Binding](./bindings/sns.md#message) | Protocol-specific information for an SNS message. +`sqs` | [SQS Message Binding](./bindings/sqs.md#message) | Protocol-specific information for an SQS message. +`stomp` | [STOMP Message Binding](./bindings/stomp.md#message) | Protocol-specific information for a STOMP message. + +##### Message Bindings Object Example + +```json +{ + "kafka": { + "key": "myKey" + } +} +``` + +```yaml +kafka: + key: myKey +``` + + + + @@ -846,7 +942,7 @@ Field Name | Type | Description description | `string` | A verbose explanation of the message. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation. tags | [Tags Object](#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of messages. externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this message. -protocolInfo | Map[`string`, [Protocol Info Object](#protocolInfoObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message. +bindings | [Message Bindings Object](#messageBindingsObject) | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message. examples | [Map[`string`, `any`]] | An array with examples of valid message objects. traits | [[Message Trait Object](#messageTraitObject)] | A list of traits to apply to the message object. Traits MUST be merged into the message object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here. The resulting object MUST be a valid [Message Object](#messageObject). @@ -894,10 +990,12 @@ This object can be extended with [Specification Extensions](#specificationExtens "description": "Default Correlation ID", "location": "$message.header#/correlationId" }, - "amqp-0-9-1": { - "properties": { - "delivery_mode": 2 - } + "bindings": { + "amqp-0-9-1": { + "properties": { + "delivery_mode": 2 + } + }, }, "traits": [ { "$ref": "#/components/messageTraits/commonHeaders" } @@ -934,9 +1032,10 @@ payload: correlationId: description: Default Correlation ID location: $message.header#/correlationId -amqp-0-9-1: - properties: - delivery_mode: 2 +bindings: + amqp-0-9-1: + properties: + delivery_mode: 2 traits: - $ref: "#/components/messageTraits/commonHeaders" ``` @@ -1001,7 +1100,7 @@ Field Name | Type | Description description | `string` | A verbose explanation of the message. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation. tags | [Tags Object](#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of messages. externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this message. -protocolInfo | Map[`string`, [Protocol Info Object](#protocolInfoObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message. +bindings | Map[`string`, [Message Bindings Object](#messageBindingsObject)] | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message. examples | [Map[`string`, `any`]] | An array with examples of valid message objects. This object can be extended with [Specification Extensions](#specificationExtensions). @@ -1128,6 +1227,9 @@ Field Name | Type | Description correlationIds | Map[`string`, [Correlation ID Object](#correlationIdObject)] | An object to hold reusable [Correlation ID Objects](#correlationIdObject). operationTraits | Map[`string`, [Operation Trait Object](#operationTraitObject)] | An object to hold reusable [Operation Trait Objects](#operationTraitObject). messageTraits | Map[`string`, [Message Trait Object](#messageTraitObject)] | An object to hold reusable [Message Trait Objects](#messageTraitObject). + channelBindings | Map[`string`, [Channel Bindings Object](#channelBindingsObject)] | An object to hold reusable [Channel Bindings Objects](#channelBindingsObject). + operationBindings | Map[`string`, [Operation Bindings Object](#operationBindingsObject)] | An object to hold reusable [Operation Bindings Objects](#operationBindingsObject). + messageBindings | Map[`string`, [Message Bindings Object](#messageBindingsObject)] | An object to hold reusable [Message Bindings Objects](#messageBindingsObject). This object can be extended with [Specification Extensions](#specificationExtensions). diff --git a/versions/next/bindings/http.md b/versions/next/bindings/http.md new file mode 100644 index 00000000..b3f14d2c --- /dev/null +++ b/versions/next/bindings/http.md @@ -0,0 +1,104 @@ +# HTTP Bindings + +This document defines how to describe HTTP-specific information on AsyncAPI. + + + +## Version + +Current version is `0.1.0`. + + + + +## Channel Binding Object + +This object MUST NOT contain any properties. Its name is reserved for future use. + + + + +## Operation Binding Object + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`type` | String | **Required**. Type of operation. Its value MUST be either `request` or `response`. +`method` | String | When `type` is `request`, this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`, `CONNECT`, and `TRACE`. Defaults to `GET`. +`httpVersion` | String | The HTTP protocol version. It MUST be either `1.1` (for HTTP/1.1) or `2` (for HTTP/2). +`https` | Boolean | Whether the connection should use HTTPS or not. Defaults to `false`. +`query` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definitions for each query parameter. This schema MUST be of type `object`. +`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. + +This object MUST contain only the properties defined above. + +##### Example + +```yaml +channels: + /employees: + subscribe: + bindings: + http: + type: request + method: GET + httpVersion: '1.1' + https: true + query: + type: object + required: + - companyId + properties: + companyId: + type: number + minimum: 1 + description: The Id of the company. + additionalProperties: false + meta: + version: '0.1.0' +``` + + + + +## Message Binding Object + +This object contains information about the message representation in HTTP. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`headers` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definitions for HTTP-specific headers. This schema MUST be of type `object`. This object MUST NOT contain application-specific headers, for that purpose, please use [Message headers](../asyncapi.md#messageObjectHeaders). +`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. + +This object MUST contain only the properties defined above. + + +```yaml +channels: + test: + publish: + message: + bindings: + http: + headers: + type: object + properties: + Content-Type: + type: string + enum: ['application/json'] + meta: + version: '0.1.0' +``` + +## Meta Object + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`version` | String | **Required**. The version of this binding object. See [version](#version). + +This object MUST contain only the properties defined above. From 3792d2c32f1215ae520d4a5446b6fbe125dea8cb Mon Sep 17 00:00:00 2001 From: fmvilas Date: Fri, 2 Aug 2019 12:08:46 +0200 Subject: [PATCH 2/7] Add Kafka bindings --- versions/next/bindings/kafka.md | 92 +++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 versions/next/bindings/kafka.md diff --git a/versions/next/bindings/kafka.md b/versions/next/bindings/kafka.md new file mode 100644 index 00000000..8ef91b9d --- /dev/null +++ b/versions/next/bindings/kafka.md @@ -0,0 +1,92 @@ +# Kafka Bindings + +This document defines how to describe Kafka-specific information on AsyncAPI. + + + +## Version + +Current version is `0.1.0`. + + + + +## Channel Binding Object + +This object MUST NOT contain any properties. Its name is reserved for future use. + + + + +## Operation Binding Object + +This object contains information about the operation representation in Kafka. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`groupId` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definition for the Kafka `group.id` property. +`clientId` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definition for the Kafka `client.id` property. +`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. + +This object MUST contain only the properties defined above. + +##### Example + +```yaml +channels: + user-signedup: + publish: + bindings: + kafka: + groupId: + type: string + enum: ['myGroupId'] + clientId: + type: string + enum: ['myClientId'] + meta: + version: '0.1.0' +``` + + + + +## Message Binding Object + +This object contains information about the message representation in Kafka. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`key` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definition for the Kafka `key` property. +`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. + +This object MUST contain only the properties defined above. + + +```yaml +channels: + test: + publish: + message: + bindings: + kafka: + key: + type: string + enum: ['myKey'] + meta: + version: '0.1.0' +``` + +## Meta Object + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`version` | String | **Required**. The version of this binding object. See [version](#version). + +This object MUST contain only the properties defined above. From 66e58a0376ee19032b6e2cbbf22fd2f93e7c6d5b Mon Sep 17 00:00:00 2001 From: fmvilas Date: Fri, 2 Aug 2019 15:25:43 +0200 Subject: [PATCH 3/7] Add AMQP WIP --- versions/next/bindings/amqp.md | 95 ++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 versions/next/bindings/amqp.md diff --git a/versions/next/bindings/amqp.md b/versions/next/bindings/amqp.md new file mode 100644 index 00000000..b4637aaa --- /dev/null +++ b/versions/next/bindings/amqp.md @@ -0,0 +1,95 @@ +# [WIP] AMQP Bindings + +This document defines how to describe AMQP-specific information on AsyncAPI. + + + +## Version + +Current version is `0.1.0`. + + + + +## Channel Binding Object + +This object contains information about the channel representation in AMQP. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +WIP: Check example below + +This object MUST contain only the properties defined above. + +##### Example + +```yaml +channels: + user-signedup: + bindings: + amqp: + type: routingKey # queue or routingKey, defaults to routingKey + queue: + name: my-queue-name # Max 255 + durable: true + exclusive: true + autoDelete: false + exchange: + name: myExchange # Max 255 + type: topic # topic, direct, fanout, default or headers + meta: + version: '0.1.0' +``` + + + + +## Operation Binding Object + +This object contains information about the operation representation in AMQP. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. + +This object MUST contain only the properties defined above. + +##### Example + +```yaml +WIP +``` + + + + +## Message Binding Object + +This object contains information about the message representation in AMQP. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. + +This object MUST contain only the properties defined above. + + +```yaml +WIP +``` + +## Meta Object + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`version` | String | **Required**. The version of this binding object. See [version](#version). + +This object MUST contain only the properties defined above. From 8ce555128d0f5905cd5b0abafebf5579133af448 Mon Sep 17 00:00:00 2001 From: fmvilas Date: Sat, 24 Aug 2019 19:29:55 +0200 Subject: [PATCH 4/7] Add server bindings and link definitions to external repo --- examples/next/gitter-streaming.yml | 20 +++- examples/next/rpc-client.yml | 32 +++--- examples/next/rpc-server.yml | 26 +++-- examples/next/streetlights.yml | 4 +- versions/next/asyncapi.md | 164 ++++++++++++----------------- versions/next/bindings/amqp.md | 95 ----------------- versions/next/bindings/http.md | 104 ------------------ versions/next/bindings/kafka.md | 92 ---------------- versions/next/schema.json | 80 +++++++++----- 9 files changed, 166 insertions(+), 451 deletions(-) delete mode 100644 versions/next/bindings/amqp.md delete mode 100644 versions/next/bindings/http.md delete mode 100644 versions/next/bindings/kafka.md diff --git a/examples/next/gitter-streaming.yml b/examples/next/gitter-streaming.yml index 968c5250..a835c1cf 100644 --- a/examples/next/gitter-streaming.yml +++ b/examples/next/gitter-streaming.yml @@ -29,12 +29,9 @@ channels: - chatMessages - events subscribe: - protocolInfo: + bindings: http: - response: - headers: - 'Transfer-Encoding': 'chunked' - Trailer: '\r\n' + type: response message: oneOf: - $ref: '#/components/messages/chatMessage' @@ -145,6 +142,9 @@ components: gv: type: string description: Stands for "Gravatar version" and is used for cache busting. + bindings: + http: + $ref: '#/components/messageBindings/streamingHeaders' heartbeat: schemaFormat: 'application/schema+yaml;version=draft-07' @@ -152,3 +152,13 @@ components: payload: type: string enum: ["\r\n"] + bindings: + http: + $ref: '#/components/messageBindings/streamingHeaders' + + messageBindings: + streamingHeaders: + http: + headers: + 'Transfer-Encoding': 'chunked' + Trailer: '\r\n' diff --git a/examples/next/rpc-client.yml b/examples/next/rpc-client.yml index 7d36cc46..30be9e4f 100644 --- a/examples/next/rpc-client.yml +++ b/examples/next/rpc-client.yml @@ -19,17 +19,16 @@ channels: schema: type: string pattern: '^amq\\.gen\\-.+$' - protocolInfo: - amqp-0-9-1: - channelIsQueue: true + bindings: + amqp: + is: queue queue: - randomName: true exclusive: true subscribe: operationId: receiveSumResult - protocolInfo: - amqp-0-9-1: - noAck: true + bindings: + amqp: + ack: false message: correlationId: location: $message.header#/correlation_id @@ -42,22 +41,21 @@ channels: - 7 rpc_queue: - protocolInfo: - amqp-0-9-1: - channelIsQueue: true + bindings: + amqp: + is: queue queue: durable: false publish: operationId: requestSum - protocolInfo: - amqp-0-9-1: + bindings: + amqp: ack: true message: - protocolInfo: - amqp-0-9-1: - properties: - reply_to: - type: string + bindings: + amqp: + replyTo: + type: string correlationId: location: $message.header#/correlation_id payload: diff --git a/examples/next/rpc-server.yml b/examples/next/rpc-server.yml index 4c582f3d..2e12ff40 100644 --- a/examples/next/rpc-server.yml +++ b/examples/next/rpc-server.yml @@ -19,16 +19,15 @@ channels: schema: type: string pattern: '^amq\\.gen\\-.+$' - protocolInfo: - amqp-0-9-1: - channelIsQueue: true + bindings: + amqp: + is: queue queue: - randomName: true exclusive: true publish: operationId: sendSumResult - protocolInfo: - amqp-0-9-1: + bindings: + amqp: ack: true message: correlationId: @@ -42,19 +41,18 @@ channels: - 7 rpc_queue: - protocolInfo: - amqp-0-9-1: - channelIsQueue: true + bindings: + amqp: + is: queue queue: durable: false subscribe: operationId: sum message: - protocolInfo: - amqp-0-9-1: - properties: - reply_to: - type: string + bindings: + amqp: + replyTo: + type: string correlationId: location: $message.header#/correlation_id payload: diff --git a/examples/next/streetlights.yml b/examples/next/streetlights.yml index db371738..523fdcef 100644 --- a/examples/next/streetlights.yml +++ b/examples/next/streetlights.yml @@ -205,6 +205,6 @@ components: operationTraits: kafka: - protocolInfo: + bindings: kafka: - applicationId: my-app-id + clientId: my-app-id diff --git a/versions/next/asyncapi.md b/versions/next/asyncapi.md index e58be2c3..ea29ad49 100644 --- a/versions/next/asyncapi.md +++ b/versions/next/asyncapi.md @@ -345,6 +345,7 @@ Field Name | Type | Description description | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation. 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. security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation. +bindings | [Server Bindings Object](#serverBindingsObject) | A free-form map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server. This object MAY be extended with [Specification Extensions](#specificationExtensions). @@ -862,92 +863,74 @@ user/{userId}/signup: -#### Channel Bindings Object +#### Server Bindings Object -Map describing protocol-specific definitions for channels. +Map describing protocol-specific definitions for a server. ##### Fixed Fields Field Name | Type | Description ---|:---:|--- -`http` | [HTTP Channel Binding](./bindings/http.md#channel) | Protocol-specific information for an HTTP channel. -`ws` | [WebSockets Channel Binding](./bindings/ws.md#channel) | Protocol-specific information for a WebSockets channel. -`kafka` | [Kafka Channel Binding](./bindings/kafka.md#channel) | Protocol-specific information for a Kafka channel. -`amqp` | [AMQP Channel Binding](./bindings/amqp.md#channel) | Protocol-specific information for an AMQP 0-9-1 channel. -`amqp-1.0` | [AMQP 1.0 Channel Binding](./bindings/amqp-1.0.md#channel) | Protocol-specific information for an AMQP 1.0 channel. -`mqtt` | [MQTT Channel Binding](./bindings/mqtt.md#channel) | Protocol-specific information for an MQTT channel. -`nats` | [NATS Channel Binding](./bindings/nats.md#channel) | Protocol-specific information for a NATS channel. -`jms` | [JMS Channel Binding](./bindings/jms.md#channel) | Protocol-specific information for a JMS channel. -`sns` | [SNS Channel Binding](./bindings/sns.md#channel) | Protocol-specific information for an SNS channel. -`sqs` | [SQS Channel Binding](./bindings/sqs.md#channel) | Protocol-specific information for an SQS channel. -`stomp` | [STOMP Channel Binding](./bindings/stomp.md#channel) | Protocol-specific information for a STOMP channel. - -##### Channel Bindings Object Example +`http` | [HTTP Server Binding](https://github.com/asyncapi/bindings/blob/master/http#server) | Protocol-specific information for an HTTP server. +`ws` | [WebSockets Server Binding](https://github.com/asyncapi/bindings/blob/master/ws#server) | Protocol-specific information for a WebSockets server. +`kafka` | [Kafka Server Binding](https://github.com/asyncapi/bindings/blob/master/kafka#server) | Protocol-specific information for a Kafka server. +`amqp` | [AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server) | Protocol-specific information for an AMQP 0-9-1 server. +`amqp1` | [AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server) | Protocol-specific information for an AMQP 1.0 server. +`mqtt` | [MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server) | Protocol-specific information for an MQTT server. +`nats` | [NATS Server Binding](https://github.com/asyncapi/bindings/blob/master/nats#server) | Protocol-specific information for a NATS server. +`jms` | [JMS Server Binding](https://github.com/asyncapi/bindings/blob/master/jms#server) | Protocol-specific information for a JMS server. +`sns` | [SNS Server Binding](https://github.com/asyncapi/bindings/blob/master/sns#server) | Protocol-specific information for an SNS server. +`sqs` | [SQS Server Binding](https://github.com/asyncapi/bindings/blob/master/sqs#server) | Protocol-specific information for an SQS server. +`stomp` | [STOMP Server Binding](https://github.com/asyncapi/bindings/blob/master/stomp#server) | Protocol-specific information for a STOMP server. +`redis` | [Redis Server Binding](https://github.com/asyncapi/bindings/blob/master/redis#server) | Protocol-specific information for a Redis server. -```json -{ - "amqp": { - "channelIsQueue": true, - "queue": { - "randomName": true, - "exclusive": true - } - } -} -``` -```yaml -amqp: - channelIsQueue: true - queue: - randomName: true - exclusive: true -``` + + +#### Channel Bindings Object + +Map describing protocol-specific definitions for a channel. + +##### Fixed Fields + +Field Name | Type | Description +---|:---:|--- +`http` | [HTTP Channel Binding](https://github.com/asyncapi/bindings/blob/master/http/README.md#channel) | Protocol-specific information for an HTTP channel. +`ws` | [WebSockets Channel Binding](https://github.com/asyncapi/bindings/blob/master/ws/README.md#channel) | Protocol-specific information for a WebSockets channel. +`kafka` | [Kafka Channel Binding](https://github.com/asyncapi/bindings/blob/master/kafka/README.md#channel) | Protocol-specific information for a Kafka channel. +`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. +`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. +`mqtt` | [MQTT Channel Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#channel) | Protocol-specific information for an MQTT channel. +`nats` | [NATS Channel Binding](https://github.com/asyncapi/bindings/blob/master/nats/README.md#channel) | Protocol-specific information for a NATS channel. +`jms` | [JMS Channel Binding](https://github.com/asyncapi/bindings/blob/master/jms/README.md#channel) | Protocol-specific information for a JMS channel. +`sns` | [SNS Channel Binding](https://github.com/asyncapi/bindings/blob/master/sns/README.md#channel) | Protocol-specific information for an SNS channel. +`sqs` | [SQS Channel Binding](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#channel) | Protocol-specific information for an SQS channel. +`stomp` | [STOMP Channel Binding](https://github.com/asyncapi/bindings/blob/master/stomp/README.md#channel) | Protocol-specific information for a STOMP channel. +`redis` | [Redis Channel Binding](https://github.com/asyncapi/bindings/blob/master/redis#channel) | Protocol-specific information for a Redis channel. #### Operation Bindings Object -Map describing protocol-specific definitions for operations. +Map describing protocol-specific definitions for an operation. ##### Fixed Fields Field Name | Type | Description ---|:---:|--- -`http` | [HTTP Operation Binding](./bindings/http.md#operation) | Protocol-specific information for an HTTP operation. -`ws` | [WebSockets Operation Binding](./bindings/ws.md#operation) | Protocol-specific information for a WebSockets operation. -`kafka` | [Kafka Operation Binding](./bindings/kafka.md#operation) | Protocol-specific information for a Kafka operation. -`amqp` | [AMQP Operation Binding](./bindings/amqp.md#operation) | Protocol-specific information for an AMQP 0-9-1 operation. -`amqp-1.0` | [AMQP 1.0 Operation Binding](./bindings/amqp-1.0.md#operation) | Protocol-specific information for an AMQP 1.0 operation. -`mqtt` | [MQTT Operation Binding](./bindings/mqtt.md#operation) | Protocol-specific information for an MQTT operation. -`nats` | [NATS Operation Binding](./bindings/nats.md#operation) | Protocol-specific information for a NATS operation. -`jms` | [JMS Operation Binding](./bindings/jms.md#operation) | Protocol-specific information for a JMS operation. -`sns` | [SNS Operation Binding](./bindings/sns.md#operation) | Protocol-specific information for an SNS operation. -`sqs` | [SQS Operation Binding](./bindings/sqs.md#operation) | Protocol-specific information for an SQS operation. -`stomp` | [STOMP Operation Binding](./bindings/stomp.md#operation) | Protocol-specific information for a STOMP operation. - -##### Operation Bindings Object Example - -```json -{ - "kafka": { - "partition": { - "type": "integer", - "minimum": 0, - "maximum": 3 - } - } -} -``` - -```yaml -kafka: - partition: - type: integer - minimum: 0 - maximum: 3 -``` +`http` | [HTTP Operation Binding](https://github.com/asyncapi/bindings/blob/master/http/README.md#operation) | Protocol-specific information for an HTTP operation. +`ws` | [WebSockets Operation Binding](https://github.com/asyncapi/bindings/blob/master/ws/README.md#operation) | Protocol-specific information for a WebSockets operation. +`kafka` | [Kafka Operation Binding](https://github.com/asyncapi/bindings/blob/master/kafka/README.md#operation) | Protocol-specific information for a Kafka operation. +`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. +`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. +`mqtt` | [MQTT Operation Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#operation) | Protocol-specific information for an MQTT operation. +`nats` | [NATS Operation Binding](https://github.com/asyncapi/bindings/blob/master/nats/README.md#operation) | Protocol-specific information for a NATS operation. +`jms` | [JMS Operation Binding](https://github.com/asyncapi/bindings/blob/master/jms/README.md#operation) | Protocol-specific information for a JMS operation. +`sns` | [SNS Operation Binding](https://github.com/asyncapi/bindings/blob/master/sns/README.md#operation) | Protocol-specific information for an SNS operation. +`sqs` | [SQS Operation Binding](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#operation) | Protocol-specific information for an SQS operation. +`stomp` | [STOMP Operation Binding](https://github.com/asyncapi/bindings/blob/master/stomp/README.md#operation) | Protocol-specific information for a STOMP operation. +`redis` | [Redis Operation Binding](https://github.com/asyncapi/bindings/blob/master/redis#operation) | Protocol-specific information for a Redis operation. @@ -956,38 +939,24 @@ kafka: #### Message Bindings Object -Map describing protocol-specific definitions for messages. +Map describing protocol-specific definitions for a message. ##### Fixed Fields Field Name | Type | Description ---|:---:|--- -`http` | [HTTP Message Binding](./bindings/http.md#message) | Protocol-specific information for an HTTP message, i.e., a request or a response. -`ws` | [WebSockets Message Binding](./bindings/ws.md#message) | Protocol-specific information for a WebSockets message. -`kafka` | [Kafka Message Binding](./bindings/kafka.md#message) | Protocol-specific information for a Kafka message. -`amqp` | [AMQP Message Binding](./bindings/amqp.md#message) | Protocol-specific information for an AMQP 0-9-1 message. -`amqp-1.0` | [AMQP 1.0 Message Binding](./bindings/amqp-1.0.md#message) | Protocol-specific information for an AMQP 1.0 message. -`mqtt` | [MQTT Message Binding](./bindings/mqtt.md#message) | Protocol-specific information for an MQTT message. -`nats` | [NATS Message Binding](./bindings/nats.md#message) | Protocol-specific information for a NATS message. -`jms` | [JMS Message Binding](./bindings/jms.md#message) | Protocol-specific information for a JMS message. -`sns` | [SNS Message Binding](./bindings/sns.md#message) | Protocol-specific information for an SNS message. -`sqs` | [SQS Message Binding](./bindings/sqs.md#message) | Protocol-specific information for an SQS message. -`stomp` | [STOMP Message Binding](./bindings/stomp.md#message) | Protocol-specific information for a STOMP message. - -##### Message Bindings Object Example - -```json -{ - "kafka": { - "key": "myKey" - } -} -``` - -```yaml -kafka: - key: myKey -``` +`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. +`ws` | [WebSockets Message Binding](https://github.com/asyncapi/bindings/blob/master/ws/README.md#message) | Protocol-specific information for a WebSockets message. +`kafka` | [Kafka Message Binding](https://github.com/asyncapi/bindings/blob/master/kafka/README.md#message) | Protocol-specific information for a Kafka message. +`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. +`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. +`mqtt` | [MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#message) | Protocol-specific information for an MQTT message. +`nats` | [NATS Message Binding](https://github.com/asyncapi/bindings/blob/master/nats/README.md#message) | Protocol-specific information for a NATS message. +`jms` | [JMS Message Binding](https://github.com/asyncapi/bindings/blob/master/jms/README.md#message) | Protocol-specific information for a JMS message. +`sns` | [SNS Message Binding](https://github.com/asyncapi/bindings/blob/master/sns/README.md#message) | Protocol-specific information for an SNS message. +`sqs` | [SQS Message Binding](https://github.com/asyncapi/bindings/blob/master/sqs/README.md#message) | Protocol-specific information for an SQS message. +`stomp` | [STOMP Message Binding](https://github.com/asyncapi/bindings/blob/master/stomp/README.md#message) | Protocol-specific information for a STOMP message. +`redis` | [Redis Message Binding](https://github.com/asyncapi/bindings/blob/master/redis#message) | Protocol-specific information for a Redis message. @@ -1302,9 +1271,10 @@ Field Name | Type | Description correlationIds | Map[`string`, [Correlation ID Object](#correlationIdObject)] | An object to hold reusable [Correlation ID Objects](#correlationIdObject). operationTraits | Map[`string`, [Operation Trait Object](#operationTraitObject)] | An object to hold reusable [Operation Trait Objects](#operationTraitObject). messageTraits | Map[`string`, [Message Trait Object](#messageTraitObject)] | An object to hold reusable [Message Trait Objects](#messageTraitObject). - channelBindings | Map[`string`, [Channel Bindings Object](#channelBindingsObject)] | An object to hold reusable [Channel Bindings Objects](#channelBindingsObject). - operationBindings | Map[`string`, [Operation Bindings Object](#operationBindingsObject)] | An object to hold reusable [Operation Bindings Objects](#operationBindingsObject). - messageBindings | Map[`string`, [Message Bindings Object](#messageBindingsObject)] | An object to hold reusable [Message Bindings Objects](#messageBindingsObject). + serverBindings | Map[`string`, [Server Binding Object](#serverBindingsObject)] | An object to hold reusable [Server Binding Objects](#serverBindingsObject). + channelBindings | Map[`string`, [Channel Binding Object](#channelBindingsObject)] | An object to hold reusable [Channel Binding Objects](#channelBindingsObject). + operationBindings | Map[`string`, [Operation Binding Object](#operationBindingsObject)] | An object to hold reusable [Operation Binding Objects](#operationBindingsObject). + messageBindings | Map[`string`, [Message Binding Object](#messageBindingsObject)] | An object to hold reusable [Message Binding Objects](#messageBindingsObject). This object can be extended with [Specification Extensions](#specificationExtensions). diff --git a/versions/next/bindings/amqp.md b/versions/next/bindings/amqp.md deleted file mode 100644 index b4637aaa..00000000 --- a/versions/next/bindings/amqp.md +++ /dev/null @@ -1,95 +0,0 @@ -# [WIP] AMQP Bindings - -This document defines how to describe AMQP-specific information on AsyncAPI. - - - -## Version - -Current version is `0.1.0`. - - - - -## Channel Binding Object - -This object contains information about the channel representation in AMQP. - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -WIP: Check example below - -This object MUST contain only the properties defined above. - -##### Example - -```yaml -channels: - user-signedup: - bindings: - amqp: - type: routingKey # queue or routingKey, defaults to routingKey - queue: - name: my-queue-name # Max 255 - durable: true - exclusive: true - autoDelete: false - exchange: - name: myExchange # Max 255 - type: topic # topic, direct, fanout, default or headers - meta: - version: '0.1.0' -``` - - - - -## Operation Binding Object - -This object contains information about the operation representation in AMQP. - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. - -This object MUST contain only the properties defined above. - -##### Example - -```yaml -WIP -``` - - - - -## Message Binding Object - -This object contains information about the message representation in AMQP. - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. - -This object MUST contain only the properties defined above. - - -```yaml -WIP -``` - -## Meta Object - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`version` | String | **Required**. The version of this binding object. See [version](#version). - -This object MUST contain only the properties defined above. diff --git a/versions/next/bindings/http.md b/versions/next/bindings/http.md deleted file mode 100644 index b3f14d2c..00000000 --- a/versions/next/bindings/http.md +++ /dev/null @@ -1,104 +0,0 @@ -# HTTP Bindings - -This document defines how to describe HTTP-specific information on AsyncAPI. - - - -## Version - -Current version is `0.1.0`. - - - - -## Channel Binding Object - -This object MUST NOT contain any properties. Its name is reserved for future use. - - - - -## Operation Binding Object - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`type` | String | **Required**. Type of operation. Its value MUST be either `request` or `response`. -`method` | String | When `type` is `request`, this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`, `CONNECT`, and `TRACE`. Defaults to `GET`. -`httpVersion` | String | The HTTP protocol version. It MUST be either `1.1` (for HTTP/1.1) or `2` (for HTTP/2). -`https` | Boolean | Whether the connection should use HTTPS or not. Defaults to `false`. -`query` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definitions for each query parameter. This schema MUST be of type `object`. -`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. - -This object MUST contain only the properties defined above. - -##### Example - -```yaml -channels: - /employees: - subscribe: - bindings: - http: - type: request - method: GET - httpVersion: '1.1' - https: true - query: - type: object - required: - - companyId - properties: - companyId: - type: number - minimum: 1 - description: The Id of the company. - additionalProperties: false - meta: - version: '0.1.0' -``` - - - - -## Message Binding Object - -This object contains information about the message representation in HTTP. - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`headers` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definitions for HTTP-specific headers. This schema MUST be of type `object`. This object MUST NOT contain application-specific headers, for that purpose, please use [Message headers](../asyncapi.md#messageObjectHeaders). -`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. - -This object MUST contain only the properties defined above. - - -```yaml -channels: - test: - publish: - message: - bindings: - http: - headers: - type: object - properties: - Content-Type: - type: string - enum: ['application/json'] - meta: - version: '0.1.0' -``` - -## Meta Object - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`version` | String | **Required**. The version of this binding object. See [version](#version). - -This object MUST contain only the properties defined above. diff --git a/versions/next/bindings/kafka.md b/versions/next/bindings/kafka.md deleted file mode 100644 index 8ef91b9d..00000000 --- a/versions/next/bindings/kafka.md +++ /dev/null @@ -1,92 +0,0 @@ -# Kafka Bindings - -This document defines how to describe Kafka-specific information on AsyncAPI. - - - -## Version - -Current version is `0.1.0`. - - - - -## Channel Binding Object - -This object MUST NOT contain any properties. Its name is reserved for future use. - - - - -## Operation Binding Object - -This object contains information about the operation representation in Kafka. - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`groupId` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definition for the Kafka `group.id` property. -`clientId` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definition for the Kafka `client.id` property. -`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. - -This object MUST contain only the properties defined above. - -##### Example - -```yaml -channels: - user-signedup: - publish: - bindings: - kafka: - groupId: - type: string - enum: ['myGroupId'] - clientId: - type: string - enum: ['myClientId'] - meta: - version: '0.1.0' -``` - - - - -## Message Binding Object - -This object contains information about the message representation in Kafka. - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`key` | [Schema Object](../asyncapi.md#schemaObject) | A [Schema Object](../asyncapi.md#schemaObject) containing the definition for the Kafka `key` property. -`meta` | [Meta Object](#metaObject) | An object containing meta information about this binding object. - -This object MUST contain only the properties defined above. - - -```yaml -channels: - test: - publish: - message: - bindings: - kafka: - key: - type: string - enum: ['myKey'] - meta: - version: '0.1.0' -``` - -## Meta Object - -##### Fixed Fields - -Field Name | Type | Description ----|:---:|--- -`version` | String | **Required**. The version of this binding object. See [version](#version). - -This object MUST contain only the properties defined above. diff --git a/versions/next/schema.json b/versions/next/schema.json index 19a060ea..dfb2bccf 100644 --- a/versions/next/schema.json +++ b/versions/next/schema.json @@ -194,6 +194,9 @@ "items": { "$ref": "#/definitions/SecurityRequirement" } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" } } }, @@ -301,6 +304,30 @@ "additionalProperties": { "$ref": "#/definitions/messageTrait" } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } } } }, @@ -469,11 +496,8 @@ "type": "boolean", "default": false }, - "protocolInfo": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "bindings": { + "$ref": "#/definitions/bindingsObject" } } }, @@ -562,11 +586,8 @@ "operationId": { "type": "string" }, - "protocolInfo": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "bindings": { + "$ref": "#/definitions/bindingsObject" }, "message": { "$ref": "#/definitions/message" @@ -660,11 +681,8 @@ "type": "object" } }, - "protocolInfo": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "bindings": { + "$ref": "#/definitions/bindingsObject" }, "traits": { "type": "array", @@ -704,6 +722,24 @@ } ] }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "kafka": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {} + } + }, "correlationId": { "type": "object", "required": [ @@ -783,11 +819,8 @@ "operationId": { "type": "string" }, - "protocolInfo": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "bindings": { + "$ref": "#/definitions/bindingsObject" } } }, @@ -862,11 +895,8 @@ "type": "object" } }, - "protocolInfo": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "bindings": { + "$ref": "#/definitions/bindingsObject" } } }, From ed11a31323aa7a866976e1e6922005299c7fe627 Mon Sep 17 00:00:00 2001 From: fmvilas Date: Sat, 24 Aug 2019 19:41:07 +0200 Subject: [PATCH 5/7] Add server bindings to index --- versions/next/asyncapi.md | 1 + 1 file changed, 1 insertion(+) diff --git a/versions/next/asyncapi.md b/versions/next/asyncapi.md index ea29ad49..ac68fc0f 100644 --- a/versions/next/asyncapi.md +++ b/versions/next/asyncapi.md @@ -62,6 +62,7 @@ Means that the [application](#definitionsApplication) is a [consumer](#definitio - [Security Scheme Object](#securitySchemeObject) - [Parameters Object](#parametersObject) - [Parameter Object](#parameterObject) + - [Server Bindings Object](#serverBindingsObject) - [Channel Bindings Object](#channelBindingsObject) - [Operation Bindings Object](#operationBindingsObject) - [Message Bindings Object](#messageBindingsObject) From 2dd4552843d8f7bbccd98c5e89aab8582db065b8 Mon Sep 17 00:00:00 2001 From: fmvilas Date: Sat, 24 Aug 2019 19:50:13 +0200 Subject: [PATCH 6/7] Fix bindings examples --- versions/next/asyncapi.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/versions/next/asyncapi.md b/versions/next/asyncapi.md index ac68fc0f..d0811088 100644 --- a/versions/next/asyncapi.md +++ b/versions/next/asyncapi.md @@ -578,10 +578,12 @@ This object can be extended with [Specification Extensions](#specificationExtens } } }, - "amqp-0-9-1": { - "channelIsQueue": true, - "queue": { - "exclusive": true + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } } } } @@ -599,8 +601,8 @@ subscribe: user: $ref: "#/components/schemas/user" signup: -amqp-0-9-1: - channelIsQueue: true +amqp: + is: queue queue: exclusive: true ``` @@ -687,8 +689,10 @@ This object can be extended with [Specification Extensions](#specificationExtens } } }, - "amqp-0-9-1": { - "noAck": true + "bindings": { + "amqp": { + "ack": false + }, }, "traits": [ { "$ref": "#/components/operationTraits/kafka" } @@ -718,8 +722,9 @@ message: $ref: "#/components/schemas/userCreate" signup: $ref: "#/components/schemas/signup" -amqp-0-9-1: - noAck: true +bindings: + amqp: + ack: false traits: - $ref: "#/components/operationTraits/kafka" ``` @@ -751,8 +756,8 @@ This object can be extended with [Specification Extensions](#specificationExtens ```json { "bindings": { - "amqp-0-9-1": { - "noAck": true + "amqp": { + "ack": false } } } @@ -760,8 +765,8 @@ This object can be extended with [Specification Extensions](#specificationExtens ```yaml bindings: - amqp-0-9-1: - noAck: true + amqp: + ack: false ``` From fbf679988102109b3e0b9863c65c87d4e8c1e4e1 Mon Sep 17 00:00:00 2001 From: fmvilas Date: Sat, 24 Aug 2019 20:01:56 +0200 Subject: [PATCH 7/7] Add MQTT 5 to the list of bindings --- versions/next/asyncapi.md | 4 ++++ versions/next/schema.json | 1 + 2 files changed, 5 insertions(+) diff --git a/versions/next/asyncapi.md b/versions/next/asyncapi.md index d0811088..352f601d 100644 --- a/versions/next/asyncapi.md +++ b/versions/next/asyncapi.md @@ -883,6 +883,7 @@ Field Name | Type | Description `amqp` | [AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server) | Protocol-specific information for an AMQP 0-9-1 server. `amqp1` | [AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server) | Protocol-specific information for an AMQP 1.0 server. `mqtt` | [MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server) | Protocol-specific information for an MQTT server. +`mqtt5` | [MQTT 5 Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#server) | Protocol-specific information for an MQTT 5 server. `nats` | [NATS Server Binding](https://github.com/asyncapi/bindings/blob/master/nats#server) | Protocol-specific information for a NATS server. `jms` | [JMS Server Binding](https://github.com/asyncapi/bindings/blob/master/jms#server) | Protocol-specific information for a JMS server. `sns` | [SNS Server Binding](https://github.com/asyncapi/bindings/blob/master/sns#server) | Protocol-specific information for an SNS server. @@ -907,6 +908,7 @@ Field Name | Type | Description `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. `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. `mqtt` | [MQTT Channel Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#channel) | Protocol-specific information for an MQTT channel. +`mqtt5` | [MQTT 5 Channel Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#channel) | Protocol-specific information for an MQTT 5 channel. `nats` | [NATS Channel Binding](https://github.com/asyncapi/bindings/blob/master/nats/README.md#channel) | Protocol-specific information for a NATS channel. `jms` | [JMS Channel Binding](https://github.com/asyncapi/bindings/blob/master/jms/README.md#channel) | Protocol-specific information for a JMS channel. `sns` | [SNS Channel Binding](https://github.com/asyncapi/bindings/blob/master/sns/README.md#channel) | Protocol-specific information for an SNS channel. @@ -931,6 +933,7 @@ Field Name | Type | Description `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. `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. `mqtt` | [MQTT Operation Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#operation) | Protocol-specific information for an MQTT operation. +`mqtt5` | [MQTT 5 Operation Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5/README.md#operation) | Protocol-specific information for an MQTT 5 operation. `nats` | [NATS Operation Binding](https://github.com/asyncapi/bindings/blob/master/nats/README.md#operation) | Protocol-specific information for a NATS operation. `jms` | [JMS Operation Binding](https://github.com/asyncapi/bindings/blob/master/jms/README.md#operation) | Protocol-specific information for a JMS operation. `sns` | [SNS Operation Binding](https://github.com/asyncapi/bindings/blob/master/sns/README.md#operation) | Protocol-specific information for an SNS operation. @@ -957,6 +960,7 @@ Field Name | Type | Description `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. `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. `mqtt` | [MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt/README.md#message) | Protocol-specific information for an MQTT message. +`mqtt5` | [MQTT 5 Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5/README.md#message) | Protocol-specific information for an MQTT 5 message. `nats` | [NATS Message Binding](https://github.com/asyncapi/bindings/blob/master/nats/README.md#message) | Protocol-specific information for a NATS message. `jms` | [JMS Message Binding](https://github.com/asyncapi/bindings/blob/master/jms/README.md#message) | Protocol-specific information for a JMS message. `sns` | [SNS Message Binding](https://github.com/asyncapi/bindings/blob/master/sns/README.md#message) | Protocol-specific information for an SNS message. diff --git a/versions/next/schema.json b/versions/next/schema.json index dfb2bccf..d24a5544 100644 --- a/versions/next/schema.json +++ b/versions/next/schema.json @@ -731,6 +731,7 @@ "amqp": {}, "amqp1": {}, "mqtt": {}, + "mqtt5": {}, "kafka": {}, "nats": {}, "jms": {},