From 3d223c5e687607eaf90fc88db2da9cc4e15d67ae Mon Sep 17 00:00:00 2001 From: Jose Manuel Cantera Date: Wed, 7 Nov 2018 09:54:22 +0100 Subject: [PATCH] Getting even closer --- schema/Entity.json | 38 +++++++++++++++----------------------- schema/Subscription.json | 6 ++++++ schema/common.json | 26 +++++++++++++------------- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/schema/Entity.json b/schema/Entity.json index 64ae984..7711809 100644 --- a/schema/Entity.json +++ b/schema/Entity.json @@ -4,18 +4,6 @@ "title": "NGSI-LD Entity", "description": "NGSI-LD Entity", "definitions": { - "observedAt": { - "type": "string", - "format": "date-time" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "modifiedAt": { - "type": "string", - "format": "date-time" - }, "datasetId": { "type": "string", "format": "uri" @@ -35,13 +23,13 @@ "type": "any" }, "observedAt": { - "$ref": "#/definitions/observedAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt" }, "createdAt": { - "$ref": "#/definitions/createdAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" }, "modifiedAt": { - "$ref": "#/definitions/modifiedAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" }, "datasetId": { "$ref": "#/definitions/datasetId" @@ -77,13 +65,13 @@ "format": "uri" }, "observedAt": { - "$ref": "#/definitions/observedAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt" }, "createdAt": { - "$ref": "#/definitions/createdAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" }, "modifiedAt": { - "$ref": "#/definitions/modifiedAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" }, "datasetId": { "$ref": "#/definitions/datasetId" @@ -117,11 +105,14 @@ "value": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#" }, + "observedAt": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/observedAt" + }, "createdAt": { - "$ref": "#/definitions/createdAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" }, "modifiedAt": { - "$ref": "#/definitions/modifiedAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" }, "datasetId": { "$ref": "#/definitions/datasetId" @@ -154,7 +145,8 @@ }, "type": { "type": "string", - "description": "NGSI Entity type" + "description": "NGSI Entity type", + "minLength": 1 }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" @@ -169,10 +161,10 @@ "$ref": "#/definitions/GeoProperty" }, "createdAt": { - "$ref": "#/definitions/createdAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" }, "modifiedAt": { - "$ref": "#/definitions/modifiedAt" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" } }, "required": [ diff --git a/schema/Subscription.json b/schema/Subscription.json index 903ce45..b4762d4 100644 --- a/schema/Subscription.json +++ b/schema/Subscription.json @@ -174,6 +174,12 @@ "type": "string" } }, + "createdAt": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" + }, + "modifiedAt": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" + }, "required": [ "id", "type" diff --git a/schema/common.json b/schema/common.json index 30a2ccd..05e41db 100644 --- a/schema/common.json +++ b/schema/common.json @@ -4,6 +4,18 @@ "title": "NGSI-LD Common Definitions", "description": "NGSI-LD Common", "definitions": { + "observedAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "modifiedAt": { + "type": "string", + "format": "date-time" + }, "LdContext": { "anyOf": [ { @@ -30,19 +42,6 @@ } ] }, - "Dates": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "modifiedAt": { - "type": "string", - "format": "date-time" - } - } - }, "Endpoint": { "type": "object", "required": [ @@ -79,4 +78,5 @@ } } } + } } -- GitLab