diff --git a/spec/updated/entities-spec.json b/spec/updated/entities-spec.json index 836905b49f77b2b3ae2a06b94a9e0d103ef69afb..6adf2ca4d11a8aa184394d398bfdf7e3486e13f8 100644 --- a/spec/updated/entities-spec.json +++ b/spec/updated/entities-spec.json @@ -112,6 +112,16 @@ "type": "integer", "minimum": 1 } + }, + "options":{ + "name": "options", + "description": "Options dictionary", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": ["keyValues", "sysAttrs"] + } } } }, @@ -153,6 +163,9 @@ }, { "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/options" } ], "responses": { @@ -161,7 +174,7 @@ "content": { "application/json;application/ld+json": { "schema": { - "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/EntityList.json#" + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/EntityList.json#/definitions/EntityList" }, "examples": { "simple": { diff --git a/spec/updated/entity-by-id-spec.json b/spec/updated/entity-by-id-spec.json index 357f8d0b9d702e1107b9a00026fc842966c2eb7c..b31a79f530e61a5ea07afe2a00f34ae55259632f 100644 --- a/spec/updated/entity-by-id-spec.json +++ b/spec/updated/entity-by-id-spec.json @@ -51,6 +51,9 @@ }, { "$ref": "#/components/parameters/type" + }, + { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/entities-spec.json#/components/parameters/options" } ], "responses": { @@ -59,7 +62,7 @@ "content": { "application/json;application/ld+json": { "schema": { - "$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#/definitions/Entity" }, "examples": { "simple": { diff --git a/spec/updated/full_api.json b/spec/updated/full_api.json new file mode 100644 index 0000000000000000000000000000000000000000..577132f2cbb0423981c67c2a63c0f8f35dc546b2 --- /dev/null +++ b/spec/updated/full_api.json @@ -0,0 +1,1048 @@ +{ + "openapi": "3.0.1", + "info": { + "description": "This OAS file describes the NGSI-LD API defined by the ETSI ISG CIM group. This Cross-domain Context Information Management API allows to provide, consume and subscribe to context information in multiple scenarios and involving multiple stakeholders", + "version": "latest", + "title": "ETSI ISG CIM / NGSI-LD API", + "contact": { + "email": "NGSI-LD@etsi.org" + } + }, + "externalDocs": { + "description": "Find out more about the ETSI ISG Context Information Management", + "url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854" + }, + "tags": [ + { + "name": "ETSI", + "description": "European Telecommunications Standards Institute", + "externalDocs": { + "description": "Find out more", + "url": "http://www.etsi.org" + } + }, + { + "name": "CIM", + "description": "Context Information Management", + "externalDocs": { + "description": "Find out more", + "url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854" + } + }, + { + "name": "JSON-LD", + "description": "JSON for Linking Data", + "externalDocs": { + "description": "Find out more", + "url": "https://json-ld.org/" + } + }, + { + "name": "NGSI-LD API", + "description": "API defined by the ETSI ISG CIM", + "externalDocs": { + "description": "Find out more", + "url": "http://www.etsi.org/deliver/etsi_gs/CIM/001_099/004/01.01.01_60/gs_CIM004v010101p.pdf" + } + } + ], + "paths": { + "/entities/": { + "get": { + "description": "Retrieve a set of entities which matches a specific query from an NGSI-LD system", + "operationId": "queryEntities", + "parameters": [ + { + "name": "id", + "description": "Comma separated list of URIs to be retrieved", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "uri" + } + }, + { + "name": "idPattern", + "description": "Regular expression that must be matched by Entity ids", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "regexp" + } + }, + { + "name": "type", + "description": "Comma separated list of Entity type names to be retrieved", + "in": "query", + "required": false, + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "name": "attrs", + "description": "Comma separated list of attribute names (properties or relationships) to be retrieved", + "in": "query", + "required": false, + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "name": "q", + "description": "Query", + "in": "query", + "required": false, + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "name": "georel", + "description": "Geo-relationship", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "enum": [ + "equals", + "disjoint", + "intersects", + "within", + "contains", + "overlaps" + ] + }, + { + "type": "string", + "pattern": "^near;((maxDistance==\\d+)|(minDistance==\\d+))$" + } + ] + } + }, + { + "name": "geometry", + "description": "Geometry", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enumeration": [ + "Point", + "MultiPoint", + "LineString", + "MultiLineString", + "Polygon", + "MultiPolygon" + ] + } + }, + { + "name": "coordinates", + "description": "Coordinates serialized as a string", + "in": "query", + "required": false, + "schema": { + "oneOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/position" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/positionArray" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/lineString" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/polygon" + } + ] + } + }, + { + "name": "geoproperty", + "description": "The name of the property that contains the geo-spatial data that will be used to resolve the geoquery", + "in": "query", + "required": false, + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "name": "csf", + "description": "Context Source Filter", + "in": "query", + "required": false, + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "name": "limit", + "description": "Pagination limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1 + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json;application/ld+json": { + "schema": { + "$schema": "http://json-schema.org/schema#", + "id": "https://uri.etsi.org/ngsi-ld/schema/EntityList.json", + "title": "NGSI-LD EntityList", + "description": "NGSI-LD EntityList", + "definitions": { + "EntityList": { + "type": "array", + "items": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Entity" + } + } + }, + "allOf": [ + { + "$ref": "#/paths/~1entities~1/get/responses/200/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/EntityList" + } + ] + }, + "examples": { + "simple": { + "externalValue": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/examples/EntityList-example.json" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json;application/ld+json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "detail": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + } + } + } + } + }, + "post": { + "description": "Create a new Entity within an NGSI-LD system", + "operationId": "createEntity", + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Entity" + } + } + } + }, + "responses": { + "201": { + "description": "Created. Contains the resource URI of the created Entity" + }, + "400": { + "description": "Bad request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "409": { + "description": "Already exists", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "422": { + "description": "Unprocessable Entity", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + } + }, + "/entities/{entityId}": { + "get": { + "description": "Retrieve an specific Entity from an NGSI-LD system. It's possible to specify the Entity attributes to be retrieved by using query parameters", + "operationId": "retrieveEntityById", + "parameters": [ + { + "name": "entityId", + "description": "Entity Id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + }, + { + "name": "attrs", + "description": "Comma separated list of attribute names (properties or relationships) to be retrieved", + "in": "query", + "required": false, + "schema": { + "type": "string", + "minLength": 1 + } + }, + { + "name": "type", + "description": "Entity Type", + "in": "query", + "required": false, + "schema": { + "type": "string", + "pattern": "^(\\d|[a-zA-Z]|_)+$", + "minLength": 1, + "description": "NGSI-LD Name" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema" + }, + "examples": { + "simple": { + "externalValue": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/examples/Entity-example.json" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + }, + "delete": { + "description": "Removes an specific Entity from an NGSI-LD system", + "operationId": "removeEntityById", + "parameters": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D/get/parameters/0" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D/get/parameters/2" + } + ], + "responses": { + "204": { + "description": "No Content. The entity was removed successfully" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + } + }, + "/entities/{entityId}/attrs/": { + "post": { + "description": "Append new Entity attributes to an existing Entity within an NGSI-LD system", + "operationId": "appendEntityAttrs", + "parameters": [ + { + "name": "entityId", + "description": "Entity Id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uri" + } + }, + { + "name": "options", + "description": "Indicates that no attribute overwrite shall be performed", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "noOverwrite" + ] + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$schema": "http://json-schema.org/schema#", + "id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/Entity.json", + "title": "NGSI-LD Entity", + "description": "NGSI-LD Entity", + "definitions": { + "datasetId": { + "type": "string", + "format": "uri" + }, + "instanceId": { + "type": "string", + "format": "uri" + }, + "Property": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Property" + }, + "value": { + "type": [ + "string", + "number", + "boolean", + "array", + "object" + ] + }, + "observedAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "$ref": "#/paths/~1entities~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/properties/createdAt" + }, + "modifiedAt": { + "$ref": "#/paths/~1entities~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/properties/modifiedAt" + }, + "datasetId": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/datasetId" + }, + "instanceId": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/instanceId" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Property" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Relationship" + } + ] + } + }, + "Relationship": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "Relationship" + }, + "object": { + "type": "string", + "format": "uri" + }, + "observedAt": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Property/properties/observedAt" + }, + "createdAt": { + "$ref": "#/paths/~1entities~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/properties/createdAt" + }, + "modifiedAt": { + "$ref": "#/paths/~1entities~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/properties/modifiedAt" + }, + "datasetId": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/datasetId" + }, + "instanceId": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/instanceId" + } + }, + "required": [ + "type", + "object" + ], + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Property" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Relationship" + } + ] + } + }, + "GeoProperty": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "GeoProperty" + }, + "value": { + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json", + "title": "geometry", + "description": "One geometry as defined by GeoJSON. Licensed as per original source is https://github.com/fge/sample-json-schemas/blob/master/geojson/geometry.json", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "oneOf": [ + { + "title": "Point", + "properties": { + "type": { + "enum": [ + "Point" + ] + }, + "coordinates": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/position" + } + } + }, + { + "title": "MultiPoint", + "properties": { + "type": { + "enum": [ + "MultiPoint" + ] + }, + "coordinates": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/positionArray" + } + } + }, + { + "title": "LineString", + "properties": { + "type": { + "enum": [ + "LineString" + ] + }, + "coordinates": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/lineString" + } + } + }, + { + "title": "MultiLineString", + "properties": { + "type": { + "enum": [ + "MultiLineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/lineString" + } + } + } + }, + { + "title": "Polygon", + "properties": { + "type": { + "enum": [ + "Polygon" + ] + }, + "coordinates": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/polygon" + } + } + }, + { + "title": "MultiPolygon", + "properties": { + "type": { + "enum": [ + "MultiPolygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/polygon" + } + } + } + } + ], + "definitions": { + "position": { + "description": "A single position", + "type": "array", + "minItems": 2, + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "additionalItems": false + }, + "positionArray": { + "description": "An array of positions", + "type": "array", + "items": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/position" + } + }, + "lineString": { + "description": "An array of two or more positions", + "allOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/positionArray" + }, + { + "minItems": 2 + } + ] + }, + "linearRing": { + "description": "An array of four positions where the first equals the last", + "allOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/positionArray" + }, + { + "minItems": 4 + } + ] + }, + "polygon": { + "description": "An array of linear rings", + "type": "array", + "items": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty/properties/value/definitions/linearRing" + } + } + } + }, + "observedAt": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Property/properties/observedAt" + }, + "createdAt": { + "$ref": "#/paths/~1entities~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/properties/createdAt" + }, + "modifiedAt": { + "$ref": "#/paths/~1entities~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/properties/modifiedAt" + }, + "datasetId": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/datasetId" + }, + "instanceId": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/instanceId" + } + }, + "required": [ + "type", + "value" + ], + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Property" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Relationship" + } + ] + } + }, + "Entity": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "type": { + "$ref": "#/paths/~1entities~1%7BentityId%7D/get/parameters/2/schema" + }, + "@context": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "string", + "format": "uri" + }, + { + "type": "array", + "minItems": 1, + "items": { + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "location": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty" + }, + "observationSpace": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty" + }, + "operationSpace": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "modifiedAt": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "type" + ], + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Property" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Relationship" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/GeoProperty" + } + ] + }, + "propertyNames": { + "type": "string", + "pattern": "^((\\d|[a-zA-Z]|_)+(#\\d+)?)$|^(@context)$" + } + } + }, + "allOf": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/Entity" + } + ] + } + } + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "207": { + "description": "Partial Success. Only the attributes included in the response payload were successfully appended", + "content": { + "application/json;application/ld+json": { + "schema": { + "$schema": "http://json-schema.org/schema#", + "id": "https://uri.etsi.org/ngsi-ld/schema/UpdateResult.json", + "title": "NGSI-LD Update Result", + "description": "NGSI-LD Update Result", + "definitions": { + "UnchangedDetails": { + "attributeName": { + "type": "string", + "pattern": "" + }, + "reason": { + "type": "string", + "minLenght": 1 + } + } + }, + "type": "object", + "properties": { + "updated": { + "type": "array", + "items": { + "type": "string", + "pattern": "" + } + }, + "unchanged": { + "type": "array", + "items": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/responses/207/content/application~1json%3Bapplication~1ld%2Bjson/schema/definitions/UnchangedDetails" + } + } + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + }, + "patch": { + "description": "Update existing Entity attributes within an NGSI-LD system", + "operationId": "updateEntityAttrs", + "parameters": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/parameters/0" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "responses": { + "204": { + "description": "No Content." + }, + "207": { + "description": "Partial Success. Only the attributes included in the response payload were successfully updated", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/responses/207/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + } + }, + "/entities/{entityId}/attrs/{attrId}": { + "patch": { + "description": "Update existing Entity attributes within an NGSI-LD system", + "operationId": "partialAttrUpdate", + "parameters": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/parameters/0" + }, + { + "name": "attrId", + "description": "Attribute Id", + "in": "path", + "required": true, + "schema": { + "$ref": "#/paths/~1entities~1%7BentityId%7D/get/parameters/2/schema" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/requestBody/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "responses": { + "204": { + "description": "No Content." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + }, + "delete": { + "description": "Removes an existing Entity attribute within an NGSI-LD system", + "operationId": "removeEntityAttr", + "parameters": [ + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1/post/parameters/0" + }, + { + "$ref": "#/paths/~1entities~1%7BentityId%7D~1attrs~1%7BattrId%7D/patch/parameters/1" + } + ], + "responses": { + "204": { + "description": "No Content." + }, + "400": { + "description": "Bad Request", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json;application/ld+json": { + "schema": { + "$ref": "#/paths/~1entities~1/get/responses/400/content/application~1json%3Bapplication~1ld%2Bjson/schema" + } + } + } + } + } + } + } + } +} + diff --git a/spec/updated/ngsi-ld-spec-open-api_test.json b/spec/updated/ngsi-ld-spec-open-api_test.json new file mode 100644 index 0000000000000000000000000000000000000000..de30d538352f2e0b6e167d41eca3fb1aeb0cec73 --- /dev/null +++ b/spec/updated/ngsi-ld-spec-open-api_test.json @@ -0,0 +1,60 @@ +{ + "openapi": "3.0.1", + "info": { + "description": "This OAS file describes the NGSI-LD API defined by the ETSI ISG CIM group. This Cross-domain Context Information Management API allows to provide, consume and subscribe to context information in multiple scenarios and involving multiple stakeholders", + "version": "latest", + "title": "ETSI ISG CIM / NGSI-LD API", + "contact": { + "email": "NGSI-LD@etsi.org" + } + }, + "externalDocs": { + "description": "Find out more about the ETSI ISG Context Information Management", + "url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854" + }, + "tags": [ + { + "name": "ETSI", + "description": "European Telecommunications Standards Institute", + "externalDocs": { + "description": "Find out more", + "url": "http://www.etsi.org" + } + },{ + "name": "CIM", + "description": "Context Information Management", + "externalDocs": { + "description": "Find out more", + "url": "https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854" + } + },{ + "name": "JSON-LD", + "description": "JSON for Linking Data", + "externalDocs": { + "description": "Find out more", + "url": "https://json-ld.org/" + } + },{ + "name": "NGSI-LD API", + "description": "API defined by the ETSI ISG CIM", + "externalDocs": { + "description": "Find out more", + "url": "http://www.etsi.org/deliver/etsi_gs/CIM/001_099/004/01.01.01_60/gs_CIM004v010101p.pdf" + } + } + ], + "paths": { + "/entities/": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/entities-spec.json#/paths/%2fentities%2f" + }, + "/entities/{entityId}": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/entity-by-id-spec.json#/paths/%2fentities%2f%7BentityId%7D" + }, + "/entities/{entityId}/attrs/": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/entity-attrs-spec.json#/paths/%2Fentities%2F%7BentityId%7D%2Fattrs%2F" + }, + "/entities/{entityId}/attrs/{attrId}": { + "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/spec/updated/entity-attrs-spec.json#/paths/%2Fentities%2F%7BentityId%7D%2Fattrs%2F%7BattrId%7D" + }, + } +}