Skip to content

Commit

Permalink
docs(spec): allow servers and channels to be defined as components
Browse files Browse the repository at this point in the history
  • Loading branch information
smoya committed Dec 28, 2021
1 parent 2d0bf41 commit 4658b28
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,8 @@ All objects defined within the components object will have no effect on the API
Field Name | Type | Description
---|:---|---
<a name="componentsSchemas"></a> schemas | Map[`string`, [Schema Object](#schemaObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Schema Objects](#schemaObject).
<a name="componentsServers"></a> servers | Map[`string`, [Server Object](#serverObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Server Objects](#serverObject).
<a name="componentsChannels"></a> channels | Map[`string`, [Channel Object](#channelItemObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Channel Objects](#channelItemObject).
<a name="componentsMessages"></a> messages | Map[`string`, [Message Object](#messageObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Message Objects](#messageObject).
<a name="componentsSecuritySchemes"></a> securitySchemes| Map[`string`, [Security Scheme Object](#securitySchemeObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Security Scheme Objects](#securitySchemeObject).
<a name="componentsParameters"></a> parameters | Map[`string`, [Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Parameter Objects](#parameterObject).
Expand Down Expand Up @@ -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.",
Expand Down Expand 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.
Expand Down

0 comments on commit 4658b28

Please sign in to comment.