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

add type

parent 17b9fa6f
Pipeline #5830 passed with stage
...@@ -4,53 +4,98 @@ ...@@ -4,53 +4,98 @@
"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": [
"type",
"coordinates"
],
"oneOf": [ "oneOf": [
{ {
"title": "Point", "title": "Point",
"properties": { "properties": {
"type": { "enum": [ "Point" ] }, "type": {
"coordinates": { "$ref": "#/definitions/position" } "type": "string",
"enum": [
"Point"
]
},
"coordinates": {
"$ref": "#/definitions/position"
}
} }
}, },
{ {
"title": "MultiPoint", "title": "MultiPoint",
"properties": { "properties": {
"type": { "enum": [ "MultiPoint" ] }, "type": {
"coordinates": { "$ref": "#/definitions/positionArray" } "type": "string",
"enum": [
"MultiPoint"
]
},
"coordinates": {
"$ref": "#/definitions/positionArray"
}
} }
}, },
{ {
"title": "LineString", "title": "LineString",
"properties": { "properties": {
"type": { "enum": [ "LineString" ] }, "type": {
"coordinates": { "$ref": "#/definitions/lineString" } "type": "string",
"enum": [
"LineString"
]
},
"coordinates": {
"$ref": "#/definitions/lineString"
}
} }
}, },
{ {
"title": "MultiLineString", "title": "MultiLineString",
"properties": { "properties": {
"type": { "enum": [ "MultiLineString" ] }, "type": {
"type": "string",
"enum": [
"MultiLineString"
]
},
"coordinates": { "coordinates": {
"type": "array", "type": "array",
"items": { "$ref": "#/definitions/lineString" } "items": {
"$ref": "#/definitions/lineString"
}
} }
} }
}, },
{ {
"title": "Polygon", "title": "Polygon",
"properties": { "properties": {
"type": { "enum": [ "Polygon" ] }, "type": {
"coordinates": { "$ref": "#/definitions/polygon" } "type": "string",
"enum": [
"Polygon"
]
},
"coordinates": {
"$ref": "#/definitions/polygon"
}
} }
}, },
{ {
"title": "MultiPolygon", "title": "MultiPolygon",
"properties": { "properties": {
"type": { "enum": [ "MultiPolygon" ] }, "type": {
"type": "string",
"enum": [
"MultiPolygon"
]
},
"coordinates": { "coordinates": {
"type": "array", "type": "array",
"items": { "$ref": "#/definitions/polygon" } "items": {
"$ref": "#/definitions/polygon"
}
} }
} }
} }
...@@ -60,32 +105,51 @@ ...@@ -60,32 +105,51 @@
"description": "A single position", "description": "A single position",
"type": "array", "type": "array",
"minItems": 2, "minItems": 2,
"items": [ { "type": "number" }, { "type": "number" } ], "items": [
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": false "additionalItems": false
}, },
"positionArray": { "positionArray": {
"description": "An array of positions", "description": "An array of positions",
"type": "array", "type": "array",
"items": { "$ref": "#/definitions/position" } "items": {
"$ref": "#/definitions/position"
}
}, },
"lineString": { "lineString": {
"description": "An array of two or more positions", "description": "An array of two or more positions",
"allOf": [ "allOf": [
{ "$ref": "#/definitions/positionArray" }, {
{ "minItems": 2 } "$ref": "#/definitions/positionArray"
},
{
"minItems": 2
}
] ]
}, },
"linearRing": { "linearRing": {
"description": "An array of four positions where the first equals the last", "description": "An array of four positions where the first equals the last",
"allOf": [ "allOf": [
{ "$ref": "#/definitions/positionArray" }, {
{ "minItems": 4 } "$ref": "#/definitions/positionArray"
},
{
"minItems": 4
}
] ]
}, },
"polygon": { "polygon": {
"description": "An array of linear rings", "description": "An array of linear rings",
"type": "array", "type": "array",
"items": { "$ref": "#/definitions/linearRing" } "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