{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"title": "Configuration schema",
	"description": "IQRF Gateway InfluxDB Bridge configuration schema.",
	"type": "object",
	"examples": [
		{
			"influx": {
				"url": "http://127.0.0.1:8086",
				"org": "org",
				"user": "user",
				"password": "password",
				"token": "exampletoken",
				"buckets": {
					"gateway": "gateway",
					"devices": "devices",
					"sensors": "sensors"
				}
			},
			"mqtt": {
				"host": "localhost",
				"port": 1883,
				"user": "user",
				"password": "password",
				"client": "client",
				"topics": [
					"exampletopic"
				],
				"trustStore": ""
			},
			"logLevel": "INFO"
		}
	],
	"required": [
		"influx",
		"mqtt",
		"logLevel"
	],
	"additionalProperties": false,
	"properties": {
		"influx": {
			"$id": "#/properties/influx",
			"title": "InfluxDB",
			"description": "InfluxDB client configuration.",
			"type": "object",
			"required": [
				"url",
				"user",
				"password",
				"token",
				"buckets",
				"org"
			],
			"additionalProperties": false,
			"properties": {
				"url": {
					"$id": "#/properties/influx/properties/url",
					"title": "URL",
					"description": "InfluxDB server URL.",
					"type": "string",
					"minLength": 1
				},
				"user": {
					"$id": "#/properties/influx/properties/user",
					"title": "User",
					"description": "InfluxDB API authentication username (1.x).",
					"type": "string"
				},
				"password": {
					"$id": "#/properties/influx/properties/password",
					"title": "Password",
					"description": "InfluxDB API authentication password (1.x)."
				},
				"token": {
					"$id": "#/properties/influx/properties/token",
					"title": "API token",
					"description": "InfluxDB API authentication token (2.0).",
					"type": "string"
				},
				"org": {
					"$id": "#/properties/influx/properties/org",
					"title": "Organization",
					"description": "InfluxDB organization name.",
					"type": "string"
				},
				"buckets": {
					"$id": "#/properties/influx/properties/buckets",
					"title": "Buckets",
					"description": "InfluxDB buckets.",
					"type": "object",
					"required": [
						"gateway",
						"devices",
						"sensors"
					],
					"additionalProperties": false,
					"properties": {
						"gateway": {
							"$id": "#/properties/influx/properties/buckets/properties/gateway",
							"title": "Gateway bucket",
							"description": "Bucket for gateway data.",
							"type": "string"
						},
						"devices": {
							"$id": "#/properties/influx/properties/buckets/properties/devices",
							"title": "Device bucket",
							"description": "Bucket for device data.",
							"type": "string"
						},
						"sensors": {
							"$id": "#/properties/influx/properties/buckets/properties/sensors",
							"title": "Sensor bucket",
							"description": "Bucket for sensor data.",
							"type": "string"
						}
					}
				}
			}
		},
		"mqtt": {
			"$id": "#/properties/mqtt",
			"title": "MQTT",
			"description": "MQTT client configuration.",
			"type": "object",
			"required": [
				"host",
				"port",
				"user",
				"password",
				"topics",
				"trustStore"
			],
			"additionalProperties": false,
			"properties": {
				"host": {
					"$id": "#/properties/mqtt/properties/host",
					"title": "Host",
					"description": "MQTT broker hostname.",
					"type": "string"
				},
				"port": {
					"$id": "#/properties/mqtt/properties/port",
					"title": "Port",
					"description": "MQTT broker port.",
					"type": "integer"
				},
				"user": {
					"$id": "#/properties/mqtt/properties/user",
					"title": "User",
					"description": "MQTT broker access username.",
					"type": "string"
				},
				"password": {
					"$id": "#/properties/mqtt/properties/password",
					"title": "Password",
					"description": "MQTT broker access password.",
					"type": "string"
				},
				"client": {
					"$id": "#/properties/mqtt/properties/client",
					"title": "Client ID",
					"description": "MQTT client ID.",
					"type": "string"
				},
				"topics": {
					"$id": "#/properties/mqtt/properties/topics",
					"title": "Response topics",
					"description": "Array of topics to subscribe to.",
					"type": "array",
					"additionalItems": false,
					"items": {
						"$id": "#/properties/mqtt/properties/topics/items",
						"title": "Response topic",
						"description": "Response topic to subscribe to.",
						"type": "string"
					}
				},
				"trustStore": {
					"$id": "#/properties/mqtt/properties/trustStore",
					"title": "Broker CA",
					"description": "Path to server CA file.",
					"type": "string"
				}
			}
		},
		"logLevel": {
			"$id": "#/properties/logLevel",
			"title": "Logging severity",
			"description": "Logging threshold.",
			"type": "string",
			"enum": [
				"CRITICAL",
				"FATAL",
				"ERROR",
				"WARNING",
				"INFO",
				"DEBUG"
			]
		}
	}
}
