{
    "$id": "https://alwaysai.co/app-state-schema.json",
    "$schema": "https://json-schema.org/draft/2019-09/schema",
    "title": "app_state",
    "type": "object",
    "properties": {
        "appState": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "appDetails": {
                        "type": "object",
                        "properties": {
                            "projectId": {
                                "$ref": "https://alwaysai.co/common-schema.json#/$defs/projectId"
                            },
                            "version": {
                                "$ref": "https://alwaysai.co/common-schema.json#/$defs/appReleaseHash"
                            }
                        },
                        "required": ["projectId", "version"]
                    },
                    "services": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "state": {
                                    "enum": ["up", "stopped", "restarting"]
                                }
                            },
                            "required": ["name", "state"]
                        }
                    }
                },
                "required": ["appDetails", "services"]
            }
        }
    },
    "required": ["appState"]
}
