-
Notifications
You must be signed in to change notification settings - Fork 34
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
Invalid string undefined error when producing a message #27
Comments
I have the similar issue. The schema is fetched from the registry and present. But if I try to encode my values I got a InvalidError. |
I could resolve the issue in my case. I used Union types in my schema. I have the following schema in the kafka schema registry const schema = {
type: 'record',
namespace: 'com.example',
name: 'testvalues',
fields: [
{name: 'name', type: ['null', 'string'], default: null}
]}; The producer successfully fetches the schema from the registry and failed to encode the value. I passed the value like this: After I wrapped the UnionTypes I was able to produce data to a topic. On the avcs repo mtth/avsc#20, mtth/avsc#16 you can find some discussion about this topic. Since avcs v4 it should be possible to use Unions more naturally without a wrapping object. But it seems not to work if we call type.encode function directly |
Any one figured out why wrapping is required to correctly parse the union types? |
It's just the way union types have been implemented in node.js by avro |
But if parseOptions.wrapUnions is set to true, it should be handled by the library itself? |
You just need to set the parseOptions.wrapUnions to false. Then it should work withoput wrapping values. The option is passed to avcs |
Hi,
I've updated this issue (#24 ) with more info. It's not because the topic is not getting created. It's because of an error in the magic-bytes.js code. Was hoping someone familiar with it would know right off the bat what could be going on.
The text was updated successfully, but these errors were encountered: