{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "Pick<ViewNavigationGroup,\"title\"|\"hidden\"|\"child\"|\"defaultView\">": {
            "description": "From T, pick a set of properties whose keys are in the union K",
            "properties": {
                "child": {
                    "description": "Nested items for the group",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/ViewNavigationGroup"
                            },
                            {
                                "$ref": "#/definitions/ViewNavigationItem"
                            }
                        ]
                    },
                    "type": "array"
                },
                "defaultView": {
                    "description": "If specified this view will be default view for the group; if not, the first available view will be default view",
                    "type": "string"
                },
                "hidden": {
                    "description": "If true, the group will not be visible in navigation (but still accessible by direct link or drilldown)",
                    "type": "boolean"
                },
                "title": {
                    "description": "Displayed name for the grouup",
                    "type": "string"
                }
            },
            "required": [
                "child",
                "title"
            ],
            "type": "object"
        },
        "Pick<ViewNavigationItem,\"hidden\"|\"viewName\">": {
            "description": "From T, pick a set of properties whose keys are in the union K",
            "properties": {
                "hidden": {
                    "type": "boolean"
                },
                "viewName": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ViewNavigationGroup": {
            "description": "Description of groups in the navigation menu.\n\nUsed to create nesting levels of menu items.",
            "properties": {
                "child": {
                    "description": "Nested items for the group",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/ViewNavigationGroup"
                            },
                            {
                                "$ref": "#/definitions/ViewNavigationItem"
                            }
                        ]
                    },
                    "type": "array"
                },
                "defaultView": {
                    "description": "If specified this view will be default view for the group; if not, the first available view will be default view",
                    "type": "string"
                },
                "hidden": {
                    "description": "If true, the group will not be visible in navigation (but still accessible by direct link or drilldown)",
                    "type": "boolean"
                },
                "id": {
                    "description": "TODO identifier will be nullable and string-only in 2.0.0",
                    "type": [
                        "string",
                        "number"
                    ]
                },
                "title": {
                    "description": "Displayed name for the grouup",
                    "type": "string"
                }
            },
            "required": [
                "child",
                "title"
            ],
            "type": "object"
        },
        "ViewNavigationItem": {
            "description": "Description of the destination in the navigation menu.",
            "properties": {
                "hidden": {
                    "type": "boolean"
                },
                "id": {
                    "description": "TODO: remove in 2.0.0",
                    "type": "string"
                },
                "viewName": {
                    "type": "string"
                }
            },
            "type": "object"
        }
    },
    "description": "*.screen.json file format\n\nDescribes a screen",
    "properties": {
        "name": {
            "description": "Unique identifier for the screen",
            "type": "string"
        },
        "navigation": {
            "properties": {
                "menu": {
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/Pick<ViewNavigationGroup,\"title\"|\"hidden\"|\"child\"|\"defaultView\">"
                            },
                            {
                                "allOf": [
                                    {
                                        "$ref": "#/definitions/Pick<ViewNavigationItem,\"hidden\"|\"viewName\">"
                                    },
                                    {
                                        "properties": {
                                            "viewName": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "viewName"
                                        ],
                                        "type": "object"
                                    }
                                ],
                                "description": "Omit deprecated fields and include mandatory fields from 2.0.0"
                            }
                        ]
                    },
                    "type": "array"
                }
            },
            "required": [
                "menu"
            ],
            "type": "object"
        },
        "primaryViewName": {
            "description": "Default view for the screen; will be opened if no view name is specified when navigating to a screen",
            "type": "string"
        },
        "primaryViews": {
            "description": "Not used",
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "title": {
            "description": "Displayed name\n\nRequired, but not used at the moment; `text` field from `responsibilities` table will be shown instead",
            "type": "string"
        }
    },
    "required": [
        "name",
        "navigation",
        "primaryViewName",
        "primaryViews",
        "title"
    ],
    "type": "object"
}

