Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable extensions in bindings #179

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
17 changes: 8 additions & 9 deletions amqp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ This document defines how to describe AMQP-specific information on AsyncAPI.

## Version

Current version is `0.2.0`.
Current version is `0.3.0`.


<a name="server"></a>

## Server Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.


This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="channel"></a>

Expand All @@ -43,7 +42,7 @@ Field Name | Type | Description
<a name="channelBindingObjectQueueVHost"></a>`queue.vhost` | string | The virtual host of the queue. Defaults to `/`.
<a name="channelBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.
This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

##### Example

Expand All @@ -65,7 +64,7 @@ channels:
durable: true
autoDelete: false
vhost: /
bindingVersion: 0.2.0
bindingVersion: 0.3.0
```


Expand All @@ -91,7 +90,7 @@ Field Name | Type | Applies To | Description
<a name="operationBindingObjectAck"></a>`ack` | boolean | Subscribe | Whether the consumer should ack the message or not.
<a name="operationBindingObjectBindingVersion"></a>`bindingVersion` | string | Publish, Subscribe | The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.
This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

##### Example

Expand All @@ -111,7 +110,7 @@ channels:
replyTo: user.signedup
timestamp: true
ack: false
bindingVersion: 0.2.0
bindingVersion: 0.3.0
```


Expand Down Expand Up @@ -140,5 +139,5 @@ channels:
amqp:
contentEncoding: gzip
messageType: 'user.signup'
bindingVersion: 0.2.0
bindingVersion: 0.3.0
```
6 changes: 3 additions & 3 deletions amqp/json_schemas/channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.2.0"
"0.3.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
Expand Down Expand Up @@ -120,7 +120,7 @@
"autoDelete": false,
"vhost": "/"
},
"bindingVersion": "0.2.0"
"bindingVersion": "0.3.0"
},
{
"is": "queue",
Expand All @@ -131,7 +131,7 @@
"autoDelete": false,
"vhost": "/"
},
"bindingVersion": "0.2.0"
"bindingVersion": "0.3.0"
}
]
}
4 changes: 2 additions & 2 deletions amqp/json_schemas/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.2.0"
"0.3.0"
],
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
}
Expand All @@ -31,7 +31,7 @@
{
"contentEncoding": "gzip",
"messageType": "user.signup",
"bindingVersion": "0.2.0"
"bindingVersion": "0.3.0"
}
]
}
4 changes: 2 additions & 2 deletions amqp/json_schemas/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.2.0"
"0.3.0"
],
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
}
Expand All @@ -83,7 +83,7 @@
"replyTo": "user.signedup",
"timestamp": true,
"ack": false,
"bindingVersion": "0.2.0"
"bindingVersion": "0.3.0"
}
]
}
16 changes: 12 additions & 4 deletions amqp1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Current version is `0.1.0`.

## Server Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).



Expand All @@ -22,16 +24,22 @@ This object MUST NOT contain any properties. Its name is reserved for future use

## Channel Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="operation"></a>

## Operation Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="message"></a>

## Message Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).
22 changes: 15 additions & 7 deletions anypointmq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This document defines how to describe Anypoint MQ-specific information in AsyncA
<a name="version"></a>
## Versions

The version of this bindings specification is `0.0.1`.
The version of this bindings specification is `0.0.2`.
This is also the `bindingVersion` for all binding objects defined by this specification.
In any given binding object, `latest` MAY alternatively be used to refer to the currently latest published version of this bindings specification.

Expand Down Expand Up @@ -37,7 +37,9 @@ Note that the choice of a particular Anypoint MQ client app (via its client ID a
<a name="server"></a>
## Server Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="channel"></a>
## Channel Binding Object
Expand All @@ -50,6 +52,8 @@ Field Name | Type | Description
<a name="channelBindingObjectType"></a>`destinationType` | string | **OPTIONAL**, defaults to `queue`. The type of destination, which MUST be either `exchange` or `queue` or `fifo-queue`. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel.
<a name="channelBindingObjectBindingVersion"></a>`bindingVersion` | string | **OPTIONAL**, defaults to `latest`. The version of this binding.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

Note that an Anypoint MQ exchange can only be sent to, not received from. To receive messages sent to an exchange, [an intermediary queue must be defined and bound to the exchange](https://docs.mulesoft.com/mq/mq-understanding#message-exchanges). In this bindings specification, these intermediary queues are not exposed in the AsyncAPI document. Instead, it is simply assumed that whenever messages must be received from an exchange, such an intermediary queue is involved yet invisible in the AsyncAPI document.

### Examples
Expand All @@ -72,15 +76,17 @@ channels:
anypointmq:
destination: user-signup-exchg
destinationType: exchange
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'
subscribe:
#...
```

