Commit 0e59f0b6 authored by Stefan Wiedemann's avatar Stefan Wiedemann
Browse files

add type

parent 17b9fa6f
Pipeline #5830 passed with stage
{ {
"$schema": "http://json-schema.org/draft-04/schema#", "$schema": "http://json-schema.org/draft-04/schema#",
"$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json", "$id": "https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json",
"title": "geometry", "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", "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", "type": "object",
"required": [ "type", "coordinates" ], "required": [
"oneOf": [ "type",
{ "coordinates"
"title": "Point", ],
"properties": { "oneOf": [
"type": { "enum": [ "Point" ] }, {
"coordinates": { "$ref": "#/definitions/position" } "title": "Point",
} "properties": {
"type": {
"type": "string",
"enum": [
"Point"
]
}, },
{ "coordinates": {
"title": "MultiPoint", "$ref": "#/definitions/position"
"properties": { }
"type": { "enum": [ "MultiPoint" ] }, }
"coordinates": { "$ref": "#/definitions/positionArray" } },
} {
"title": "MultiPoint",
"properties": {
"type": {
"type": "string",
"enum": [
"MultiPoint"
]
}, },
{ "coordinates": {
"title": "LineString", "$ref": "#/definitions/positionArray"
"properties": { }
"type": { "enum": [ "LineString" ] }, }
"coordinates": { "$ref": "#/definitions/lineString" } },
} {
"title": "LineString",
"properties": {
"type": {
"type": "string",
"enum": [
"LineString"
]
}, },
{ "coordinates": {
"title": "MultiLineString", "$ref": "#/definitions/lineString"
"properties": { }
"type": { "enum": [ "MultiLineString" ] }, }
"coordinates": { },
"type": "array", {
"items": { "$ref": "#/definitions/lineString" } "title": "MultiLineString",
} "properties": {
} "type": {
"type": "string",
"enum": [
"MultiLineString"
]
}, },
{ "coordinates": {
"title": "Polygon", "type": "array",
"properties": { "items": {
"type": { "enum": [ "Polygon" ] }, "$ref": "#/definitions/lineString"
"coordinates": { "$ref": "#/definitions/polygon" } }
} }
}
},
{
"title": "Polygon",
"properties": {
"type": {
"type": "string",
"enum": [
"Polygon"
]
}, },
{ "coordinates": {
"title": "MultiPolygon", "$ref": "#/definitions/polygon"
"properties": {
"type": { "enum": [ "MultiPolygon" ] },
"coordinates": {
"type": "array",
"items": { "$ref": "#/definitions/polygon" }
}
}
} }
], }
"definitions": { },
"position": { {
"description": "A single position", "title": "MultiPolygon",
"type": "array", "properties": {
"minItems": 2, "type": {
"items": [ { "type": "number" }, { "type": "number" } ], "type": "string",
"additionalItems": false "enum": [
"MultiPolygon"
]
}, },
"positionArray": { "coordinates": {
"description": "An array of positions", "type": "array",
"type": "array", "items": {
"items": { "$ref": "#/definitions/position" } "$ref": "#/definitions/polygon"
}
}
}
}
],
"definitions": {
"position": {
"description": "A single position",
"type": "array",
"minItems": 2,
"items": [
{
"type": "number"
}, },
"lineString": { {
"description": "An array of two or more positions", "type": "number"
"allOf": [ }
{ "$ref": "#/definitions/positionArray" }, ],
{ "minItems": 2 } "additionalItems": false
] },
"positionArray": {
"description": "An array of positions",
"type": "array",
"items": {
"$ref": "#/definitions/position"
}
},
"lineString": {
"description": "An array of two or more positions",
"allOf": [
{
"$ref": "#/definitions/positionArray"
}, },
"linearRing": { {
"description": "An array of four positions where the first equals the last", "minItems": 2
"allOf": [ }
{ "$ref": "#/definitions/positionArray" }, ]
{ "minItems": 4 } },
] "linearRing": {
"description": "An array of four positions where the first equals the last",
"allOf": [
{
"$ref": "#/definitions/positionArray"
}, },
"polygon": { {
"description": "An array of linear rings", "minItems": 4
"type": "array",
"items": { "$ref": "#/definitions/linearRing" }
} }
]
},
"polygon": {
"description": "An array of linear rings",
"type": "array",
"items": {
"$ref": "#/definitions/linearRing"
}
} }
}
} }
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