Skip to content

Commit

Permalink
feat!: add new channels and operations objects (asyncapi#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmvilas authored and jonaslagoni committed Nov 6, 2022
1 parent 57f7d7c commit 928bf91
Show file tree
Hide file tree
Showing 13 changed files with 595 additions and 395 deletions.
6 changes: 4 additions & 2 deletions definitions/3.0.0/asyncapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"type": "object",
"required": [
"asyncapi",
"info",
"channels"
"info"
],
"additionalProperties": false,
"patternProperties": {
Expand Down Expand Up @@ -39,6 +38,9 @@
"channels": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channels.json"
},
"operations": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operations.json"
},
"components": {
"$ref": "http://asyncapi.com/definitions/3.0.0/components.json"
},
Expand Down
24 changes: 24 additions & 0 deletions definitions/3.0.0/bindingsObject.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "object",
"additionalProperties": true,
"properties": {
"http": {},
"ws": {},
"amqp": {},
"amqp1": {},
"mqtt": {},
"mqtt5": {},
"kafka": {},
"anypointmq": {},
"nats": {},
"jms": {},
"sns": {},
"sqs": {},
"stomp": {},
"redis": {},
"ibmmq": {},
"solace": {}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
}
},
"properties": {
"$ref": {
"$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json"
"address": {
"type": ["string", "null"],
"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."
},
"messages": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channelMessages.json"
},
"parameters": {
"type": "object",
Expand All @@ -28,20 +32,20 @@
},
"uniqueItems": true
},
"publish": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json"
},
"subscribe": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json"
},
"deprecated": {
"type": "boolean",
"default": false
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json"
},
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
},
"uniqueItems": true
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/channelItem.json"
"$id": "http://asyncapi.com/definitions/3.0.0/channel.json"
}
2 changes: 1 addition & 1 deletion definitions/3.0.0/channelBindingsObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
Expand Down
9 changes: 9 additions & 0 deletions definitions/3.0.0/channelMessages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "object",
"additionalProperties": {
"$ref": "http://asyncapi.com/definitions/3.0.0/message.json"
},
"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.**",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json"
}
10 changes: 4 additions & 6 deletions definitions/3.0.0/channels.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"type": "object",
"propertyNames": {
"type": "string",
"format": "uri-template",
"minLength": 1
},
"additionalProperties": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channelItem.json"
"oneOf": [
{ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" },
{ "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" }
]
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/channels.json"
Expand Down
2 changes: 1 addition & 1 deletion definitions/3.0.0/messageBindingsObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
Expand Down
18 changes: 12 additions & 6 deletions definitions/3.0.0/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"required": [
"action",
"channel"
],
"properties": {
"action": {
"type": "string",
"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.",
"enum": ["send", "receive"]
},
"channel": {
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
"traits": {
"type": "array",
"items": {
Expand Down Expand Up @@ -61,14 +73,8 @@
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
},
"operationId": {
"type": "string"
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"
},
"message": {
"$ref": "http://asyncapi.com/definitions/3.0.0/message.json"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion definitions/3.0.0/operationBindingsObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
Expand Down
32 changes: 14 additions & 18 deletions definitions/3.0.0/operationTrait.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,29 @@
}
},
"properties": {
"action": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/action"
},
"channel": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/channel"
},
"summary": {
"type": "string"
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary"
},
"description": {
"type": "string"
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description"
},
"security": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security"
},
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
},
"uniqueItems": true
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags"
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
},
"operationId": {
"type": "string"
},
"security": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
}
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs"
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
11 changes: 11 additions & 0 deletions definitions/3.0.0/operations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "object",
"additionalProperties": {
"oneOf": [
{ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" },
{ "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" }
]
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/definitions/3.0.0/operations.json"
}
2 changes: 1 addition & 1 deletion definitions/3.0.0/serverBindingsObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
Expand Down
Loading

0 comments on commit 928bf91

Please sign in to comment.