{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "array",
    "title": "Wangscape tilesets schema",
    "description": "Specifies the contents and locations of Wangscape output tilesets.",
    "items": {
        "title": "Tileset schema",
        "description": "Specifies the terrains, filename, resolution, and tile resolution of a Wangscape output tileset.",
        "type": "object",
        "properties": {
            "resolution": {
                "title": "Tile resolution schema",
                "description": "Specifies the resolution of tiles in the tileset.",
                "type": "array",
                "items": {
                    "type": "integer",
                    "minimum": 1
                },
                "minItems": 2,
                "maxItems": 2
            },
            "filename": {
                "title": "Tileset filename schema",
                "description": "Specifies the filename of the image containing the tileset.",
                "type": "string"
            },
            "x": {
                "title": "Tileset x resolution schema",
                "description": "Specifies the horizontal resolution of the whole tileset.",
                "type": "integer",
                "minimum": 1
            },
            "y": {
                "title": "Tileset y resolution schema",
                "description": "Specifies the vertical resolution of the whole tileset.",
                "type": "integer",
                "minimum": 1
            },
            "terrains": {
                "type": "array",
                "title": "Tileset terrains schema",
                "description": "Specifies the IDs of the terrain types used in the tileset.",
                "items": {
                    "title": "Terrain ID schema",
                    "description": "Specifies a terrain type.",
                    "type": "string",
                    "pattern": "^[0-9a-zA-Z_-]+$"
                },
                "minLength": 2
            }
        },
        "required": [
            "resolution",
            "filename",
            "x",
            "y",
            "terrains"
        ]
    }
}