From 3fc37d624196e71c3936c2d75816729619bdbd77 Mon Sep 17 00:00:00 2001 From: Jose Manuel Cantera Date: Tue, 13 Nov 2018 10:53:48 +0100 Subject: [PATCH] Batch Operation Result --- schema/BatchOperationResult.json | 33 ++++++++++++++++++++++++++++++++ schema/common.json | 22 ++++++++++++++++++++- scripts/validate_schema.sh | 1 + 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 schema/BatchOperationResult.json diff --git a/schema/BatchOperationResult.json b/schema/BatchOperationResult.json new file mode 100644 index 0000000..0cf9033 --- /dev/null +++ b/schema/BatchOperationResult.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "https://uri.etsi.org/ngsi-ld/schema/BatchOperationResult.json", + "title": "NGSI-LD Batch Operation Result", + "description": "NGSI-LD Batch Operation Result", + "definitions": { + "BatchEntityError": { + "entityId": { + "type": "string", + "format": "uri" + }, + "error": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" + } + } + }, + "type": "object", + "properties": { + "success": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, + "error": { + "type": "array", + "items": { + "$ref": "#/definitions/BatchEntityError" + } + } + } +} diff --git a/schema/common.json b/schema/common.json index 1f77b60..189327f 100644 --- a/schema/common.json +++ b/schema/common.json @@ -77,7 +77,27 @@ "format": "regex" } }, - "required": ["type"] + "required": [ + "type" + ] } + }, + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "detail": { + "type": "string" + } + }, + "required": [ + "type" + ] } } diff --git a/scripts/validate_schema.sh b/scripts/validate_schema.sh index 633b39f..65516df 100755 --- a/scripts/validate_schema.sh +++ b/scripts/validate_schema.sh @@ -14,3 +14,4 @@ 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/BatchOperationResult.json -r $SCHEMAS/common.json -- GitLab