{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://apidocs.iqrf.org/openapi/iqrf-gateway-webapp/v2.7.0-rc3/schemas/installationCheck.json",
    "type": "object",
    "title": "Installation check",
    "required": [
        "allMigrationsExecuted",
        "board",
        "dependencies",
        "gwId",
        "phpModules"
    ],
    "properties": {
        "allMigrationsExecuted": {
            "type": "boolean",
            "title": "Have all the database migrations been executed?",
            "example": true
        },
        "board": {
            "type": "string",
            "title": "Board",
            "example": "MICRORISC s.r.o. IQD-GW04"
        },
        "dependencies": {
            "type": "array",
            "title": "Missing dependencies",
            "items": {
                "type": "object",
                "title": "Missing dependency info",
                "required": [
                    "command",
                    "critical",
                    "package",
                    "feature"
                ],
                "properties": {
                    "command": {
                        "type": "string",
                        "title": "Command name",
                        "example": "mender-connect"
                    },
                    "critical": {
                        "type": "boolean",
                        "title": "Is the dependency critical?",
                        "example": true
                    },
                    "package": {
                        "type": "string",
                        "title": "Package name",
                        "example": "mender-connect"
                    },
                    "feature": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "title": "Feature name",
                        "example": "mender"
                    }
                },
                "additionalProperties": false
            }
        },
        "hasUsers": {
            "type": "boolean",
            "title": "Has the webapp created users?",
            "example": true
        },
        "gwId": {
            "type": [
                "string",
                "null"
            ],
            "title": "IQRF Gateway ID",
            "example": "02424D1D2D2E7580"
        },
        "phpModules": {
            "type": "object",
            "title": "Webapp PHP modules check",
            "required": [
                "allExtensionsLoaded"
            ],
            "properties": {
                "allExtensionsLoaded": {
                    "type": "boolean",
                    "title": "Have all the required PHP extensions been loaded?",
                    "example": true
                },
                "missing": {
                    "type": "object",
                    "title": "Missing PHP extensions and packages that contain them",
                    "required": [
                        "extensions"
                    ],
                    "properties": {
                        "extensions": {
                            "type": "array",
                            "title": "Missing PHP extensions",
                            "items": {
                                "type": "string",
                                "title": "Missing PHP extension",
                                "example": "json"
                            }
                        },
                        "packages": {
                            "type": "array",
                            "title": "Packages containing missing extensions",
                            "items": {
                                "type": "string",
                                "title": "Package name",
                                "example": "php7.3-json"
                            }
                        }
                    },
                    "additionalProperties": false
                }
            },
            "additionalProperties": false
        },
        "sudo": {
            "type": "object",
            "title": "Webapp sudo check",
            "required": [
                "user",
                "exists",
                "userSudo"
            ],
            "properties": {
                "user": {
                    "type": "string",
                    "title": "User under which webapp runs",
                    "example": "www-data"
                },
                "exists": {
                    "type": "boolean",
                    "title": "Does sudo exist?",
                    "example": true
                },
                "userSudo": {
                    "type": "boolean",
                    "title": "Can webapp user execute commands with sudo?",
                    "example": true
                }
            },
            "additionalProperties": false
        }
    },
    "additionalProperties": false
}
