1 user/signedup:
2 subscribe:
3 $ref: "#/components/messages/userSignUp"user/signedup 频道。1 {
2 "field" : [...]
3 }$ref中的规范中的字段。asyncapi.json或asyncapi.yaml.| 字段名称 | 类型 | 描述 |
|---|---|---|
| asyncapi | AsyncAPI Version String | 必需的。 指定正在使用的 AsyncAPI 规范版本。工具规范和客户端可以使用它来解释版本。结构应为major. minor. patch,其中patch版本必须与现有的 兼容major。minor工装。通常会引入补丁版本来解决文档中的错误,并且工具通常应该与相应的major. minor(1.0.*)。补丁版本将对应本文档的补丁。 |
| id | Identifier | AsyncAPI 文档正在定义的应用程序的标识符。 |
| info | Info Object | 必需的。提供有关 API 的元数据。如果需要,客户端可以使用元数据。 |
| servers | Servers Object | 提供服务器的连接详细信息。 |
| channels | Channels Object | 必需 API 的可用通道和消息。 |
| components | Components Object | 用于保存规范的各种模式的元素。 |
| tags | Tags Object | 规范使用的带有附加元数据的标签列表。列表中的每个标签名称必须是唯一的。 |
| externalDocs | External Documentation Object | 额外的外部文档。 |
major. minor. patch. patch 可以用连字符和额外的字母数字字符作为后缀。major。minor应用于指定 AsyncAPI 规范版本,并将被视为与该 指定的 AsyncAPI 规范兼容major。minor版本。补丁版本不会被工具考虑,不区分1.0.0和1.0.1。minor不应干扰为较低次要版本开发的工具的操作。因此,假设的1.1.0规范应该可用于为 . 设计的工具1.0.0。
1 {
2 "id": "urn:com:smartylighting:streetlights:server"
3 }id: 'urn:com:smartylighting:streetlights:server'
1 {
2 "id": "https://github.com/smartylighting/streetlights-server"
3 }id: 'https://github.com/smartylighting/streetlights-server'| 字段名称 | 类型 | 描述 |
|---|---|---|
| title | string | 必须的。 应用程序的标题。 |
| version | string | 必需提供应用程序 API 的版本(不要与规范版本混淆)。 |
| description | string | 应用程序的简短描述。CommonMark 语法可用于富文本表示。 |
| termsOfService | string | API 服务条款的 URL。必须采用 URL 格式。 |
| contact | Contact Object | 公开的 API 的联系信息。 |
| license | License Object | 公开的 API 的许可证信息。 |
1 {
2 "title": "AsyncAPI Sample App",
3 "description": "This is a sample server.",
4 "termsOfService": "http://asyncapi.org/terms/",
5 "contact": {
6 "name": "API Support",
7 "url": "http://www.asyncapi.org/support",
8 "email": "support@asyncapi.org"
9 },
10 "license": {
11 "name": "Apache 2.0",
12 "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
13 },
14 "version": "1.0.1"
15 }
1 title: AsyncAPI Sample App
2 description: This is a sample server.
3 termsOfService: http://asyncapi.org/terms/
4 contact:
5 name: API Support
6 url: http://www.asyncapi.org/support
7 email: support@asyncapi.org
8 license:
9 name: Apache 2.0
10 url: http://www.apache.org/licenses/LICENSE-2.0.html
11 version: 1.0.1| 字段名称 | 类型 | 描述 |
|---|---|---|
| name | string | 联系人/组织的识别名称。 |
| url | string | 指向联系信息的 URL。必须采用 URL 格式。 |
string | 联系人/组织的电子邮件地址。必须采用电子邮件地址的格式。 |
1 {
2 "name": "API Support",
3 "url": "http://www.example.com/support",
4 "email": "support@example.com"
5 }
1 name: API Support
2 url: http://www.example.com/support
3 email: support@example.com