{
    "$id": "https://dspk.diffscope.org/schema/1.0/singer-desc.schema.json",
    "$schema": "http://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
        "$version": {
            "const": "1.0",
            "description": "Format version"
        },
        "avatar": {
            "$ref": "core.schema.json#/$defs/multilingualText",
            "description": "Path to the singer avatar image"
        },
        "background": {
            "$ref": "core.schema.json#/$defs/multilingualText",
            "description": "Path to the singer background image"
        },
        "class": {
            "description": "Singer class name",
            "type": "string"
        },
        "configuration": {
            "description": "Singer-specific configuration. The schema for this field is defined by the singer class."
        },
        "demoAudio": {
            "oneOf": [
                {
                    "$ref": "core.schema.json#/$defs/multilingualText",
                    "description": "Path to a single demo audio file. Equivalent to an array with one object containing the `name` field of an empty string and the `path` field of the specified value."
                },
                {
                    "items": {
                        "additionalProperties": false,
                        "description": "Multiple demo audio files",
                        "properties": {
                            "name": {
                                "$ref": "core.schema.json#/$defs/multilingualText",
                                "description": "Demo audio name"
                            },
                            "path": {
                                "$ref": "core.schema.json#/$defs/multilingualText",
                                "description": "Path to the demo audio file. The path is relative to the singer description file."
                            }
                        },
                        "required": [
                            "name",
                            "path"
                        ],
                        "type": "object"
                    },
                    "type": "array"
                }
            ]
        },
        "id": {
            "$ref": "core.schema.json#/$defs/genericIdentifier",
            "description": "Singer identifier. Must be unique within the package."
        },
        "imports": {
            "items": {
                "oneOf": [
                    {
                        "$ref": "core.schema.json#/$defs/genericIdentifier",
                        "description": "Identifier of an inference from the same package. Equivalent to an object with only the `id` field specified and default values for other fields."
                    },
                    {
                        "additionalProperties": false,
                        "properties": {
                            "id": {
                                "$ref": "core.schema.json#/$defs/packageIdentifier",
                                "description": "Identifier of the package to import the inference from. Default to current package ID."
                            },
                            "inferenceId": {
                                "$ref": "core.schema.json#/$defs/genericIdentifier",
                                "description": "Identifier of the inference within the imported package"
                            },
                            "options": {
                                "description": "Options of the imported inference. The schema for this field is defined by the inference class."
                            },
                            "version": {
                                "$ref": "core.schema.json#/$defs/version",
                                "description": "Version of the package to import the inference from. If `package` is not specified, default to current package version, otherwise default to the latest version of the package required by the `dependency` field in the package description."
                            }
                        },
                        "required": [
                            "inferenceId"
                        ],
                        "type": "object"
                    }
                ]
            },
            "type": "array"
        },
        "level": {
            "description": "Singer API level",
            "type": "integer"
        },
        "name": {
            "$ref": "core.schema.json#/$defs/multilingualText",
            "description": "Singer name. Default to the singer identifier if not provided."
        }
    },
    "required": [
        "$version",
        "class",
        "id",
        "imports",
        "level"
    ],
    "title": "Singer Description Schema",
    "type": "object"
}