Kafka-Rest Avro schema optional field error

713 views
Skip to first unread message

dxb20...@gmail.com

unread,
Mar 9, 2017, 5:46:59 PM3/9/17
to Confluent Platform
I am using the kafka-rest-proxy to write out to the schema registry and kafka, but I am getting an error as below:

"Avro expected start union got value string"


I am using the kafka-rest-node client and my schema looks as follows:

{
 
"type" : "record",
 
"name" : "User",
 
"namespace" : "com.test.kafka",
 
"fields" : [ {
   
"name" : "id",
   
"type" : "string"
 
}, {
   
"name" : "name",
   
"type" : "string"
 
}, {
   
"name" : "middleName",
   
"type": ["null", "string"],
   
"default":null
 
}, {
   
"name" : "lastName",
   
"type": "string",
 
}
}



Now, when the 'middleName' field is not included I'm getting this error. I am not sure what I'm doing wrong, I've read the following topics on the same issue, but they did not seem to have any resolution :

https://groups.google.com/forum/#!topic/confluent-platform/zFPEzC-ZzkY
https://groups.google.com/forum/#!msg/confluent-platform/Bigk_FeTXh0/B77_zCRhqUoJ

Gwen Shapira

unread,
Mar 10, 2017, 1:45:55 PM3/10/17
to confluent...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/95f4646b-cc5f-4a71-b859-45afde91b0c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Gwen Shapira
Product Manager | Confluent
650.450.2760 @gwenshap
Follow us: Twitter | blog

Some One

unread,
Mar 11, 2017, 2:20:43 PM3/11/17
to confluent...@googlegroups.com
I've taken a look at that, but my client is a node-js client and I'm using the kafka-rest-node library provided by Confluent and getting this error.  Should the Confluent provided library not serialize to a loss-less json as expected by Schema registry ?


To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsubscribe@googlegroups.com.



--
Gwen Shapira
Product Manager | Confluent
650.450.2760 @gwenshap
Follow us: Twitter | blog

--
You received this message because you are subscribed to a topic in the Google Groups "Confluent Platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/confluent-platform/A-ZtFsxN9Qk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to confluent-platform+unsub...@googlegroups.com.

To post to this group, send email to confluent-platform@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages