Skip to content

Commit

Permalink
feat: enable extensions in bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg committed Jan 17, 2023
1 parent c175a70 commit f809463
Show file tree
Hide file tree
Showing 36 changed files with 141 additions and 119 deletions.
12 changes: 6 additions & 6 deletions amqp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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>
Expand Down Expand Up @@ -43,7 +43,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 +65,7 @@ channels:
durable: true
autoDelete: false
vhost: /
bindingVersion: 0.2.0
bindingVersion: 0.3.0
```
Expand All @@ -91,7 +91,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 +111,7 @@ channels:
replyTo: user.signedup
timestamp: true
ack: false
bindingVersion: 0.2.0
bindingVersion: 0.3.0
```


Expand Down Expand Up @@ -140,5 +140,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"
}
]
}
14 changes: 9 additions & 5 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 @@ -50,6 +50,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,7 +74,7 @@ channels:
anypointmq:
destination: user-signup-exchg
destinationType: exchange
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'
subscribe:
#...
```
Expand All @@ -92,6 +94,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 +132,7 @@ channels:
properties:
messageId:
type: string
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'
```
## Complete Example
Expand Down Expand Up @@ -162,7 +166,7 @@ servers:
- oauthProd: []
bindings:
anypointmq:
bindingVersion: '0.0.1'
bindingVersion: '0.0.2'

channels:
user/signup:
Expand Down Expand Up @@ -201,7 +205,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"
}
]
}
8 changes: 6 additions & 2 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
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
11 changes: 5 additions & 6 deletions http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document defines how to describe HTTP-specific information on AsyncAPI.

## Version

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


<a name="server"></a>
Expand Down Expand Up @@ -38,7 +38,7 @@ Field Name | Type | Description
<a name="operationBindingObjectQuery"></a>`query` | [Schema Object][schemaObject] | A Schema object containing the definitions for each query parameter. This schema MUST be of type `object` and have a `properties` key.
<a name="operationBindingObjectBindingVersion"></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 @@ -60,7 +60,7 @@ channels:
minimum: 1
description: The Id of the company.
additionalProperties: false
bindingVersion: '0.1.0'
bindingVersion: '0.2.0'
```
Expand All @@ -77,8 +77,7 @@ Field Name | Type | Description
<a name="messageBindingObjectHeaders"></a>`headers` | [Schema Object][schemaObject] | A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.
<a name="messageBindingObjectBindingVersion"></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).

```yaml
channels:
Expand All @@ -93,7 +92,7 @@ channels:
Content-Type:
type: string
enum: ['application/json']
bindingVersion: '0.1.0'
bindingVersion: '0.2.0'
```

[schemaObject]: https://www.asyncapi.com/docs/specifications/2.0.0/#schemaObject
4 changes: 2 additions & 2 deletions http/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.1.0"
"0.2.0"
],
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
}
Expand All @@ -36,7 +36,7 @@
}
}
},
"bindingVersion": "0.1.0"
"bindingVersion": "0.2.0"
}
]
}
6 changes: 3 additions & 3 deletions http/json_schemas/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0"
"0.2.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
Expand Down Expand Up @@ -90,7 +90,7 @@
},
"additionalProperties": false
},
"bindingVersion": "0.1.0"
"bindingVersion": "0.2.0"
},
{
"type": "request",
Expand All @@ -109,7 +109,7 @@
},
"additionalProperties": false
},
"bindingVersion": "0.1.0"
"bindingVersion": "0.2.0"
}
]
}
Expand Down
Loading

0 comments on commit f809463

Please sign in to comment.