This is my first time working with AVRO schemas, I have the following json payload.
{
"data": {
"tracking": {
"id": 25596167,
"label": "Lorem Ipsum",
"source": "http://somelink",
"type": "Email click",
"device": "PC",
"OSName": "Windows 10",
"browserName": "Chrome",
"logDate": "2024-02-21 12:56:26.050 +01:00"
}
}
}
and based on the above, I have create the following schema, is it correct? or is there something missing?
{
"doc": "Email Tracking",
"type": "record",
"name": "emailTracking",
"namespace": "net.domain.event.avro.marketing.emailTracking",
"fields": [
{
"name": "id",
"type": ["long"],
},
{
"name": "label",
"type": ["null","string"],
"default": null
},
{
"name": "source",
"type": ["null","string"],
"default": null
},
{
"name": "type",
"type": {
"type": "enum",
"name": "type",
"symbols": [
"Email click",
"Mirror page",
"Open",
"Opt-out"
]
}
},
{
"name": "device",
"type": ["null","string"],
"default": null
},
{
"name": "OSName",
"type": ["null","string"],
"default": null
},
{
"name": "browserName",
"type": ["null","string"],
"default": null
},
{
"name": "logDate",
"type": ["string"],
}
]
}