Commit 4852d800 authored by canterafonsj's avatar canterafonsj
Browse files

Refining more and more. Now using RegExp for Names

parent f27a46e1
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "string" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
}, },
"uniqueItems": true "uniqueItems": true
}, },
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "string" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
}, },
"uniqueItems": true "uniqueItems": true
} }
......
...@@ -4,12 +4,6 @@ ...@@ -4,12 +4,6 @@
"title": "NGSI-LD Entity", "title": "NGSI-LD Entity",
"description": "NGSI-LD Entity", "description": "NGSI-LD Entity",
"definitions": { "definitions": {
"EntityType": {
"type": "string",
"pattern": "^(\\d|[a-zA-Z]|_)+$",
"minLength": 1,
"description": "NGSI Entity type"
},
"datasetId": { "datasetId": {
"type": "string", "type": "string",
"format": "uri" "format": "uri"
...@@ -150,7 +144,7 @@ ...@@ -150,7 +144,7 @@
"format": "uri" "format": "uri"
}, },
"type": { "type": {
"$ref": "#/definitions/EntityType" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
}, },
"@context": { "@context": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
......
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
"type": "array", "type": "array",
"items": { "items": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json#"
}, }
"minItems": 1
} }
{ {
"$schema": "http://json-schema.org/schema#", "$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", "title": "NGSI-LD Entity",
"description": "NGSI-LD Temporal Representation of an Entity", "description": "NGSI-LD Temporal Representation of an Entity",
"type": "object", "type": "object",
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"format": "uri" "format": "uri"
}, },
"type": { "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": { "@context": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
......
{
"$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#"
}
}
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"format": "uri" "format": "uri"
}, },
"type": { "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": { "@context": {
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext"
......
...@@ -142,8 +142,7 @@ ...@@ -142,8 +142,7 @@
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "string", "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name"
"minLength": 1
}, },
"uniqueItems": true "uniqueItems": true
}, },
......
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
"title": "NGSI-LD Common Definitions", "title": "NGSI-LD Common Definitions",
"description": "NGSI-LD Common", "description": "NGSI-LD Common",
"definitions": { "definitions": {
"Name": {
"type": "string",
"pattern": "^(\\d|[a-zA-Z]|_)+$",
"minLength": 1,
"description": "NGSI-LD Name"
},
"observedAt": { "observedAt": {
"type": "string", "type": "string",
"format": "date-time" "format": "date-time"
...@@ -69,8 +75,7 @@ ...@@ -69,8 +75,7 @@
"format": "uri" "format": "uri"
}, },
"type": { "type": {
"type": "string", "$ref": "#/definitions/Name"
"minLength": 1
}, },
"idPattern": { "idPattern": {
"type": "string", "type": "string",
......
...@@ -14,6 +14,8 @@ ajv compile -s $SCHEMAS/ContextSourceNotification.json -r $SCHEMAS/common.json - ...@@ -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/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/BatchOperationResult.json -r $SCHEMAS/common.json
ajv compile -s $SCHEMAS/UpdateResult.json ajv compile -s $SCHEMAS/UpdateResult.json
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment