{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "https://burrito.bible/schema/copyright.schema.json",
    "$$target": "copyright.schema.json",
    "title": "Copyright and License Information",
    "type": "object",
    "description": "Describes the copyright holders and license terms of the burrito.",
    "properties": {
        "licenses": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "object",
                "properties": {
                    "url": {
                        "$ref": "common.schema.json#/definitions/url"
                    },
                    "ingredient": {
                        "$ref": "common.schema.json#/definitions/path"
                    }
                },
                "oneOf": [
                    {
                        "required": ["url"]
                    },
                    {
                        "required": ["ingredient"]
                    }
                ],
                "additionalProperties": false
            },
            "description": "The licenses, which state under which terms the burrito may be used, can be specified either as URL or as path to an ingredient."
        },
        "publicDomain": {
            "type": "boolean",
            "description": "If set to true, the contents of this burrito are in the public domain."
        },
        "shortStatements": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "object",
                "properties": {
                    "statement": {
                        "type": "string",
                        "maxLength": 500
                    },
                    "lang": {
                        "$ref": "common.schema.json#/definitions/languageTag"
                    },
                    "mimetype": {
                        "$ref": "common.schema.json#/definitions/mimeType"
                    }
                },
                "required": ["statement"],
                "additionalProperties": false
            },
            "description": "A short statement to explain the copyright / license information to readers"
        }
    },
    "additionalProperties": false,
    "oneOf": [
        {
            "type": "object",
            "properties": {
                "publicDomain": {
                    "const": true
                }
            },
            "required": ["publicDomain"]
        },
        {
            "type": "object",
            "required": ["shortStatements"]
        },
        {
            "type": "object",
            "required": ["licenses"]
        }
    ]
}
