Merge "Upgrade event schema to support delete operation"
[cps.git] / cps-events / src / main / resources / schemas / cps-data-updated-event-schema.json
index de445ec..3c95664 100644 (file)
@@ -1,7 +1,7 @@
 {
 
   "$schema": "https://json-schema.org/draft/2019-09/schema",
-  "$id": "urn:cps:org.onap.cps:data-updated-event-schema:1.1.0-SNAPSHOT",
+  "$id": "urn:cps:org.onap.cps:data-updated-event-schema:v2",
 
   "$ref": "#/definitions/CpsDataUpdatedEvent",
 
       "type": "object",
       "properties": {
         "schema": {
-          "description": "The schema, including its version, that this event adheres to.",
+          "description": "The schema, including its version, that this event adheres to. E.g. 'urn:cps:org.onap.cps:data-updated-event-schema:v99'.",
           "type": "string",
-          "default": "urn:cps:org.onap.cps:data-updated-event-schema:1.1.0-SNAPSHOT",
-          "enum": ["urn:cps:org.onap.cps:data-updated-event-schema:1.1.0-SNAPSHOT"]
+          "format": "uri"
         },
         "id": {
           "description": "The unique id identifying the event for the specified source. Producer must ensure that source + id is unique for each distinct event.",
@@ -41,7 +40,7 @@
         "type",
         "content"
       ],
-      "additionalProperties": false
+      "additionalProperties": true
     },
 
     "Content": {
           "description": "The name of CPS Core anchor the data is attached to.",
           "type": "string"
         },
+        "operation": {
+          "description": "The operation on the data",
+          "type": "string",
+          "enum": ["CREATE", "UPDATE", "DELETE"]
+        },
         "data": {
           "$ref": "#/definitions/Data"
         }
       },
       "required": [
-        "timestamp",
+        "observedTimestamp",
         "dataspaceName",
         "schemaSetName",
-        "anchorName",
-        "data"
+        "anchorName"
       ],
-      "additionalProperties": false
+      "additionalProperties": true
     },
 
     "Data": {
@@ -85,4 +88,4 @@
 
   }
 
-}
\ No newline at end of file
+}