Commit 63e61804 authored by canterafonsj's avatar canterafonsj
Browse files

Refactoring schemas

parent 4a610861
...@@ -104,5 +104,51 @@ ...@@ -104,5 +104,51 @@
"required": [ "required": [
"type" "type"
] ]
},
"georel": {
"anyOf": [
{
"type": "string",
"enum": [
"equals",
"disjoint",
"intersects",
"within",
"contains",
"overlaps"
]
},
{
"type": "string",
"pattern": "^near;((maxDistance==\\d+)|(minDistance==\\d+))$"
}
]
},
"coordinates": {
"oneOf": [
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/position"
},
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/positionArray"
},
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/lineString"
},
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/polygon"
}
]
},
"geometry": {
"type": "string",
"enumeration": [
"Point",
"MultiPoint",
"LineString",
"MultiLineString",
"Polygon",
"MultiPolygon"
]
} }
} }
...@@ -59,50 +59,13 @@ ...@@ -59,50 +59,13 @@
], ],
"properties": { "properties": {
"georel": { "georel": {
"anyOf": [ "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/georel"
{
"type": "string",
"enum": [
"equals",
"disjoint",
"intersects",
"within",
"contains",
"overlaps"
]
},
{
"type": "string",
"pattern": "^near;((maxDistance==\\d+)|(minDistance==\\d+))$"
}
]
}, },
"coordinates": { "coordinates": {
"oneOf": [ "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/coordinates"
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/position"
},
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/positionArray"
},
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/lineString"
},
{
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/polygon"
}
]
}, },
"geometry": { "geometry": {
"type": "string", "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/geometry"
"enumeration": [
"Point",
"MultiPoint",
"LineString",
"MultiLineString",
"Polygon",
"MultiPolygon"
]
} }
} }
} }
......
...@@ -4,11 +4,144 @@ ...@@ -4,11 +4,144 @@
"title": "NGSI-LD Entities", "title": "NGSI-LD Entities",
"version": "latest" "version": "latest"
}, },
"components": {
"parameters": {
"id": {
"name": "id",
"description": "Comma separated list of URIs to be retrieved",
"in": "query",
"required": false,
"schema": {
"type": "string",
"format": "uri"
}
},
"type": {
"name": "type",
"description": "Comma separated list of Entity type names to be retrieved",
"in": "query",
"required": false,
"schema": {
"type": "string",
"minLength": 1
}
},
"idPattern": {
"name": "idPattern",
"description": "Regular expression that must be matched by Entity ids",
"in": "query",
"required": false,
"schema": {
"type": "string",
"minLength": 1
}
},
"attrs": {
"name": "attrs",
"description": "Comma separated list of attribute names (properties or relationships) to be retrieved",
"in": "query",
"required": false,
"schema": {
"type": "string",
"minLength": 1
}
},
"q": {
"name": "q",
"description": "Query",
"in": "query",
"required": false,
"schema": {
"type": "string",
"minLength": 1
}
},
"georel": {
"name": "georel",
"description": "Geo-relationship",
"in": "query",
"required": false,
"schema": {
"$ref": ""
}
},
"geometry": {
"name": "geometry",
"description": "Geometry",
"in": "query",
"required": false,
"schema": {
"$ref": ""
}
},
"coordinates": {
"name": "coordinates",
"description": "Coordinates serialized as a string",
"in": "query",
"required": false,
"schema": {
"$ref": ""
}
},
"geoproperty": {
"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
}
},
"csf": {
"name": "csf",
"description": "Context Source Filter",
"in": "query",
"required": false,
"schema": {
"type": "string",
"minLength": 1
}
}
}
},
"paths": { "paths": {
"/entities/": { "/entities/": {
"get": { "get": {
"description": "Retrieve a set of entities which matches a specific query from an NGSI-LD system", "description": "Retrieve a set of entities which matches a specific query from an NGSI-LD system",
"operationId": "queryEntities", "operationId": "queryEntities",
"parameters": [
{
"$ref": "#/components/parameters/id"
},
{
"$ref": "#/components/parameters/idPattern"
},
{
"$ref": "#/components/parameters/type"
},
{
"$ref": "#/components/parameters/attrs"
},
{
"$ref": "#/components/parameters/q"
},
{
"$ref": "#/components/parameters/georel"
},
{
"$ref": "#/components/parameters/geometry"
},
{
"$ref": "#/components/parameters/coordinates"
},
{
"$ref": "#/components/parameters/geoproperty"
},
{
"$ref": "#/components/parameters/csf"
}
],
"responses": { "responses": {
"200": { "200": {
"description": "OK", "description": "OK",
......
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