From ed839e237c2d0fdbb046e5fee15e40a2447c5ede Mon Sep 17 00:00:00 2001 From: Ludovic Dussart Date: Mon, 13 Sep 2021 17:52:59 +0200 Subject: [PATCH 1/2] feat(kafka): add AVRO type in message key binding Refer to asyncapi/avro-schema-parser#67 --- kafka/README.md | 4 ++-- kafka/json_schemas/message.json | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kafka/README.md b/kafka/README.md index c3ea466f..f5bf6129 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -6,7 +6,7 @@ This document defines how to describe Kafka-specific information on AsyncAPI. ## Version -Current version is `0.1.0`. +Current version is `0.2.0`. @@ -69,7 +69,7 @@ This object contains information about the message representation in Kafka. Field Name | Type | Description ---|:---:|--- -`key` | [Schema Object][schemaObject] | The message key. +`key` | [Schema Object][schemaObject] / [AVRO file](https://github.com/asyncapi/avro-schema-parser) | The message key. `bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed. This object MUST contain only the properties defined above. diff --git a/kafka/json_schemas/message.json b/kafka/json_schemas/message.json index 8509ebb7..701beaa4 100644 --- a/kafka/json_schemas/message.json +++ b/kafka/json_schemas/message.json @@ -31,6 +31,12 @@ ] }, "bindingVersion": "0.1.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "bindingVersion": "0.2.0" } ] } From 8b4e853f95b9fae81ea22f00813db2b8ce476798 Mon Sep 17 00:00:00 2001 From: Ludovic Dussart Date: Tue, 14 Sep 2021 12:10:07 +0200 Subject: [PATCH 2/2] Update kafka/README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fran Méndez --- kafka/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/README.md b/kafka/README.md index f5bf6129..adc5606e 100644 --- a/kafka/README.md +++ b/kafka/README.md @@ -69,7 +69,7 @@ This object contains information about the message representation in Kafka. Field Name | Type | Description ---|:---:|--- -`key` | [Schema Object][schemaObject] / [AVRO file](https://github.com/asyncapi/avro-schema-parser) | The message key. +`key` | [Schema Object][schemaObject] \| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html) | The message key. **NOTE**: You can also use the [reference object](https://asyncapi.io/docs/specifications/v2.1.0#referenceObject) way. `bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed. This object MUST contain only the properties defined above.