{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "PowerAppConfigDefinition": {
            "properties": {
                "description": {
                    "type": "string"
                },
                "displayName": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            },
            "required": [
                "displayName",
                "name"
            ],
            "type": "object"
        },
        "PowerAppFieldDataSourceDefinition": {
            "properties": {
                "inputs": {
                    "items": {
                        "$ref": "#/definitions/PowerAppInputDefinition"
                    },
                    "type": "array"
                },
                "url": {
                    "type": "string"
                }
            },
            "required": [
                "url"
            ],
            "type": "object"
        },
        "PowerAppInputDefinition": {
            "properties": {
                "bind": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionVariableInputOptions"
                        },
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionValueInputOptions"
                        },
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionAppConfigInputOptions"
                        },
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionResourcePropertyInputOptions"
                        }
                    ]
                },
                "default": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionVariableInputOptions"
                        },
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionValueInputOptions"
                        },
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionAppConfigInputOptions"
                        },
                        {
                            "$ref": "#/definitions/PowerAppInputDefinitionResourcePropertyInputOptions"
                        }
                    ]
                },
                "displayName": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            },
            "required": [
                "displayName",
                "name"
            ],
            "type": "object"
        },
        "PowerAppInputDefinitionAppConfigInputOptions": {
            "properties": {
                "configName": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "app-config"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "configName",
                "type"
            ],
            "type": "object"
        },
        "PowerAppInputDefinitionResourcePropertyInputOptions": {
            "properties": {
                "propertyName": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "resource-property"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "propertyName",
                "type"
            ],
            "type": "object"
        },
        "PowerAppInputDefinitionValueInputOptions": {
            "properties": {
                "type": {
                    "enum": [
                        "value"
                    ],
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "type",
                "value"
            ],
            "type": "object"
        },
        "PowerAppInputDefinitionVariableInputOptions": {
            "properties": {
                "type": {
                    "enum": [
                        "variable"
                    ],
                    "type": "string"
                },
                "variable": {
                    "type": "string"
                }
            },
            "required": [
                "type",
                "variable"
            ],
            "type": "object"
        },
        "PowerAppOptionsFieldDefinition": {
            "properties": {
                "displayName": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "options": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/PowerAppFieldDataSourceDefinition"
                        },
                        {
                            "items": {
                                "$ref": "#/definitions/ProcedureSelectAlikeFieldOption"
                            },
                            "type": "array"
                        }
                    ]
                },
                "type": {
                    "enum": [
                        "radio",
                        "select"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "displayName",
                "name",
                "options",
                "type"
            ],
            "type": "object"
        },
        "PowerAppTextFieldDefinition": {
            "properties": {
                "displayName": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "text"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "displayName",
                "name",
                "type"
            ],
            "type": "object"
        },
        "PowerItemDefinition": {
            "properties": {
                "description": {
                    "type": "string"
                },
                "displayName": {
                    "type": "string"
                },
                "hookBaseURL": {
                    "type": "string"
                },
                "inputs": {
                    "items": {
                        "$ref": "#/definitions/PowerAppInputDefinition"
                    },
                    "type": "array"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "checkable",
                        "indicator"
                    ],
                    "type": "string"
                }
            },
            "required": [
                "displayName",
                "hookBaseURL",
                "name"
            ],
            "type": "object"
        },
        "PowerTagDefinition": {
            "properties": {
                "description": {
                    "type": "string"
                },
                "displayName": {
                    "type": "string"
                },
                "hookBaseURL": {
                    "type": "string"
                },
                "inputs": {
                    "items": {
                        "$ref": "#/definitions/PowerAppInputDefinition"
                    },
                    "type": "array"
                },
                "name": {
                    "type": "string"
                }
            },
            "required": [
                "displayName",
                "hookBaseURL",
                "name"
            ],
            "type": "object"
        },
        "ProcedureSelectAlikeFieldOption": {
            "properties": {
                "text": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "text",
                "value"
            ],
            "type": "object"
        }
    },
    "properties": {
        "configs": {
            "items": {
                "$ref": "#/definitions/PowerAppConfigDefinition"
            },
            "type": "array"
        },
        "description": {
            "type": "string"
        },
        "displayName": {
            "type": "string"
        },
        "fields": {
            "items": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/PowerAppTextFieldDefinition"
                    },
                    {
                        "$ref": "#/definitions/PowerAppOptionsFieldDefinition"
                    }
                ]
            },
            "type": "array"
        },
        "homePageURL": {
            "pattern": "^https?://.+$",
            "type": "string"
        },
        "name": {
            "pattern": "^[\\w\\d]+(-[\\w\\d]+)*$",
            "type": "string"
        },
        "powerItems": {
            "items": {
                "$ref": "#/definitions/PowerItemDefinition"
            },
            "type": "array"
        },
        "powerTags": {
            "items": {
                "$ref": "#/definitions/PowerTagDefinition"
            },
            "type": "array"
        }
    },
    "required": [
        "displayName",
        "name"
    ],
    "type": "object"
}

