{
    "$id": "https://schemas.3d.si.edu/voyager/meta.schema.json",
    "$schema": "http://json-schema.org/draft-07/schema#",

    "title": "Meta",
    "description": "Meta data for a scene or model item.",

    "definitions": {
        "image": {
            "$id": "image",
            "description": "Reference to a scene supplementing image",
            "type": "object",
            "properties": {
                "uri": {
                    "description": "Location of the image resource, absolute URL or path relative to this document",
                    "type": "string",
                    "minLength": 1
                },
                "quality": {
                    "type": "string",
                    "enum": [ "Thumb", "Low", "Medium", "High", "HDR" ]
                },
                "byteSize": {
                    "type": "integer",
                    "minimum": 1
                },
                "width": {
                    "type": "integer",
                    "minimum": 1
                },
                "height": {
                    "type": "integer",
                    "minimum": 1
                },
                "usage": {
                    "type": "string",
                    "enum": [ "Render", "Environment", "ARCode" ]
                }
            },
            "required": [
                "uri",
                "quality"
            ]
        },
        "article": {
            "$id": "#article",
            "description": "Reference to an external document (HTML)",
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "title": {
                    "description": "Short title.",
                    "type": "string"
                },
                "titles": {
                    "description": "Short title with language key.",
                    "type": "object"
                },
                "lead": {
                    "description": "Short lead text.",
                    "type": "string"
                },
                "leads": {
                    "description": "Short lead text with language key.",
                    "type": "object"
                },
                "tags": {
                    "description": "Array of tags, categorizing the article.",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "taglist": {
                    "description": "Array of tags, categorizing the annotation with language key.",
                    "type": "object"
                },
                "intros": {
                    "description": "Introductory splash screen text with language key.",
                    "type": "object"
                },
                "uri": {
                    "description": "Location of the article resource, absolute URL or path relative to this document",
                    "type": "string",
                    "minLength": 1
                },
                "uris": {
                    "description": "Location of the article resource, absolute URL or path relative to this document with language key",
                    "type": "object"
                },
                "mimeType": {
                    "description": "MIME type of the resource.",
                    "type": "string"
                },
                "thumbnailUri": {
                    "description": "Location of a thumbnail/preview image of the resource.",
                    "type": "string"
                }
            },
            "required": [
                "id"
            ],
            "additionalProperties": false
        },
        "audioclip": {
            "$id": "audioclip",
            "description": "Reference to an audio file",
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "name": {
                    "description": "Short name.",
                    "type": "string"
                },
                "uris": {
                    "description": "Location of the audio resource, absolute URL or path relative to this document with language key",
                    "type": "object"
                },
                "captionUris": {
                    "description": "Location of the caption resource, absolute URL or path relative to this document with language key",
                    "type": "object"
                },
                "durations": {
                    "description": "Length of the audio resource with language key",
                    "type": "object"
                }
            },
            "required": [
                "id",
                "uris"
            ]
        },
        "action": {
            "$id": "action",
            "description": "Reference to a Voyager action element",
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "minLength": 1
                },
                "type": {
                    "type": "string",
                    "enum": [ "PlayAnimation", "PlayAudio" ]
                },
                "trigger": {
                    "type": "string",
                    "enum": [ "OnClick", "OnLoad", "OnAnnotation" ]
                },
                "audioId": {
                    "type": "string",
                    "minLength": 1
                },
                "annotationId": {
                    "type": "string",
                    "minLength": 1
                },
                "animation": {
                    "type": "string",
                    "minLength": 1
                },
                "style": {
                    "type": "string",
                    "enum": [ "Single", "PingPong", "Loop" ]
                }
            },
            "required": [
                "id",
                "type",
                "trigger"
            ]
        }
    },

    "type": "object",
    "properties": {
        "collection": {
            "description": "Information retrieved from the collection record for the item.",
            "type": "object"
        },
        "process": {
            "description": "Information about how the item was processed.",
            "type": "object"
        },
        "images": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/image"
            },
            "minItems": 1
        },
        "articles": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/article"
            },
            "minItems": 1
        },
        "leadArticle": {
            "description": "Index of the main article. This is the default article displayed with the item.",
            "type": "integer",
            "minimum": 0
        },
        "audio": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/audioclip"
            },
            "minItems": 0
        },
        "actions": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/action"
            },
            "minItems": 0
        }
    },
    "additionalProperties": false
}