<a name="operation"></a>
## Operation Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="message"></a>
## Message Binding Object
Expand All @@ -92,6 +98,8 @@ Field Name | Type | Description
<a name="messageBindingObjectHeaders"></a>`headers` | [Schema Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#schemaObject) | **OPTIONAL**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.
<a name="messageBindingObjectBindingVersion"></a>`bindingVersion` | string | **OPTIONAL**, defaults to `latest`. The version of this binding.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

Note that application headers must be specified in the [`headers` field of the standard Message Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#messageObjectHeaders) and are transmitted in the [`properties` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).
In contrast, protocol headers such as `messageId` must be specified in the [`headers` field of the message binding object](#messageBindingObjectHeaders) and are transmitted in the [`headers` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).

Expand Down Expand Up @@ -128,7 +136,7 @@ channels:
properties:
messageId:
type: string
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'
```

## Complete Example
Expand Down Expand Up @@ -162,7 +170,7 @@ servers:
- oauthProd: []
bindings:
anypointmq:
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'

channels:
user/signup:
Expand Down Expand Up @@ -201,7 +209,7 @@ channels:
properties:
messageId:
type: string
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'

components:
securitySchemes:
Expand Down
4 changes: 2 additions & 2 deletions anypointmq/json_schemas/channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.0.1"
"0.0.2"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
Expand All @@ -34,7 +34,7 @@
{
"destination": "user-signup-exchg",
"destinationType": "exchange",
"bindingVersion": "0.0.1"
"bindingVersion": "0.0.2"
}
]
}
4 changes: 2 additions & 2 deletions anypointmq/json_schemas/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.0.1"
"0.0.2"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
Expand All @@ -34,7 +34,7 @@
}
}
},
"bindingVersion": "0.0.1"
"bindingVersion": "0.0.2"
}
]
}
16 changes: 12 additions & 4 deletions googlepubsub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document defines how to describe Google Cloud Pub/Sub specific information

## Version

Current version is `0.1.0`.
Current version is `0.2.0`.

<a name="channel"></a>

Expand All @@ -17,13 +17,15 @@ The `Channel Bindings Object` is used to describe the Google Cloud Pub/Sub speci

Field Name | Type | Description
---|---|---
`bindingVersion`|String|The current version is `0.1.0`
`bindingVersion`|String|The current version is `0.2.0`
`labels`|Object|An object of key-value pairs _(These are used to categorize Cloud Resources like Cloud Pub/Sub Topics.)_
`messageRetentionDuration`|String|Indicates the minimum duration to retain a message after it is published to the topic _(Must be a valid [Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration).)_
`messageStoragePolicy`|[Message Storage Policy Object](#message-storage-policy-object)|Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored
`schemaSettings`|[Schema Settings Object](#schema-settings-object)|Settings for validating messages published against a schema
`topic`|String|The Google Cloud Pub/Sub Topic name

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="message-storage-policy-object"></a>

### Message Storage Policy Object
Expand Down Expand Up @@ -107,6 +109,8 @@ Field Name | Type | Description
`orderingKey`|String|If non-empty, identifies related messages for which publish order should be respected _(For more information, see [ordering messages](https://cloud.google.com/pubsub/docs/ordering).)_
`schema`|[Schema Definition Object](#schema-definition-object)|Describes the schema used to validate the payload of this message

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="schema-definition-object"></a>

### Schema Definition Object
Expand Down Expand Up @@ -161,10 +165,14 @@ components:

## Operation Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).

<a name="server"></a>

## Server Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.
This object does not contain any fixed fields. Its name is reserved for future use.

This object MAY be extended with [Specification Extensions](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#specification-extensions).
2 changes: 1 addition & 1 deletion googlepubsub/json_schemas/channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
"0.2.0"
],
"description": "The version of this binding."
},
Expand Down
2 changes: 1 addition & 1 deletion googlepubsub/json_schemas/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
"0.2.0"
],
"description": "The version of this binding."
},
Expand Down
Loading