From 9ef9f2647fff5fc3b2af3531687a1b8205e6f965 Mon Sep 17 00:00:00 2001 From: Jose Manuel Cantera Date: Fri, 9 Nov 2018 10:33:52 +0100 Subject: [PATCH] Notification --- schema/Notification.json | 37 +++++++++++++++++++++++++++++++++++++ scripts/validate_schema.sh | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 schema/Notification.json diff --git a/schema/Notification.json b/schema/Notification.json new file mode 100644 index 0000000..4a84862 --- /dev/null +++ b/schema/Notification.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "https://uri.etsi.org/ngsi-ld/schema/Notification.json", + "title": "NGSI-LD Notification", + "description": "NGSI-LD Notification", + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "const": "Notification" + }, + "@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/Entity.json#" + }, + "minItems": 1 + } + }, + "required": [ + "id", + "type", + "notifiedAt", + "data" + ] +} diff --git a/scripts/validate_schema.sh b/scripts/validate_schema.sh index bb4fc2e..1483f51 100755 --- a/scripts/validate_schema.sh +++ b/scripts/validate_schema.sh @@ -7,3 +7,5 @@ ajv compile -s $SCHEMAS/Subscription.json -r $SCHEMAS/common.json -r $SCHEMAS/ge ajv compile -s $SCHEMAS/EntityTemporal.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json 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 -- GitLab