Skip to content

Commit 69e1ce7

Browse files
authored
feat!: add new channels and operations objects (#264)
1 parent 35dd959 commit 69e1ce7

13 files changed

+595
-395
lines changed

definitions/3.0.0/asyncapi.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"type": "object",
66
"required": [
77
"asyncapi",
8-
"info",
9-
"channels"
8+
"info"
109
],
1110
"additionalProperties": false,
1211
"patternProperties": {
@@ -39,6 +38,9 @@
3938
"channels": {
4039
"$ref": "http://asyncapi.com/definitions/3.0.0/channels.json"
4140
},
41+
"operations": {
42+
"$ref": "http://asyncapi.com/definitions/3.0.0/operations.json"
43+
},
4244
"components": {
4345
"$ref": "http://asyncapi.com/definitions/3.0.0/components.json"
4446
},
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"type": "object",
3+
"additionalProperties": true,
4+
"properties": {
5+
"http": {},
6+
"ws": {},
7+
"amqp": {},
8+
"amqp1": {},
9+
"mqtt": {},
10+
"mqtt5": {},
11+
"kafka": {},
12+
"anypointmq": {},
13+
"nats": {},
14+
"jms": {},
15+
"sns": {},
16+
"sqs": {},
17+
"stomp": {},
18+
"redis": {},
19+
"ibmmq": {},
20+
"solace": {}
21+
},
22+
"$schema": "http://json-schema.org/draft-07/schema#",
23+
"$id": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json"
24+
}
Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
}
88
},
99
"properties": {
10-
"$ref": {
11-
"$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json"
10+
"address": {
11+
"type": ["string", "null"],
12+
"description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions."
13+
},
14+
"messages": {
15+
"$ref": "http://asyncapi.com/definitions/3.0.0/channelMessages.json"
1216
},
1317
"parameters": {
1418
"type": "object",
@@ -28,20 +32,20 @@
2832
},
2933
"uniqueItems": true
3034
},
31-
"publish": {
32-
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json"
33-
},
34-
"subscribe": {
35-
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json"
36-
},
37-
"deprecated": {
38-
"type": "boolean",
39-
"default": false
40-
},
4135
"bindings": {
4236
"$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json"
37+
},
38+
"tags": {
39+
"type": "array",
40+
"items": {
41+
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
42+
},
43+
"uniqueItems": true
44+
},
45+
"externalDocs": {
46+
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
4347
}
4448
},
4549
"$schema": "http://json-schema.org/draft-07/schema#",
46-
"$id": "http://asyncapi.com/definitions/3.0.0/channelItem.json"
50+
"$id": "http://asyncapi.com/definitions/3.0.0/channel.json"
4751
}

definitions/3.0.0/channelBindingsObject.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "object",
33
"additionalProperties": false,
44
"patternProperties": {
5-
"^x-[\\w\\d\\.\\-\\_]+$": {
5+
"^x-[\\w\\d\\.\\x2d_]+$": {
66
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
77
}
88
},
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "object",
3+
"additionalProperties": {
4+
"$ref": "http://asyncapi.com/definitions/3.0.0/message.json"
5+
},
6+
"description": "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**",
7+
"$schema": "http://json-schema.org/draft-07/schema#",
8+
"$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json"
9+
}

definitions/3.0.0/channels.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
22
"type": "object",
3-
"propertyNames": {
4-
"type": "string",
5-
"format": "uri-template",
6-
"minLength": 1
7-
},
83
"additionalProperties": {
9-
"$ref": "http://asyncapi.com/definitions/3.0.0/channelItem.json"
4+
"oneOf": [
5+
{ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" },
6+
{ "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" }
7+
]
108
},
119
"$schema": "http://json-schema.org/draft-07/schema#",
1210
"$id": "http://asyncapi.com/definitions/3.0.0/channels.json"

definitions/3.0.0/messageBindingsObject.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "object",
33
"additionalProperties": false,
44
"patternProperties": {
5-
"^x-[\\w\\d\\.\\-\\_]+$": {
5+
"^x-[\\w\\d\\.\\x2d_]+$": {
66
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
77
}
88
},

definitions/3.0.0/operation.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@
66
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
77
}
88
},
9+
"required": [
10+
"action",
11+
"channel"
12+
],
913
"properties": {
14+
"action": {
15+
"type": "string",
16+
"description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.",
17+
"enum": ["send", "receive"]
18+
},
19+
"channel": {
20+
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
21+
},
1022
"traits": {
1123
"type": "array",
1224
"items": {
@@ -61,14 +73,8 @@
6173
"externalDocs": {
6274
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
6375
},
64-
"operationId": {
65-
"type": "string"
66-
},
6776
"bindings": {
6877
"$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"
69-
},
70-
"message": {
71-
"$ref": "http://asyncapi.com/definitions/3.0.0/message.json"
7278
}
7379
},
7480
"$schema": "http://json-schema.org/draft-07/schema#",

definitions/3.0.0/operationBindingsObject.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"type": "object",
33
"additionalProperties": false,
44
"patternProperties": {
5-
"^x-[\\w\\d\\.\\-\\_]+$": {
5+
"^x-[\\w\\d\\.\\x2d_]+$": {
66
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
77
}
88
},

definitions/3.0.0/operationTrait.json

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,29 @@
77
}
88
},
99
"properties": {
10+
"action": {
11+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/action"
12+
},
13+
"channel": {
14+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/channel"
15+
},
1016
"summary": {
11-
"type": "string"
17+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary"
1218
},
1319
"description": {
14-
"type": "string"
20+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description"
21+
},
22+
"security": {
23+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security"
1524
},
1625
"tags": {
17-
"type": "array",
18-
"items": {
19-
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
20-
},
21-
"uniqueItems": true
26+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags"
2227
},
2328
"externalDocs": {
24-
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
25-
},
26-
"operationId": {
27-
"type": "string"
28-
},
29-
"security": {
30-
"type": "array",
31-
"items": {
32-
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
33-
}
29+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs"
3430
},
3531
"bindings": {
36-
"$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"
32+
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings"
3733
}
3834
},
3935
"$schema": "http://json-schema.org/draft-07/schema#",

0 commit comments

Comments
 (0)