Created
June 28, 2018 15:14
-
-
Save dangets/10fb58858fbdb039c7f03e7f09917719 to your computer and use it in GitHub Desktop.
Avro Union Types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "namespace": "com.dangets.customer", | |
"type": "record", | |
"name": "Address", | |
"fields": [ | |
{"name": "receiver", "type": "string"}, | |
{"name": "streetAddress", "type": "string"}, | |
{"name": "addressLocality", "type": "string"}, | |
{"name": "addressRegion", "type": "string"}, | |
{"name": "postalCode", "type": "string"} | |
] | |
}, | |
{ "namespace": "com.dangets.customer", | |
"type": "record", | |
"name": "CustomerCreated", | |
"fields": [ | |
{"name": "customerId", "type": "int"}, | |
{"name": "name", "type": "string"}, | |
{"name": "address", "type": "Address"} | |
] | |
}, | |
{ "namespace": "com.dangets.customer", | |
"type": "record", | |
"name": "CustomerAddressChanged", | |
"fields": [ | |
{"name": "customerId", "type": "int"}, | |
{"name": "newAddress", "type": "Address"} | |
] | |
}, | |
{ "namespace": "com.dangets.customer", | |
"type": "record", | |
"name": "CustomerInvoicePaid", | |
"fields": [ | |
{"name": "customerId", "type": "int"}, | |
{"name": "invoiceId", "type": "long"} | |
] | |
}, | |
{ "namespace": "com.dangets.customer", | |
"type": "record", | |
"name": "CustomerEvent", | |
"fields": [ | |
{"name": "customerId", "type": "int"}, | |
{"name": "event", "type": ["CustomerCreated", "CustomerAddressChanged", "CustomerInvoicePaid"] } | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment