{
    "$ref": "#/definitions/feed",
    "definitions": {
        "all_feed": {
            "properties": {
                "type": {
                    "enum": [
                        "all",
                        null
                    ]
                }
            },
            "required": [
                "targets",
                "broadcast_interval"
            ],
            "type": "object"
        },
        "binary_feed": {
            "properties": {
                "broadcast_date": {
                    "format": "date-time",
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "binary",
                        null
                    ]
                }
            },
            "required": [
                "broadcast_date",
                "targets"
            ],
            "type": "object"
        },
        "cfd_feed": {
            "properties": {
                "broadcast_date": {
                    "format": "interval",
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "cfd",
                        null
                    ]
                }
            },
            "required": [
                "broadcast_date",
                "deadline"
            ],
            "type": "object"
        },
        "customs": {
            "patternProperties": {
                ".": {
                    "type": [
                        "string",
                        "number"
                    ]
                }
            },
            "type": "object"
        },
        "default_labels": {
            "allOf": [
                {
                    "additionalProperties": false,
                    "properties": {
                        "bear": {
                            "maxLength": 32,
                            "type": "string"
                        },
                        "bull": {
                            "maxLength": 32,
                            "type": "string"
                        },
                        "equal": {
                            "maxLength": 32,
                            "type": "string"
                        },
                        "not_equal": {
                            "maxLength": 32,
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                {
                    "anyOf": [
                        {
                            "properties": {
                                "equal": {
                                    "maxLength": 32,
                                    "type": "string"
                                },
                                "not_equal": {
                                    "maxLength": 32,
                                    "type": "string"
                                }
                            },
                            "required": [
                                "equal",
                                "not_equal"
                            ],
                            "type": "object"
                        },
                        {
                            "properties": {
                                "bear": {
                                    "maxLength": 32,
                                    "type": "string"
                                },
                                "bull": {
                                    "maxLength": 32,
                                    "type": "string"
                                }
                            },
                            "required": [
                                "bear",
                                "bull"
                            ],
                            "type": "object"
                        }
                    ]
                }
            ]
        },
        "default_odds": {
            "oneOf": [
                {
                    "additionalProperties": false,
                    "properties": {
                        "initial": {
                            "type": "number"
                        }
                    },
                    "required": [
                        "initial"
                    ],
                    "type": "object"
                },
                {
                    "additionalProperties": false,
                    "properties": {
                        "suggested": {
                            "type": "number"
                        }
                    },
                    "required": [
                        "suggested"
                    ],
                    "type": "object"
                },
                {
                    "additionalProperties": false,
                    "properties": {
                        "initial": {
                            "type": "number"
                        },
                        "suggested": {
                            "type": "number"
                        }
                    },
                    "required": [
                        "initial",
                        "suggested"
                    ],
                    "type": "object"
                }
            ]
        },
        "feed": {
            "allOf": [
                {
                    "$ref": "#/definitions/feed_properties"
                },
                {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/binary_feed"
                        },
                        {
                            "$ref": "#/definitions/cfd_feed"
                        },
                        {
                            "$ref": "#/definitions/all_feed"
                        }
                    ]
                }
            ]
        },
        "feed_properties": {
            "additionalProperties": false,
            "properties": {
                "address": {
                    "type": "string"
                },
                "broadcast_date": {
                    "type": "string"
                },
                "category": {
                    "enum": [
                        "sports",
                        "politics",
                        "entertainment",
                        "economics",
                        "other"
                    ]
                },
                "customs": {
                    "$ref": "#/definitions/customs"
                },
                "deadline": {
                    "format": "interval",
                    "type": "string"
                },
                "description": {
                    "maxLength": 255,
                    "type": "string"
                },
                "image": {
                    "format": "uri",
                    "type": "string"
                },
                "labels": {
                    "$ref": "#/definitions/default_labels"
                },
                "odds": {
                    "$ref": "#/definitions/default_odds"
                },
                "operator": {
                    "$ref": "#/definitions/operator"
                },
                "targets": {
                    "$ref": "#/definitions/targets"
                },
                "title": {
                    "maxLength": 64,
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "binary",
                        "cfd",
                        "all"
                    ]
                },
                "url": {
                    "format": "uri",
                    "type": "string"
                },
                "version": {
                    "pattern": "^[0-9]+(\\.[0-9]+){1,2}$",
                    "type": "string"
                }
            },
            "required": [
                "address",
                "title"
            ],
            "type": "object"
        },
        "operator": {
            "additionalProperties": false,
            "properties": {
                "description": {
                    "maxLength": 255,
                    "type": "string"
                },
                "image": {
                    "format": "uri",
                    "type": "string"
                },
                "name": {
                    "maxLength": 64,
                    "type": "string"
                },
                "url": {
                    "format": "uri",
                    "type": "string"
                }
            },
            "required": [
                "name"
            ],
            "type": "object"
        },
        "target": {
            "additionalProperties": false,
            "properties": {
                "deadline": {
                    "format": "date-time",
                    "type": "string"
                },
                "image": {
                    "format": "uri",
                    "type": "string"
                },
                "labels": {
                    "$ref": "#/definitions/target_labels"
                },
                "odds": {
                    "$ref": "#/definitions/default_odds"
                },
                "text": {
                    "maxLength": 64,
                    "type": "string"
                },
                "value": {
                    "type": "number"
                }
            },
            "required": [
                "text",
                "value",
                "deadline"
            ],
            "type": "object"
        },
        "target_labels": {
            "additionalProperties": false,
            "properties": {
                "equal": {
                    "maxLength": 32,
                    "type": "string"
                },
                "not_equal": {
                    "maxLength": 32,
                    "type": "string"
                }
            },
            "required": [
                "equal",
                "not_equal"
            ],
            "type": "object"
        },
        "targets": {
            "items": {
                "$ref": "#/definitions/target"
            },
            "minItems": 1,
            "type": "array",
            "_uniqueItems": true
        }
    }
}