{
    "$schema": "http://json-schema.org/draft-04/schema",
    "title": "Schema for cocktail list",
    "definitions": {
        "details": {
            "description": "Detailed non-ingredient information about a cocktail",
            "type": "object",
            "properties": {
                "glassType": {
                    "type": "string",
                    "minLength": 1
                },
                "ice": {
                    "description": "Type of ice the drink is served with (if any). Ex: rocks, single cube, none",
                    "type": "string"
                },
                "color": {
                    "description": "Color of the drink. Used for creating drink images",
                    "type": "string"
                },
                "category": {
                    "type": "string",
                    "description": "Category of drink",
                    "enum": [
                        "Ancestrals",
                        "Sours",
                        "Spirit Forward",
                        "Duos and Trios",
                        "Champagne",
                        "Highball, Collins, Fizzes",
                        "Juleps and Smashes",
                        "Hot Drinks",
                        "Flips and Nogs",
                        "Layered Drinks and Shots",
                        "Tropical Drinks",
                        "Punch",
                        "Cobblers",
                        "Savory",
                        "Non-alcoholic",
                        "Orphans"
                    ]
                }
            },
            "required": [
                "glassType",
                "ice",
                "color",
                "category"
            ]
        },
        "drink-ingredient": {
            "description": "An ingredient in the drink. May be a liquid component or a garnish",
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name of the ingredient"
                },
                "quantity": {
                    "type": "number"
                },
                "type": {
                    "type": "string",
                    "description": "Type of ingredient, such as garnish or mixer"
                },
                "unit": {
                    "description": "Unit of measurment for the quantity. Can be null for unit measurements, such as a sugar cube",
                    "type": [
                        "string",
                        "null"
                    ],
                    "enum": [
                        "oz",
                        "mL",
                        "cL",
                        null
                    ]
                }
            },
            "required": [
                "name",
                "type",
                "quantity",
                "unit"
            ]
        }
    },
    "properties": {
        "drinks": {
            "description": "Details about a cocktail",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "UUID for the drink"
                    },
                    "default": {
                        "type": "boolean",
                        "description": "Indicates whether this drink was a default or user-added"
                    },
                    "name": {
                        "type": "string",
                        "description": "Name of the drink"
                    },
                    "dateCreated": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "hidden": {
                        "type": "boolean"
                    },
                    "favorite": {
                        "type": "boolean"
                    },
                    "details": {
                        "$ref": "#/definitions/details"
                    },
                    "ingredients": {
                        "type": "array",
                        "items": {
                            "$ref": "#/definitions/drink-ingredient"
                        }
                    },
                    "source": {
                        "type": "string",
                        "description": "Source of the recipe"
                    },
                    "steps": {
                        "type": "string",
                        "description": "Instructions to make the drink"
                    }
                },
                "required": [
                    "id",
                    "default",
                    "name",
                    "hidden",
                    "favorite",
                    "details",
                    "ingredients",
                    "steps"
                ]
            }
        }
    }
}