TMP master
authorKai Moritz <kai@juplo.de>
Sun, 7 Jun 2020 18:00:00 +0000 (20:00 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 7 Jun 2020 18:00:00 +0000 (20:00 +0200)
validate-user/order-and-user.avsc [new file with mode: 0644]
validate-user/user.avsc [new file with mode: 0644]

diff --git a/validate-user/order-and-user.avsc b/validate-user/order-and-user.avsc
new file mode 100644 (file)
index 0000000..7690f79
--- /dev/null
@@ -0,0 +1,27 @@
+[
+  {
+    "namespace": "de.trion.microservices.avro",
+    "type": "enum",
+    "name": "CustomerLevel",
+    "symbols" : [ "BRONZE", "SILVER", "GOLD", "UNWANTED" ]
+  },
+  {
+    "namespace": "de.trion.microservices.avro",
+    "type": "record",
+    "name": "User",
+    "fields": [
+      { "name": "id", "type": "long" },
+      { "name": "level", "type": "CustomerLevel" },
+      { "name": "name", "type": "string" }
+    ]
+  },
+  {
+    "namespace": "de.trion.microservices.avro",
+    "type": "record",
+    "name": "OrderAndUser",
+    "fields": [
+      { "name": "orderId", "type": "string" },
+      { "name": "user", "type": [ "null", "User" ] }
+    ]
+  }
+]
diff --git a/validate-user/user.avsc b/validate-user/user.avsc
new file mode 100644 (file)
index 0000000..29cfce8
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "namespace": "de.trion.microservices.avro",
+  "type": "record",
+  "name": "User",
+  "fields": [
+    { "name": "id", "type": "long" },
+    {
+      "name": "level",
+      "type":
+      {
+        "namespace": "de.trion.microservices.avro",
+        "type": "enum",
+        "name": "CustomerLevel",
+        "symbols" : [ "BRONZE", "SILVER", "GOLD", "UNWANTED" ]
+      }
+    },
+    { "name": "name", "type": "string" }
+  ]
+}