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: added server variable object as reusable object #717

Merged
Changes from 3 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
37 changes: 34 additions & 3 deletions spec/asyncapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,7 @@ 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="componentsServerVariables"></a> serverVariables | Map[`string`, [Server Variable Object](#serverVariableObject) \| [Reference Object](#referenceObject)] | An object to hold reusable [Server Variable Objects](#serverVariableObject).
<a name="componentsChannels"></a> channels | Map[`string`, [Channel Item Object](#channelItemObject)] | An object to hold reusable [Channel Item 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).
Expand Down Expand Up @@ -1497,10 +1498,28 @@ my.org.User
},
"servers": {
"development": {
"url": "development.gigantic-server.com",
"url": "{stage}.gigantic-server.com:{port}",
"description": "Development server",
"protocol": "amqp",
"protocolVersion": "0.9.1"
"protocolVersion": "0.9.1",
"variables": {
"stage": {
"$ref": "#/components/serverVariables/stage"
},
"port": {
"$ref": "#/components/serverVariables/port"
}
}
}
},
"serverVariables": {
"stage": {
"default": "demo",
"description": "This value is assigned by the service provider, in this example `gigantic-server.com`"
},
"port": {
"enum": ["8883", "8884"],
"default": "8883"
}
},
"channels": {
Expand Down Expand Up @@ -1599,10 +1618,22 @@ components:
type: string
servers:
development:
url: development.gigantic-server.com
url: {stage}.gigantic-server.com:{port}
danielkocot marked this conversation as resolved.
Show resolved Hide resolved
description: Development server
protocol: amqp
protocolVersion: 0.9.1
variables:
stage:
$ref: "#/components/serverVariables/stage"
port:
$ref: "#/components/serverVariables/port"
serverVariables:
stage:
default: demo,
danielkocot marked this conversation as resolved.
Show resolved Hide resolved
description: This value is assigned by the service provider, in this example `gigantic-server.com`
port:
enum: [8883, 8884],
danielkocot marked this conversation as resolved.
Show resolved Hide resolved
default: 8883
channels:
user/signedup:
subscribe:
Expand Down