From 96f370734c3d4684091ba891685dd77fbf9c0224 Mon Sep 17 00:00:00 2001 From: Mohamed Mahrous Date: Thu, 26 May 2022 15:04:58 +0200 Subject: [PATCH] fix docs usage.md example `readAVSCAsync` nor `avdlToAVSCAsync` returns a string. --- docs/usage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 1028e03..f10f95d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -65,11 +65,11 @@ const { SchemaType, readAVSCAsync, avdlToAVSCAsync } = require('@kafkajs/conflue // From an avsc file const schema = await readAVSCAsync('path/to/schema.avsc') -const { id } = await registry.register({ type: SchemaType.AVRO, schema }) // { id: 2 } +const { id } = await registry.register({ type: SchemaType.AVRO, schema: JSON.stringify(schema) }) // { id: 2 } // From an avdl file const schema = await avdlToAVSCAsync('path/to/protocol.avdl') -const { id } = await registry.register({ type: SchemaType.AVRO, schema }) // { id: 3 } +const { id } = await registry.register({ type: SchemaType.AVRO, schema: JSON.stringify(schema) }) // { id: 3 } ``` #### Subject @@ -317,4 +317,4 @@ const options = { ajvInstance: new Ajv() } } -``` \ No newline at end of file +```