From 4658b28dc1f7e5d0a0ea2a116b49aef6c5773192 Mon Sep 17 00:00:00 2001 From: Sergio Moya <1083296+smoya@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:50:07 +0100 Subject: [PATCH] docs(spec): allow servers and channels to be defined as components --- spec/asyncapi.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/spec/asyncapi.md b/spec/asyncapi.md index e79588a17..e2e3ab148 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -1433,6 +1433,8 @@ All objects defined within the components object will have no effect on the API Field Name | Type | Description ---|:---|--- schemas | Map[`string`, [Schema Object](#schemaObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Schema Objects](#schemaObject). + servers | Map[`string`, [Server Object](#serverObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Server Objects](#serverObject). + channels | Map[`string`, [Channel Object](#channelItemObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Channel Objects](#channelItemObject). messages | Map[`string`, [Message Object](#messageObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Message Objects](#messageObject). securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject). parameters | Map[`string`, [Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Parameter Objects](#parameterObject). @@ -1489,6 +1491,23 @@ my.org.User } } }, + "servers": { + "development": { + "url": "development.gigantic-server.com", + "description": "Development server", + "protocol": "amqp", + "protocolVersion": "0.9.1" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, "messages": { "userSignUp": { "summary": "Action to sign a user up.", @@ -1574,6 +1593,17 @@ components: format: int64 name: type: string + servers: + development: + url: development.gigantic-server.com + description: Development server + protocol: amqp + protocolVersion: 0.9.1 + channels: + user/signedup: + subscribe: + message: + $ref: "#/components/messages/userSignUp" messages: userSignUp: summary: Action to sign a user up.