diff --git a/schema/ContextSourceRegistration.json b/schema/ContextSourceRegistration.json index 0b668bd0e4681c7e19d1a3700ae6c502df4397c3..84a570e61a8cb2b5c1d597f6325c4cf1fe2fc9ea 100644 --- a/schema/ContextSourceRegistration.json +++ b/schema/ContextSourceRegistration.json @@ -21,7 +21,7 @@ "type": "array", "minItems": 1, "items": { - "type": "string" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" }, "uniqueItems": true }, @@ -29,7 +29,7 @@ "type": "array", "minItems": 1, "items": { - "type": "string" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" }, "uniqueItems": true } diff --git a/schema/Entity.json b/schema/Entity.json index 621012434669a60247f45559021978a7bdbc2b34..c98fd98469f5f1dcf82dc2e4cb9144f07fa28726 100644 --- a/schema/Entity.json +++ b/schema/Entity.json @@ -4,12 +4,6 @@ "title": "NGSI-LD Entity", "description": "NGSI-LD Entity", "definitions": { - "EntityType": { - "type": "string", - "pattern": "^(\\d|[a-zA-Z]|_)+$", - "minLength": 1, - "description": "NGSI Entity type" - }, "datasetId": { "type": "string", "format": "uri" @@ -150,7 +144,7 @@ "format": "uri" }, "type": { - "$ref": "#/definitions/EntityType" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" diff --git a/schema/EntityList.json b/schema/EntityList.json index a9f54de195e998021a24c0ccb200180d30d455be..6c4ed683a80b3c62b1db3d13a256a43e5ace55af 100644 --- a/schema/EntityList.json +++ b/schema/EntityList.json @@ -6,6 +6,5 @@ "type": "array", "items": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#" - }, - "minItems": 1 + } } diff --git a/schema/EntityTemporal.json b/schema/EntityTemporal.json index b34b50c14ef426518b33fe6bad097ba4a0a4af39..526326bdc1417faa39859f8e0c9bb167538acb08 100644 --- a/schema/EntityTemporal.json +++ b/schema/EntityTemporal.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/schema#", - "id": "https://uri.etsi.org/ngsi-ld/schema/EntityTemporal.json", + "id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/EntityTemporal.json", "title": "NGSI-LD Entity", "description": "NGSI-LD Temporal Representation of an Entity", "type": "object", @@ -10,7 +10,7 @@ "format": "uri" }, "type": { - "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#/definitions/EntityType" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" diff --git a/schema/EntityTemporalList.json b/schema/EntityTemporalList.json new file mode 100644 index 0000000000000000000000000000000000000000..22b7de02a4f7f7c1a82dcb687ee90290b8d7996c --- /dev/null +++ b/schema/EntityTemporalList.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "https://uri.etsi.org/ngsi-ld/schema/EntityTemporalList.json", + "title": "NGSI-LD Entity", + "description": "NGSI-LD Temporal Representation List", + "type": "array", + "items": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/EntityTemporal.json#" + } +} diff --git a/schema/Entity_keyValues.json b/schema/Entity_keyValues.json index e207b586e2336715f1d6fd0269737c2b631c04e8..e78d348fa046df2192ee9917c8c0747ba9c7b1b1 100644 --- a/schema/Entity_keyValues.json +++ b/schema/Entity_keyValues.json @@ -10,7 +10,7 @@ "format": "uri" }, "type": { - "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#/definitions/EntityType" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" diff --git a/schema/Subscription.json b/schema/Subscription.json index 8bce8b53a99ac59019e250df14355318216864c7..eb1ee758836ad5edec91a988a29657c82bdfaacd 100644 --- a/schema/Subscription.json +++ b/schema/Subscription.json @@ -142,8 +142,7 @@ "type": "array", "minItems": 1, "items": { - "type": "string", - "minLength": 1 + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" }, "uniqueItems": true }, diff --git a/schema/common.json b/schema/common.json index 189327f17ebaa0cddcdfa70b7681b6ff537716aa..664fa1caa1b979885bef67060f3372464805323b 100644 --- a/schema/common.json +++ b/schema/common.json @@ -4,6 +4,12 @@ "title": "NGSI-LD Common Definitions", "description": "NGSI-LD Common", "definitions": { + "Name": { + "type": "string", + "pattern": "^(\\d|[a-zA-Z]|_)+$", + "minLength": 1, + "description": "NGSI-LD Name" + }, "observedAt": { "type": "string", "format": "date-time" @@ -69,8 +75,7 @@ "format": "uri" }, "type": { - "type": "string", - "minLength": 1 + "$ref": "#/definitions/Name" }, "idPattern": { "type": "string", diff --git a/scripts/validate_schema.sh b/scripts/validate_schema.sh index c41c8110da56bce937540566576161e1ede1bcb8..32517e633907e48af9f4bf22565b813ec1de05e4 100755 --- a/scripts/validate_schema.sh +++ b/scripts/validate_schema.sh @@ -14,6 +14,8 @@ ajv compile -s $SCHEMAS/ContextSourceNotification.json -r $SCHEMAS/common.json - ajv compile -s $SCHEMAS/EntityList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/Entity.json +ajv compile -s $SCHEMAS/EntityTemporalList.json -r $SCHEMAS/EntityTemporal.json -r $SCHEMAS/Entity.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json + ajv compile -s $SCHEMAS/BatchOperationResult.json -r $SCHEMAS/common.json ajv compile -s $SCHEMAS/UpdateResult.json