We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
AVSC
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
The documentation for registering an Avro schema using an AVSC file shows the following:
const { SchemaType, readAVSCAsync, avdlToAVSCAsync } = require('@kafkajs/confluent-schema-registry') // From an avsc file const schema = await readAVSCAsync('path/to/schema.avsc') const { id } = await registry.register({ type: SchemaType.AVRO, schema }) // { id: 2 }
When attempting to do this with Typescript, Typescript shows the following error with schema:
schema
Type 'RawAvroSchema' is not assignable to type 'string'.
schema.avsc
{ "type": "string", "name": "name" }
const { SchemaType, readAVSCAsync } = require('@kafkajs/confluent-schema-registry') const schema = await readAVSCAsync('path/to/schema.avsc') const { id } = await registry.register({ type: SchemaType.AVRO, schema })
I believe the documentation should say something like
const { SchemaType, readAVSCAsync, avdlToAVSCAsync } = require('@kafkajs/confluent-schema-registry') const schema = await readAVSCAsync('path/to/schema.avsc') const { id } = await registry.register(schema)
based on getConfluentSchema() in SchemaRegistry.ts.
getConfluentSchema()
SchemaRegistry.ts
The text was updated successfully, but these errors were encountered:
In my case this error was throwing since I was using pure Node.js:
ResponseError: Confluent_Schema_Registry - Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
@joshjluo Potential Solution did the trick!
Sorry, something went wrong.
Also ran into this and this fix worked.
No branches or pull requests
Issue description
The documentation for registering an Avro schema using an
AVSC
file shows the following:When attempting to do this with Typescript, Typescript shows the following error with
schema
:Steps to reproduce the issue
schema.avsc
file. For example,schema
.Potential Solution
I believe the documentation should say something like
based on
getConfluentSchema()
inSchemaRegistry.ts
.The text was updated successfully, but these errors were encountered: