Closed pozil closed 1 year ago
This was an issue for us, and I came up with this solution. I'm curious what others are doing. This worked for Platform Events, haven't tested change data capture since we don't use it.
Object.entries(payload).forEach(([key, value]) => {
if (value && typeof value === 'object') {
payload[key] = value[Object.keys(value)[0])
}
Thanks for the lead @soileaud. The implementation turned out to be a bit more complex because of compound types but it's now part of v3.0.0.
Event payloads looks like this after being decoded by Avro:
It would be nice to strip the intermediate type properties and produce something like this: