diff --git a/schema/ContextSourceNotification.json b/schema/ContextSourceNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..cd289c23e05781f1ca6d73f10e009f5ff6f06e0b --- /dev/null +++ b/schema/ContextSourceNotification.json @@ -0,0 +1,51 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "https://uri.etsi.org/ngsi-ld/schema/ContextSourceNotification.json", + "title": "NGSI-LD Context Source Notification", + "description": "NGSI-LD Context Source Notification", + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "const": "ContextSourceNotification" + }, + "subscriptionId": { + "type": "string", + "format": "uri" + }, + "@context": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" + }, + "notifiedAt": { + "type": "string", + "format": "date-time" + }, + "data": { + "type": "array", + "items": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/ContextSourceRegistration.json#" + }, + "minItems": 1 + }, + "triggerReason": { + "type": "string", + "enum": [ + "newlyMatching", + "updated", + "noLongerMatching" + ] + } + }, + "required": [ + "id", + "type", + "subscriptionId", + "notifiedAt", + "data", + "triggerReason" + ] +} diff --git a/schema/ContextSourceRegistration.json b/schema/ContextSourceRegistration.json index c4161e6fe83db1114a15469ac66b807cf575ee3c..38379cd81809e071657c020656bfecf686b9bce1 100644 --- a/schema/ContextSourceRegistration.json +++ b/schema/ContextSourceRegistration.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/schema#", - "id": "https://uri.etsi.org/ngsi-ld/schema/ContextSourceRegistration.json", + "id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/ContextSourceRegistration.json", "title": "NGSI-LD Context Source Registration", "description": "NGSI-LD Context Source Registration", "definitions": { diff --git a/schema/Notification.json b/schema/Notification.json index 4a848620f2b4f6d0a155c8f97f9cad91145df2f4..d73ed76b283b63c36ca5922c5ef805163f159106 100644 --- a/schema/Notification.json +++ b/schema/Notification.json @@ -13,6 +13,10 @@ "type": "string", "const": "Notification" }, + "subscriptionId": { + "type": "string", + "format": "uri" + }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" }, diff --git a/scripts/validate_schema.sh b/scripts/validate_schema.sh index 1483f513a6ed8fa836fc66324119f13b6d754ecf..2f4cc973646677a4450c638b5107526bc2614a65 100755 --- a/scripts/validate_schema.sh +++ b/scripts/validate_schema.sh @@ -9,3 +9,6 @@ ajv compile -s $SCHEMAS/EntityTemporal.json -r $SCHEMAS/common.json -r $SCHEMAS/ ajv compile -s $SCHEMAS/ContextSourceRegistration.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json ajv compile -s $SCHEMAS/Notification.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json + +ajv compile -s $SCHEMAS/ContextSourceNotification.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/ContextSourceRegistration.json +