The title says it all, really. I'm struggling to figure out how to make a Google Cloud Pub/Sub schema that has optional fields. Or would having optional fields in an AVRO schema basically directly contradict the whole point of having a schema?
The structure I tried is this, with no success:
{
"type": "record",
"name": "Avro",
"fields": [
{
"name": "TestStringField",
"type": ["null", "string"],
"default": ""
},
{
"name": "TestIntField",
"type": ["null", "int"],
"default": 0
}
]
}