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!: add new channels and operations objects #264

Merged
Show file tree
Hide file tree
Changes from all 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
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"
derberg marked this conversation as resolved.
Show resolved Hide resolved
],
"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"
Copy link
Member

@smoya smoya Sep 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the reference, this change, in combination with the changes done in definitions/3.0.0/channels.json, will solve asyncapi/spec#699 if I'm correct, please confirm @char0n

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smoya yes I can confirm.

"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 @@
{
derberg marked this conversation as resolved.
Show resolved Hide resolved
"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