I have a union in my avro schema for favorite_number which could be a null or an int. When I json encode the object I get:
{"name": "Alyssa", "favorite_number": {"int": 7}, "favorite_color": null}
I am trying to get rid of the type indicator for the union, in this case the int, so that it becomes:
{"name": "Alyssa", "favorite_number": 7, "favorite_color": "blue"}
avro schema:
{"name": "person", "type": "record",
"fields": [
{"name": "name", "type": "string"},
{"name": "favorite_number", "type": ["null", "int"], "default": null},
{"name": "favorite_color", "type": "string"}
]
}
Is there a way to do this? Thanks!