Commit 599a9ba3 authored by canterafonsj's avatar canterafonsj
Browse files

Fix common schema

parent 63e61804
{ {
"$schema": "http://json-schema.org/schema#", "$schema": "http://json-schema.org/schema#",
"id": "https://uri.etsi.org/ngsi-ld/schema/Subscription.json", "id": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json",
"title": "NGSI-LD Subscription", "title": "NGSI-LD Common Definitions",
"description": "NGSI-LD Subscription", "description": "NGSI-LD Common",
"definitions": { "definitions": {
"NotificationParams": { "Name": {
"type": "object", "type": "string",
"properties": { "pattern": "^(\\d|[a-zA-Z]|_)+$",
"attributes": { "minLength": 1,
"type": "array", "description": "NGSI-LD Name"
"minItems": 1, },
"items": { "observedAt": {
"type": "string", "type": "string",
"minLength": 1 "format": "date-time"
}, },
"uniqueItems": true "createdAt": {
}, "type": "string",
"format": { "format": "date-time"
"type": "string" },
}, "modifiedAt": {
"endpoint": { "type": "string",
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Endpoint" "format": "date-time"
}, },
"status": { "LdContext": {
"type": "string", "anyOf": [{
"enum": [ "type": "object"
"ok", },
"failed" {
] "type": "string",
}, "format": "uri"
"timesSent": { },
"type": "number", {
"minimum": 1 "type": "array",
}, "minItems": 1,
"lastNotification": { "items": {
"type": "string", "anyOf": [{
"format": "date-time" "type": "string",
}, "format": "uri"
"lastFailure": { },
"type": "string", {
"format": "date-time" "type": "object"
}, }
"lastSuccess": { ]
"type": "string", }
"format": "date-time" }
} ]
}, },
"required": [ "Endpoint": {
"endpoint" "type": "object",
] "required": [
}, "uri"
"GeoQuery": { ],
"type": "object", "properties": {
"required": [ "uri": {
"geometry", "type": "string",
"coordinates", "format": "uri"
"georel" },
], "accept": {
"properties": { "type": "string",
"georel": { "enum": [
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/georel" "application/json",
}, "application/ld+json"
"coordinates": { ]
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/coordinates" }
}, }
"geometry": { },
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/geometry" "EntityInfo": {
} "type": "object",
} "properties": {
} "id": {
}, "type": "string",
"type": "object", "format": "uri"
"properties": { },
"id": { "type": {
"type": "string", "$ref": "#/definitions/Name"
"format": "uri" },
}, "idPattern": {
"type": { "type": "string",
"type": "string", "format": "regex"
"const": "Subscription" }
}, },
"@context": { "required": [
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/LdContext" "type"
}, ]
"entities": { },
"type": "array", "ProblemDetails": {
"items": { "type": "object",
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/EntityInfo" "properties": {
}, "type": {
"minItems": 1 "type": "string",
}, "format": "uri"
"name": { },
"type": "string", "title": {
"minLength": 1 "type": "string"
}, },
"description": { "detail": {
"type": "string", "type": "string"
"minLength": 1 }
}, },
"notification": { "required": [
"$ref": "#/definitions/NotificationParams" "type"
}, ]
"watchedAttributes": { },
"type": "array", "georel": {
"minItems": 1, "anyOf": [{
"items": { "type": "string",
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/Name" "enum": [
}, "equals",
"uniqueItems": true "disjoint",
}, "intersects",
"timeInterval": { "within",
"type": "number", "contains",
"minimum": 0 "overlaps"
}, ]
"expires": { },
"type": "string", {
"format": "date-time" "type": "string",
}, "pattern": "^near;((maxDistance==\\d+)|(minDistance==\\d+))$"
"status": { }
"type": "string", ]
"enum": [ },
"active", "coordinates": {
"paused", "oneOf": [{
"expired" "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/position"
] },
}, {
"isActive": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/positionArray"
"type": "boolean" },
}, {
"throttling": { "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/lineString"
"type": "number", },
"minimum": 1 {
}, "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#/definitions/polygon"
"q": { }
"type": "string" ]
}, },
"geoQ": { "geometry": {
"$ref": "#/definitions/GeoQuery" "type": "string",
}, "enumeration": [
"csf": { "Point",
"type": "string" "MultiPoint",
} "LineString",
}, "MultiLineString",
"createdAt": { "Polygon",
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/createdAt" "MultiPolygon"
}, ]
"modifiedAt": { }
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/common.json#/definitions/modifiedAt" }
},
"allOf": [
{
"required": [
"id",
"type"
]
},
{
"anyOf": [
{
"required": [
"entities"
]
},
{
"required": [
"watchedAttributes"
]
}
]
}
]
} }
Supports Markdown
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