Skip to content

Commit

Permalink
feat: add name and summary properties to message examples (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbroudoux authored Jun 23, 2021
1 parent a3a7c40 commit 85db357
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ Field Name | Type | Description
<a name="messageObjectTags"></a>tags | [Tags Object](#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of messages.
<a name="messageObjectExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this message.
<a name="messageObjectBindings"></a>bindings | [Message Bindings Object](#messageBindingsObject) \| [Reference Object](#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message.
<a name="messageObjectExamples"></a>examples | [Map[`string`, `any`]] | An array of key/value pairs where keys MUST be either **headers** and/or **payload**. Values MUST contain examples that validate against the [headers](#messageObjectHeaders) or [payload](#messageObjectPayload) fields, respectively.
<a name="messageObjectExamples"></a>examples | [Map[`string`, `any`]] | An array of key/value pairs where keys MUST be either **headers** and/or **payload**. Values MUST contain examples that validate against the [headers](#messageObjectHeaders) or [payload](#messageObjectPayload) fields, respectively. Example MAY also have the **name** and **summary** additional keys to provide respectively a machine-friendly name and a short summary of what the example is about.
<a name="messageObjectTraits"></a>traits | [[Message Trait Object](#messageTraitObject) &#124; [Reference Object](#referenceObject)] | 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).

This object can be extended with [Specification Extensions](#specificationExtensions).
Expand Down Expand Up @@ -1086,6 +1086,8 @@ Name | Allowed values | Notes
],
"examples": [
{
"name": "SimpleSignup",
"summary": "A simple UserSignup example message",
"headers": {
"correlationId": "my-correlation-id",
"applicationInstanceId": "myInstanceId"
Expand Down Expand Up @@ -1135,7 +1137,9 @@ correlationId:
traits:
- $ref: "#/components/messageTraits/commonHeaders"
examples:
- headers:
- name: SimpleSignup
summary: A simple UserSignup example message
headers:
correlationId: my-correlation-id
applicationInstanceId: myInstanceId
payload:
Expand Down

0 comments on commit 85db357

Please sign in to comment.