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: add messages field in the Operation Object #870

Closed
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
27 changes: 14 additions & 13 deletions spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,12 @@ Field Pattern | Type | Description
```json
{
"onUserSignUp": {
"summary": "Action to sign a user up.",
"description": "A longer description",
"action": "send",
"channel": {
"$ref": "#/channels/userSignup"
},
"action": "send",
"summary": "Action to sign a user up.",
"description": "A longer description",
"tags": [
{ "name": "user" },
{ "name": "signup" },
Expand All @@ -792,11 +792,11 @@ Field Pattern | Type | Description

```yaml
onUserSignUp:
summary: Action to sign a user up.
description: A longer description
action: send
channel:
$ref: '#/channels/userSignup'
action: send
summary: Action to sign a user up.
description: A longer description
tags:
- name: user
- name: signup
Expand All @@ -821,6 +821,7 @@ Field Name | Type | Description
---|:---:|---
<a name="operationObjectAction"></a>action | `string` | **Required**. Allowed values are `send` and `receive`. Use `send` when it's expected that the application will send a message to the given [`channel`](#operationObjectChannel), and `receive` when the application should expect receiving messages from the given [`channel`](#operationObjectChannel).
<a name="operationObjectChannel"></a>channel | [Reference Object](#referenceObject) | **Required**. A `$ref` pointer to the definition of the channel in which this operation is performed. Please note the `channel` property value MUST be a [Reference Object](#referenceObject) and, therefore, MUST NOT contain a [Channel Object](#channelObject). However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.
<a name="operationObjectMessages"></a>messages | [Messages Object](#messagesObject) | A map of the messages that MAY be used by this operation. **The map MUST contain a subset of the messages that are defined in the corresponding channel. If the field is omitted, the operation MAY use any of the messages defined in the corresponding channel.**
<a name="operationObjectSummary"></a>summary | `string` | A short summary of what the operation is about.
<a name="operationObjectDescription"></a>description | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
<a name="operationObjectSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)]| A declaration of which security mechanisms are associated with this operation. Only one of the security requirement objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.
Expand All @@ -835,12 +836,12 @@ This object MAY be extended with [Specification Extensions](#specificationExtens

```json
{
"summary": "Action to sign a user up.",
"description": "A longer description",
"action": "send",
"channel": {
"$ref": "#/channels/userSignup"
},
"action": "send",
"summary": "Action to sign a user up.",
"description": "A longer description",
"security": [
{
"petstore_auth": [
Expand All @@ -866,11 +867,11 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
```

```yaml
summary: Action to sign a user up.
description: A longer description
action: send
channel:
$ref: '#/channels/userSignup'
action: send
summary: Action to sign a user up.
description: A longer description
security:
- petstore_auth:
- write:pets
Expand All @@ -891,7 +892,7 @@ traits:

#### <a name="operationTraitObject"></a>Operation Trait Object

Describes a trait that MAY be applied to an [Operation Object](#operationObject). This object MAY contain any property from the [Operation Object](#operationObject), except the `action`, `channel` and `traits` ones.
Describes a trait that MAY be applied to an [Operation Object](#operationObject). This object MAY contain any property from the [Operation Object](#operationObject), except the `action`, `channel`, `messages` and `traits` ones.

If you're looking to apply traits to a message, see the [Message Trait Object](#messageTraitObject).

Expand Down