{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "https://chaosinitiative.com/cas/schemas/subsystems/assets.json",

    "title": "Asset Builder",
    "description": "Compiles specific types of Source engine assets in parallel.",
    "type": "object",
    "required": ["assets"],
    "properties": {
        "assets": {
            "type": "array",
            "title": "Assets",
            "description": "Array of asset build entries.",
            
            "items": { "$ref": "#/definitions/asset" }
        }
    },
    "definitions": {
        "asset": {
            "type": "object",
            "title": "Asset",
            "description": "An entry instructing which asset(s) to build.",
            
            "required": ["type", "files"],
            "properties": {
                "type": {
                    "type": "string",
                    "title": "Type",
                    "description": "The type of the asset."
                },
                "src": {
                    "type": "string",
                    "title": "Source Folder",
                    "description": "The asset source folder.",
                    
                    "default": "$(path.content)",
                    "examples": ["$(path.content)"]
                },
                "dest": {
                    "type": "string",
                    "title": "Destination Folder",
                    "description": "The asset destination folder. This is not applicable to some asset types.",
                    
                    "default": "$(path.game)",
                    "examples": ["$(path.game)"]
                },
                "files": {
                    "title": "Files",
                    "description": "A pattern or array of patterns describing what assets to build.",

                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": { "type": "string" }
                        }
                    ],

                    "examples": ["p2ce/resource/closecaption_*.txt"]
                },
                "options": {
                    "type": "object",
                    "title": "Options",
                    "description": "Options to pass to the driver.",
                    
                    "additionalProperties": true,
                    "examples": [{"foobar": 1234}]
                }
            }
        }
    }
}