From 20f364ee706429eb216587c77d70e123c66d2cbb Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Wed, 8 Feb 2023 11:22:46 +0100 Subject: [PATCH 1/3] feat: add reply object and reply address object --- definitions/3.0.0/components.json | 70 ++++++++++++++------ definitions/3.0.0/operation.json | 16 +++++ definitions/3.0.0/operationReply.json | 26 ++++++++ definitions/3.0.0/operationReplyAddress.json | 25 +++++++ 4 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 definitions/3.0.0/operationReply.json create mode 100644 definitions/3.0.0/operationReplyAddress.json diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index f7c7a7d1..31898f65 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -68,10 +68,34 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" } }, - "serverBindings": { + "replies": { "type": "object", - "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json" + } + ] + } + } + }, + "replyAddresses": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } + ] + } } }, "channelBindings": { @@ -94,28 +118,32 @@ }, "tags": { "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } } }, "externalDocs": { "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" - } - ] + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } } } }, diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index aead26de..4e2c0233 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -19,6 +19,22 @@ "channel": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, + "messages": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + }, + "reply": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReply.json" + } + ] + }, "traits": { "type": "array", "items": { diff --git a/definitions/3.0.0/operationReply.json b/definitions/3.0.0/operationReply.json new file mode 100644 index 00000000..8a64acaf --- /dev/null +++ b/definitions/3.0.0/operationReply.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "address": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } + ] + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operationReply.json" +} \ No newline at end of file diff --git a/definitions/3.0.0/operationReplyAddress.json b/definitions/3.0.0/operationReplyAddress.json new file mode 100644 index 00000000..dd7d0e2c --- /dev/null +++ b/definitions/3.0.0/operationReplyAddress.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "location" + ], + "properties": { + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the reply address.", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "description": { + "type": "string", + "description": "An optional description of the address. CommonMark is allowed." + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" +} \ No newline at end of file From 361c5276cccf575e428a95f73be59da599412846 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Wed, 8 Feb 2023 16:31:11 +0100 Subject: [PATCH 2/3] revert serverBindings remove --- definitions/3.0.0/components.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index 31898f65..fbe062cc 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -98,6 +98,12 @@ } } }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + }, "channelBindings": { "type": "object", "additionalProperties": { From a3814dcf071fbe622e38a35f7d8e0ddcec10aae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Urba=C5=84czyk?= Date: Sun, 2 Apr 2023 16:26:20 +0200 Subject: [PATCH 3/3] add messages to operation reply object --- definitions/3.0.0/operationReply.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/definitions/3.0.0/operationReply.json b/definitions/3.0.0/operationReply.json index 8a64acaf..2cf7c0e9 100644 --- a/definitions/3.0.0/operationReply.json +++ b/definitions/3.0.0/operationReply.json @@ -19,6 +19,12 @@ }, "channel": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + "messages": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } } }, "$schema": "http://json-schema.org/draft-07/schema#",