schema_registry_converter
schema_registry_converter copied to clipboard
working with avro decimal type
Since this crate use apache avro [to_value] (https://github.com/gklijs/schema_registry_converter/blob/main/src/avro_common.rs#L144) function to convert serializable item to Value
type, it might not work with avro schema with decimal field as the avro serializer might not convert it properly.
use apache_avro::Decimal;
#[derive(Serialize, Clone, Debug)]
pub struct item {
// indexes
pub total_successful_transaction_blocks: Decimal,
The total_successful_transaction_blocks will be serialized to
"total_successful_transaction_blocks", Record([("value", Array([Int(1), Array([Int(7)])])), ("len", Long(1))]))