{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "metadata": {
            "type": "object",
            "description": "Metadata to describe this template",
            "properties": {
                "title": {
                    "type": "string",
                    "description": "The display name of the template"
                },
                "configurationName": {
                    "type": "string",
                    "description": "The name of the configuration that will be generated with this template"
                },
                "description": {
                    "type": "string",
                    "description": "A description of the template"
                }
            },
            "required": [
                "title",
                "configurationName"
            ]
        },
        "configDataSettings": {
            "type": "object",
            "properties": {
                "nodeSettings": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "powershellName": {
                                "type": "string",
                                "description": "The name of this property to be used in PowerShell scripts"
                            },
                            "displayName": {
                                "type": "string",
                                "description": "The name of the property as shown in the DSC Studio UI"
                            },
                            "valueType": {
                                "type": "string",
                                "description": "The type of this property to ask the user for",
                                "enum": [
                                    "text",
                                    "number",
                                    "boolean",
                                    "choice"
                                ]
                            },
                            "minOccurences": {
                                "type": "integer",
                                "description": "For boolean properties - the minimum number of nodes that must have this set to 'true' for a configuration to be valid"
                            },
                            "maxOccurences": {
                                "type": "integer",
                                "description": "For boolean properties - the maximum number of nodes that can have this set to 'true' for a configuration to be valid"
                            },
                            "choices": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        },
                        "required": [
                            "powershellName",
                            "displayName",
                            "valueType"
                        ]
                    }
                },
                "certificateDetails": {
                    "type": "boolean",
                    "description": "Ask for a certificate thumbprint and path to CER file to allow for encryption of credentials, setting to false will configure DSC to allow plain text passwords (NOT RECOMMENDED)",
                    "default": true
                },
                "allowPlainTextPassword": {
                    "type": "boolean",
                    "description": "Not recommended - Should this template allow users to use plain text passwords in the output? Default is false",
                    "default": false
                },
                "minNodeCount": {
                    "type": "integer",
                    "description": "The minimum number of nodes to be added to this configuration (defaults to 1 if not specified)",
                    "default": 1
                },
                "maxNodeCount": {
                    "type": "integer",
                    "description": "The maximum numbder of nodes that can be added to this configuration (no limit if not specified)"
                }
            }
        },
        "questions": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "An internal ID for this question to use when refering to it in resource values"
                    },
                    "title": {
                        "type": "string",
                        "description": "The name of the question to show to the user"
                    },
                    "type": {
                        "type": "string",
                        "description": "The type of question to show to the user",
                        "enum": [
                            "text",
                            "number",
                            "boolean",
                            "filepath",
                            "regex",
                            "choice",
                            "textarray",
                            "complextype"
                        ]
                    },
                    "defaultValue": {
                        "type": "string",
                        "description": "What should the default value of this question be?"
                    },
                    "group": {
                        "type": "string",
                        "description": "A group heading to put this question in to"
                    },
                    "helpText": {
                        "type": "string",
                        "description": "Additional help text that can be shown for a specific question."
                    },
                    "validationMessage": {
                        "type": "string",
                        "description": "The validation error message to be shown to the user"
                    },
                    "minValue": {
                        "type": "integer",
                        "description": "The minimum value of this field (for number fields only)"
                    },
                    "maxValue": {
                        "type": "integer",
                        "description": "The minimum value of this field (for number fields only)"
                    },
                    "pattern": {
                        "type": "string",
                        "description": "The regular expression to validate this field with (for regex fields only)"
                    },
                    "choices": {
                        "type": "array",
                        "description": "A list of choices to present the user for this question type",
                        "items": {
                            "type": "string"
                        }
                    },
                    "showForTrueResponseQuestion": {
                        "type": "string",
                        "description": "The ID of a boolean question that controls whether or not this question should be displayed and validated"
                    },
                    "properties": {
                        "type": "array",
                        "description": "For 'complextype' objects, a collection of properties to record on each object that is added",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "description": "The name of the property that appears on the screen"
                                },
                                "powershellName": {
                                    "type": "string",
                                    "description": "The name of the variable to save this value as in PowerShell scripts"
                                },
                                "type": {
                                    "type": "string",
                                    "description": "What data type should the UI collect the value as",
                                    "enum": [
                                        "text",
                                        "number",
                                        "boolean"
                                    ]
                                },
                                "default": {
                                    "type": "string",
                                    "description": "The default value for this question"
                                }
                            },
                            "required": [
                                "name",
                                "powershellName",
                                "type"
                            ]
                        }
                    }
                },
                "required": [
                    "id",
                    "title",
                    "type"
                ]
            }
        }
    }
}