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

Fix for allowing JSON options through #242

Open
LudHag opened this issue Jun 5, 2023 · 0 comments
Open

Fix for allowing JSON options through #242

LudHag opened this issue Jun 5, 2023 · 0 comments

Comments

@LudHag
Copy link

LudHag commented Jun 5, 2023

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @kafkajs/[email protected] for the project I'm working on.

Currently json options seems to be discarded during asProtocolOptions. Doing this fix solved my problems when trying to change JSON schema strict mode.

Here is the diff that solved my problem:

diff --git a/node_modules/@kafkajs/confluent-schema-registry/dist/SchemaRegistry.js b/node_modules/@kafkajs/confluent-schema-registry/dist/SchemaRegistry.js
index 8ed50a3..194de8e 100644
--- a/node_modules/@kafkajs/confluent-schema-registry/dist/SchemaRegistry.js
+++ b/node_modules/@kafkajs/confluent-schema-registry/dist/SchemaRegistry.js
@@ -101,6 +101,7 @@ class SchemaRegistry {
         }
         return {
             [_types_1.SchemaType.AVRO]: (_b = options) === null || _b === void 0 ? void 0 : _b.forSchemaOptions,
+            [_types_1.SchemaType.JSON]: options[_types_1.SchemaType.JSON]
         };
     }
     async getreferencedSchemas(schema, helper) {

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant