{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "https://frontastic.cloud/json/appSchema",

    "title": "Custom App Schema",
    "description": "A Frontastic custom app definition",

    "type": "object",

    "properties": {
        "identifier": {
            "type": "string",
            "pattern": "[^ ]"
        },
        "name": {
            "type": "string"
        },
        "icon": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "fields": {
            "$comment": "Fields to be displayed in the overview table of the custom app.",

            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "label": {
                        "type": "string"
                    },
                    "field": {
                        "$comment": "Reference to a field identifier available in 'schema'.",

                        "type": "string"
                    }
                },
                "required": ["label", "field"]
            }
        },
        "schema": {
            "$ref": "https://frontastic.cloud/json/library/common#/definitions/schema"
        },
        "indexes": {
            "$comment": "Indexes that should be set upon the custom data to improve searching and fetching in Catwalk.",

            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "fields": {
                        "$comment": "References to field identifiers used in 'schema'",

                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": ["name", "fields"]
            }
        }
    },
    "required": ["identifier", "name", "fields", "schema"]
}
