{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"title": "Control Object Catalog",
	"description": "List of control object type definitions",
	"definitions": {
		"common": {
			"description": "common object properties",
			"type": "object",
			"properties": {
				"name": {
					"description": "unique type identifier",
					"type": "string",
					"minLength": 3
				},
				"description": {
					"description": "string describing the object",
					"type": "string"
				},
				"shape": {
					"description": "shape identifier",
					"type": "string",
					"enum": [
						"rectangle",
						"checkerboard2x2",
						"chevron",
						"circular_disk",
						"cylinder",
						"sphere",
						"round_corner_cube_prism"
					]
				},
				"surface_type": {
					"description": "surface material type",
					"type": "string",
					"enum": [
						"retro_reflective_foil",
						"diffuse"
					]
				}
			},
			"required": [
				"name",
				"shape"
			]
		},
		"rectangle": {
			"description": "rectangle",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "rectangle specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"type": "string",
							"enum": [
								"rectangle"
							]
						},
						"length": {
							"description": "length in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"width": {
							"description": "width in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"length",
						"width"
					]
				}
			]
		},
		"checkerboard2x2": {
			"description": "checkerboard 2 by 2",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "checkerboard specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"checkerboard2x2"
							]
						},
						"square_length": {
							"description": "length of a square of the checkerboard in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"square_length"
					]
				}
			]
		},
		"chevron": {
			"description": "chevron",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "chevron specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"chevron"
							]
						},
						"outside_edge_length": {
							"description": "length of the two outer edges in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"thickness": {
							"description": "thickness in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"outside_edge_length",
						"thickness"
					]
				}
			]
		},
		"circular_disk": {
			"description": "circular disk",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "circular disk specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"circular_disk"
							]
						},
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"offset": {
							"description": "offset in meters, e.g. reflector constant (optional)",
							"type": "number"
						}
					},
					"required": [
						"shape",
						"diameter"
					]
				}
			]
		},
		"cylinder": {
			"description": "cylinder",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "cylinder specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"cylinder"
							]
						},
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"height": {
							"description": "height in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"diameter",
						"height"
					]
				}
			]
		},
		"sphere": {
			"description": "sphere",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "sphere specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"sphere"
							]
						},
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						}
					},
					"required": [
						"shape",
						"diameter"
					]
				}
			]
		},
		"round_corner_cube_prism": {
			"description": "round corner cube prism",
			"type": "object",
			"allOf": [
				{
					"$ref": "#/definitions/common"
				},
				{
					"description": "round corner cube prism specific properties",
					"type": "object",
					"properties": {
						"shape": {
							"description": "shape identifier",
							"type": "string",
							"enum": [
								"round_corner_cube_prism"
							]
						},
						"diameter": {
							"description": "diameter in meters",
							"type": "number",
							"minimum": 0,
							"exclusiveMinimum": true
						},
						"offset": {
							"description": "offset in meters, e.g. reflector constant (optional)",
							"type": "number"
						}
					},
					"required": [
						"shape",
						"diameter"
					]
				}
			]
		}
	},
	"type": "object",
	"properties": {
		"types": {
			"type": "array",
			"items": {
				"type": "object",
				"oneOf": [
					{
						"$ref": "#/definitions/rectangle"
					},
					{
						"$ref": "#/definitions/checkerboard2x2"
					},
					{
						"$ref": "#/definitions/chevron"
					},
					{
						"$ref": "#/definitions/circular_disk"
					},
					{
						"$ref": "#/definitions/cylinder"
					},
					{
						"$ref": "#/definitions/sphere"
					},
					{
						"$ref": "#/definitions/round_corner_cube_prism"
					}
				]
			},
			"uniqueItems": true
		}
	},
	"required": [
		"types"
	]
}