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 1 commit
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
3 changes: 1 addition & 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
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"
}
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
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
39 changes: 1 addition & 38 deletions definitions/3.0.0/operationTrait.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,4 @@
{
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"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"
},
"operationId": {
"type": "string"
},
"security": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json"
}
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "http://asyncapi.com/definitions/3.0.0/operation.json",
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
"$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json"
}
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"
}
6 changes: 3 additions & 3 deletions schemas/3.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,11 @@
"minLength": 1
fmvilas marked this conversation as resolved.
Show resolved Hide resolved
},
"additionalProperties": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channelItem.json"
"$ref": "http://asyncapi.com/definitions/3.0.0/channel.json"
}
},
"http://asyncapi.com/definitions/3.0.0/channelItem.json": {
"$id": "http://asyncapi.com/definitions/3.0.0/channelItem.json",
"http://asyncapi.com/definitions/3.0.0/channel.json": {
"$id": "http://asyncapi.com/definitions/3.0.0/channel.json",
"type": "object",
"additionalProperties": false,
"patternProperties": {
Expand Down