Loading schema/registrations/ContextSourceRegistration.json +84 −59 Original line number Diff line number Diff line Loading @@ -50,18 +50,10 @@ "format": "date-time" } } } }, "ContextSourceRegistrationFragment": { "type": "object", "properties": { "id": { "type": "string", "format": "uri" }, "type": { "type": "string", "const": "ContextSourceRegistration" }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" }, Loading Loading @@ -97,6 +89,33 @@ "endpoint": { "type": "string", "format": "uri" } }, "additionalProperties": { "type": [ "string", "number", "boolean", "array", "object" ] } }, "ContextSourceRegistration": { "allOf": [ { "$ref": "#/definitions/ContextSourceRegistrationFragment" }, { "type": "object", "properties": { "id": { "type": "string", "format": "uri" }, "type": { "type": "string", "const": "ContextSourceRegistration" }, "createdAt": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" Loading @@ -105,9 +124,6 @@ "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" } }, "additionalProperties": { "type": ["string", "number", "boolean", "array", "object"] }, "required": [ "id", "type", Loading @@ -115,3 +131,12 @@ "information" ] } ] } }, "allOf": [ { "$ref": "#/definitions/ContextSourceRegistration" } ] } No newline at end of file schema/registrations/ContextSourceRegistrationList.json 0 → 100644 +17 −0 Original line number Diff line number Diff line { "$schema": "http://json-schema.org/schema#", "id": "https://uri.etsi.org/ngsi-ld/schema/ContextSourceRegistrationList.json", "title": "NGSI-LD Registration List", "description": "NGSI-LD Registration List", "definitions": { "ContextSourceRegistrationList": { "type": "array", "items": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json#/definitions/ContextSourceRegistration" } } }, "allOf": [{ "$ref": "#/definitions/ContextSourceRegistrationList" }] } scripts/validate_schema.sh +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ ajv compile -s $SCHEMAS/EntityList.json -r $SCHEMAS/common.json -r $SCHEMAS/geom ajv compile -s $SCHEMAS/subscriptions/SubscriptionList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/subscriptions/Subscription.json ajv compile -s $SCHEMAS/registrations/ContextSourceRegistrationList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/registrations/ContextSourceRegistration.json ajv compile -s $SCHEMAS/temporal/EntityTemporalList.json -r $SCHEMAS/temporal/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 Loading spec/updated/csource-registrations-spec.json 0 → 100644 +90 −0 Original line number Diff line number Diff line { "openapi": "3.0.1", "info": { "title": "NGSI-LD Registrations", "version": "latest" }, "components": { "parameters": { } }, "paths": { "/csourceRegistrations/": { "get": { "description": "Retrieve a set of context sources which matches a specific query from an NGSI-LD system", "operationId": "queryCsources", "parameters": [ { "$ref": "#/components/parameters/limit" } ], "responses": { "200": { "description": "OK", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistrationList.json#/definitions/ContextSourceRegistrationList" }, "examples": { "simple": { "externalValue": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/examples/ContextSourceRegistrationList-example.json" } } } } }, "400": { "description": "Bad request", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" } } } } } }, "post": { "description": "Registers a new context source within an NGSI-LD system", "operationId": "registerCsource", "requestBody": { "required": true, "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json#/definitions/ContextSourceRegistration" } } } }, "responses": { "201": { "description": "Created. Contains the resource URI of the created Registration" }, "400": { "description": "Bad request", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" } } } }, "409": { "description": "Already exists", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" } } } } } } } } } Loading
schema/registrations/ContextSourceRegistration.json +84 −59 Original line number Diff line number Diff line Loading @@ -50,18 +50,10 @@ "format": "date-time" } } } }, "ContextSourceRegistrationFragment": { "type": "object", "properties": { "id": { "type": "string", "format": "uri" }, "type": { "type": "string", "const": "ContextSourceRegistration" }, "@context": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" }, Loading Loading @@ -97,6 +89,33 @@ "endpoint": { "type": "string", "format": "uri" } }, "additionalProperties": { "type": [ "string", "number", "boolean", "array", "object" ] } }, "ContextSourceRegistration": { "allOf": [ { "$ref": "#/definitions/ContextSourceRegistrationFragment" }, { "type": "object", "properties": { "id": { "type": "string", "format": "uri" }, "type": { "type": "string", "const": "ContextSourceRegistration" }, "createdAt": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" Loading @@ -105,9 +124,6 @@ "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" } }, "additionalProperties": { "type": ["string", "number", "boolean", "array", "object"] }, "required": [ "id", "type", Loading @@ -115,3 +131,12 @@ "information" ] } ] } }, "allOf": [ { "$ref": "#/definitions/ContextSourceRegistration" } ] } No newline at end of file
schema/registrations/ContextSourceRegistrationList.json 0 → 100644 +17 −0 Original line number Diff line number Diff line { "$schema": "http://json-schema.org/schema#", "id": "https://uri.etsi.org/ngsi-ld/schema/ContextSourceRegistrationList.json", "title": "NGSI-LD Registration List", "description": "NGSI-LD Registration List", "definitions": { "ContextSourceRegistrationList": { "type": "array", "items": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json#/definitions/ContextSourceRegistration" } } }, "allOf": [{ "$ref": "#/definitions/ContextSourceRegistrationList" }] }
scripts/validate_schema.sh +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ ajv compile -s $SCHEMAS/EntityList.json -r $SCHEMAS/common.json -r $SCHEMAS/geom ajv compile -s $SCHEMAS/subscriptions/SubscriptionList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/subscriptions/Subscription.json ajv compile -s $SCHEMAS/registrations/ContextSourceRegistrationList.json -r $SCHEMAS/common.json -r $SCHEMAS/geometry-schema.json -r $SCHEMAS/registrations/ContextSourceRegistration.json ajv compile -s $SCHEMAS/temporal/EntityTemporalList.json -r $SCHEMAS/temporal/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 Loading
spec/updated/csource-registrations-spec.json 0 → 100644 +90 −0 Original line number Diff line number Diff line { "openapi": "3.0.1", "info": { "title": "NGSI-LD Registrations", "version": "latest" }, "components": { "parameters": { } }, "paths": { "/csourceRegistrations/": { "get": { "description": "Retrieve a set of context sources which matches a specific query from an NGSI-LD system", "operationId": "queryCsources", "parameters": [ { "$ref": "#/components/parameters/limit" } ], "responses": { "200": { "description": "OK", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistrationList.json#/definitions/ContextSourceRegistrationList" }, "examples": { "simple": { "externalValue": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/examples/ContextSourceRegistrationList-example.json" } } } } }, "400": { "description": "Bad request", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" } } } } } }, "post": { "description": "Registers a new context source within an NGSI-LD system", "operationId": "registerCsource", "requestBody": { "required": true, "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/registrations/ContextSourceRegistration.json#/definitions/ContextSourceRegistration" } } } }, "responses": { "201": { "description": "Created. Contains the resource URI of the created Registration" }, "400": { "description": "Bad request", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" } } } }, "409": { "description": "Already exists", "content": { "application/json;application/ld+json": { "schema": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/ProblemDetails" } } } } } } } } }