{
    "$id": "https://poptracker.github.io/schema/packs/manifest.json",
    "title": "PopTracker Pack manifest",
    "description": "Manifest for a PopTracker pack.",
    "type": "object",
    "properties": {
        "name": {
            "description": "Readable name of the pack.",
            "type": "string"
        },
        "package_uid": {
            "description": "Unique id for the pack. Used for saves.",
            "type": "string"
        },
        "package_version": {
            "description": "Version of the pack.",
            "type": "string"
        },
        "platform": {
            "description": "Platform the pack is used for. If platform is \"snes\", the snes autotracker is to be enabled.",
            "type": "string"
        },
        "platform_override": {
            "description": "Platform the pack is used for. If specified, PopTracker will use this instead of the value indicated in the 'platform' field.",
            "type": "string"
        },
        "versions_url": {
            "description": "URL to versions.json of the pack. Can be used for automatic updates. Information from global packs.json takes precedence. See https://github.com/black-sliver/PopTracker/tree/packlist for more information.",
            "type": "string",
            "format": "uri"
        },
        "game_name": {
            "description": "Name of the game the pack targets.",
            "type": "string"
        },
        "author": {
            "description": "Author(s) of the pack.",
            "type": "string"
        },
        "min_poptracker_version": {
            "description": "Minimum version of PopTracker required for this pack to function. Format: x.y.z with .y and .z optional.",
            "type": "string",
            "pattern": "^(0|[1-9]+[0-9]*)(\\.(0|[1-9]+[0-9]*)(\\.(0|[1-9]+[0-9]*))?)?$"
        },
        "target_poptracker_version": {
            "description": "Which API version to target, latest if undefined. May enable backwards compatibility of APIs or behavior. This is useful to quickly fix a pack if an update breaks it or to not have it break in the first place.",
            "type": "string",
            "pattern": "^(0|[1-9]+[0-9]*)(\\.(0|[1-9]+[0-9]*)(\\.(0|[1-9]+[0-9]*))?)?$"
        },
        "variants": {
            "description": "Variants for the pack. Property keys are the pack variant uids.",
            "type": "object",
            "patternProperties": {
                "^$": {
                    "description": "A pack variant.",
                    "type": "object",
                    "properties": {
                        "display_name": {
                            "description": "Display name of the pack variant.",
                            "type": "string"
                        },
                        "flags": {
                            "description": "Flags for the packs.",
                            "type": "array",
                            "items": {
                                "description": "A flag.",
                                "type": "string"                                
                            }
                        }
                    },
                    "required": [
                        "display_name"
                    ]
                },
                "^.+$": {
                    "description": "A pack variant.",
                    "type": "object",
                    "properties": {
                        "display_name": {
                            "description": "Display name of the pack variant.",
                            "type": "string"
                        },
                        "flags": {
                            "description": "Flags for the packs.",
                            "type": "array",
                            "items": {
                                "description": "A flag.",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }, 
    "required": [
        "package_uid"
    ]
}