{
    "$schema": "http://json-schema.org/draft-04/schema",
    "definitions": {
        "crawlers": {
            "type": "object",
            "properties": {
                "twitter": {
                    "type": "object",
                    "properties": {
                        "enabled": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "enabled"
                    ]
                },
                "facebook": {
                    "type": "object",
                    "properties": {
                        "enabled": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "enabled"
                    ]
                }
            },
            "minProperties": 1
        },
        "db": {
            "type": "object",
            "properties": {
                "db_name": {
                    "type": "string"
                },
                "db_tables": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": {
                        "type": "object",
                        "properties": {},
                        "additionalProperties": {
                            "type": "string",
                            "enum": [
                                "BIT",
                                "BOOL",
                                "TINYINT",
                                "SMALLINT",
                                "MEDIUMINT",
                                "INT",
                                "BIGINT",
                                "FLOAT",
                                "DOUBLE",
                                "DECIMAL",
                                "CHAR",
                                "VARCHAR",
                                "TINYTEXT",
                                "TEXT",
                                "MEDIUMTEXT",
                                "LONGTEXT",
                                "BINARY",
                                "VARBINARY",
                                "TINYBLOB",
                                "BLOB",
                                "MEDIUMBLOB",
                                "LONGBLOB",
                                "ENUM",
                                "SET",
                                "DATE",
                                "TIME",
                                "DATETIME",
                                "YEAR",
                                "TIMESTAMP",
                                "JSON"
                            ]
                        },
                        "minProperties": 1
                    }
                }
            },
            "required": [
                "db_name",
                "db_tables"
            ]
        },
        "dbs": {
            "type": "object",
            "properties": {
                "dbs_addr": {
                    "anyOf": [
                        {
                            "type": "string",
                            "format": "hostname"
                        },
                        {
                            "type": "string",
                            "format": "ipv6"
                        },
                        {
                            "type": "string",
                            "format": "ipv4"
                        }
                    ]
                },
                "dbs_port": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                },
                "dbs_login": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                },
                "dbs_pass": {
                    "type": "string",
                    "minLength": 0
                },
                "dbs_unicode": {
                    "type": "boolean"
                },
                "dbs_charset": {
                    "type": "string",
                    "enum": [
                        "utf8",
                        "utf16"
                    ]
                }
            },
            "required": [
                "dbs_addr",
                "dbs_port",
                "dbs_login",
                "dbs_pass",
                "dbs_unicode",
                "dbs_charset"
            ]
        }
    },
    "type": "object",
    "properties": {
        "ntm-config": {
            "type": "object",
            "properties": {
                "crawlers": {
                    "$ref": "#/definitions/crawlers"
                },
                "db": {
                    "$ref": "#/definitions/db"
                },
                "dbs": {
                    "$ref": "#/definitions/dbs"
                }
            },
            "required": [
                "crawlers",
                "db",
                "dbs"
            ]
        }
    }
}