{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Linestring",
    "description": "Linestring as defined by GeoJSON",
    "type": "object",
    "required": [
        "type",
        "coordinates"
    ],
    "properties": {
        "type": {
            "enum": [
                "LineString"
            ]
        },
        "coordinates": {
            "$ref": "#/definitions/lineString"
        }
    },
    "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": "#/definitions/position"
            }
        },
        "lineString": {
            "description": "An array of two or more positions",
            "allOf": [
                {
                    "$ref": "#/definitions/positionArray"
                },
                {
                    "minItems": 2
                }
            ]
        }
    }
}
