From 930df5bf7e40e0b24f9a017a19c54d37f40552a4 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 18 Nov 2020 17:31:10 +0100 Subject: [PATCH 1/2] feat: add definitions for unitCode --- schema/Entity.json | 3 +++ schema/common.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/schema/Entity.json b/schema/Entity.json index 2478215..cd0a674 100644 --- a/schema/Entity.json +++ b/schema/Entity.json @@ -26,6 +26,9 @@ "object" ] }, + "unitCode": { + "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/unitCode" + }, "observedAt": { "$ref": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt" }, diff --git a/schema/common.json b/schema/common.json index a3214d7..c4487f9 100644 --- a/schema/common.json +++ b/schema/common.json @@ -12,6 +12,9 @@ "type": "string", "pattern": "^((\\d|[a-zA-Z]|_)+(:(\\d|[a-zA-Z]|_)+)?(#\\d+)?)$|^(@context)$" }, + "unitCode": { + "type": "string" + }, "observedAt": { "type": "string", "format": "date-time" -- GitLab From a98bf36e804cb8e5320f377c314b282c957da054 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 24 Jan 2023 16:36:10 +0100 Subject: [PATCH 2/2] fix: update Entity.json to follow new JSON Schema spec for the oneOf attribute --- schema/Entity.json | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/schema/Entity.json b/schema/Entity.json index cd0a674..a1eee1d 100644 --- a/schema/Entity.json +++ b/schema/Entity.json @@ -19,11 +19,21 @@ }, "value": { "oneOf": [ - "string", - "number", - "boolean", - "array", - "object" + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array" + }, + { + "type": "object" + } ] }, "unitCode": { -- GitLab