Assume, I have a nested JSON document:
{
id: 12,
name: 'bob',
address: {
street: 'main',
code:1234
}
}
I want to pubish changes of the document via a Message Broker such as Kafka. How should those JSON updates be formalized? Are there guidelines? Can you provide a good resource (I haven't found any)?
Assume, that the street name is changed, the following would come in my mind:
1: Keep the JSON structure and add the affected fields
{
id: 12,
address: {
street: 'new street name'
}
}
2: Custom JSON
{
id: 12,
updates: [{
field: 'address.street',
new_content: 'new street name'
}]
}