1-я схема:
Код: Выделить всё
{
"type": "record",
"name": "MessageKey",
"namespace": "com.example.domain",
"doc": "Kafka message key.",
"fields": [
{
"name": "id",
"type": {
"type": "string",
"avro.java.string": "String"
},
"doc": "The ID."
},
{
"name": "provenance",
"type": {
"name": "Provenance",
"type": "record",
"fields": [
{
"name": "orderId",
"type": "boolean"
}
]
}
}
]
}
Код: Выделить всё
{
"type": "record",
"name": "Programme",
"namespace": "com.example.domain",
"doc": "A Programme.",
"fields": [
{
"name": "id",
"type": {
"type": "string",
"avro.java.string": "String"
},
"doc": "The id of the programme."
},
{
"name": "provenance",
"type": {
"name": "Provenance",
"type": "record",
"fields": [
{
"name": "orderId",
"type": "boolean"
}
]
}
}
]
}
Код: Выделить всё
{"name":"Provenance","type":"record","fields":[{"name":"orderId","type":"boolean"}]}но затем тот же объект находится во второй раз, и он по какой-то причине отличается:
Код: Выделить всё
{"type":"record","name":"Provenance","namespace":"com.example.domain"}Подробнее здесь: https://stackoverflow.com/questions/789 ... redefining