Open ilijaljubicic opened 7 years ago
why I think there is a bugs there is because when extracting avro schema from a record this is output: {"type":"record","name":"IntBooleanRecord","namespace":"test","fields":[{"name":"key","type":"boolean"}]}
thus avro schema matches what I would expect record.data to yield
Hello
I have a case where json has keys with boolean values encoded as strings "0" and "1". It is from external system and cannot influence it.
Did implement coercer and custom type, and managed to get coerced values from "0" or "1" to IntBoolean(false) and IntBoolean(true) but cannot manged to get those values with record.data() nor to get them into avro.
Simple example of what I did is
IntoBooleanRecord.courier
IntBooleanCoercer.scala
IntBoolean.courier
scala code to test
I was expecting for record.data() to output {key=true}
Is there something I am doing wrong or this is not supposed to function this way? if not, what would be the way to do it? Help would be appreciated.