From 503053132df936785dbe12f61ba10b7fbaf2ae1b Mon Sep 17 00:00:00 2001 From: Laurent Broudoux Date: Fri, 10 Nov 2023 09:53:20 -0600 Subject: [PATCH] feat: adapt Kafka bindings to v3 Signed-off-by: Laurent Broudoux --- definitions/3.0.0/channelBindingsObject.json | 17 +++++++++++++++-- definitions/3.0.0/messageBindingsObject.json | 16 ++++++++-------- definitions/3.0.0/operationBindingsObject.json | 16 ++++++++-------- definitions/3.0.0/serverBindingsObject.json | 17 +++++++++++++++-- 4 files changed, 46 insertions(+), 20 deletions(-) diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 21ba2f2c..bd26ae07 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -84,7 +84,7 @@ "kafka": { "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0"] + "enum": ["v3-0.4.0", "0.4.0", "0.3.0"] } }, "allOf": [ @@ -98,7 +98,20 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/channel.json" + } + }, + { + "if": { + "required": [ "bindingVersion" ], + "properties": { + "bindingVersion": { + "const": "v3-0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/channel.json" } }, { diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index cfe65074..e9bfb90d 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -118,7 +118,7 @@ "kafka": { "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0", "0.1.0"] + "enum": ["v3-0.4.0", "0.4.0", "0.3.0"] } }, "allOf": [ @@ -132,7 +132,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/message.json" } }, { @@ -140,12 +140,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.4.0" + "const": "v3-0.4.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/message.json" } }, { @@ -153,12 +153,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.3.0" + "const": "0.4.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/message.json" } }, { @@ -166,12 +166,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.3.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" } } ] diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index 8f629437..f587712a 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -118,7 +118,7 @@ "kafka": { "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0", "0.1.0"] + "enum": ["v3-0.4.0", "0.4.0", "0.3.0"] } }, "allOf": [ @@ -132,7 +132,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/operation.json" } }, { @@ -140,12 +140,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.4.0" + "const": "v3-0.4.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/operation.json" } }, { @@ -153,12 +153,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.3.0" + "const": "0.4.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" } }, { @@ -166,12 +166,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.3.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" } } ] diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 5782a1c5..4aa21522 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -84,7 +84,7 @@ "kafka": { "properties": { "bindingVersion": { - "enum": ["0.4.0", "0.3.0"] + "enum": ["v3-0.4.0", "0.4.0", "0.3.0"] } }, "allOf": [ @@ -98,7 +98,20 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/server.json" + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/server.json" + } + }, + { + "if": { + "required": [ "bindingVersion" ], + "properties": { + "bindingVersion": { + "const": "v3-0.4.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/kafka/v3-0.4.0/server.json" } }, {