{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "poll_answer": {
            "type": "object",
            "description": "Poll answer object for both trivia and normal polls",
            "additionalProperties": false,
            "properties": {
                "id": {
                    "type": "integer"
                },
                "uuid": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "correct": {
                    "type": "boolean"
                },
                "un_enum": {
                    "enum": [
                        "apo",
                        "apolo",
                        "apolinares"
                    ]
                }
            },
            "required": [
                "id",
                "uuid",
                "title"
            ]
        },
        "image": {
            "type": "object",
            "properties": {
                "@type": {
                    "type": "string",
                    "enum": [
                        "image"
                    ]
                },
                "cloudinary_id": {
                    "type": "string"
                },
                "caption": {
                    "type": "string"
                },
                "height": {
                    "type": "integer"
                },
                "width": {
                    "type": "integer"
                },
                "original_format": {
                    "type": "string",
                    "enum": [
                        "jpg",
                        "gif",
                        "png",
                        "jpeg"
                    ]
                }
            },
            "required": [
                "@type",
                "cloudinary_id"
            ]
        }
    },
    "title": " Poll",
    "type": "object",
    "description": "Poll object for normal or trivia polls",
    "additionalProperties": false,
    "properties": {
        "@type": {
            "type": "string",
            "enum": [
                "poll"
            ]
        },
        "id": {
            "type": "integer"
        },
        "uuid": {
            "type": "string"
        },
        "@poll_type": {
            "type": "string",
            "enum": [
                "poll",
                "trivia"
            ]
        },
        "title": {
            "type": "string"
        },
        "image": {
            "$ref": "#/definitions/image"
        },
        "answers": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/poll_answer"
            }
        }
    },
    "required": [
        "@type",
        "id",
        "uuid",
        "@poll_type",
        "title",
        "answers"
    ]
}