{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "additionalProperties": true,
    "definitions": {
        "condition": {
            "type": "object",
            "properties": {
                "dependency": {
                    "type": "array",
                    "description": "",
                    "additionalProperties": false,
                    "items": {
                        "type": "string",
                        "additionalProperties": false
                    }
                },
                "simple": {
                    "type": "array",
                    "description": "",
                    "additionalProperties": false,
                    "items": {
                        "type": "string",
                        "additionalProperties": false
                    }
                },
                "environnement": {
                    "type": "array",
                    "additionalProperties": false,
                    "description": "",
                    "items": {
                        "type": "string",
                        "additionalProperties": false
                    }
                }
            }
        },
        "response": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string",
                    "additionalProperties": false
                },
                "default": {
                    "type": "string",
                    "additionalProperties": false
                },
                "predefined": {
                    "type": "array",
                    "additionalProperties": false,
                    "items": {
                        "id": "http://jsonschema.net/questions/0#",
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "response": {
                                "type": "string",
                                "additionalProperties": false,
                                "description": "The question type",
                                "minLength": 1
                            },
                            "text": {
                                "type": "string",
                                "additionalProperties": false,
                                "minLength": 1
                            }
                        }
                    }
                }
            }
        }
    },
    "properties": {
        "name": {
            "type": "string",
            "additionalProperties": false,
            "description": "The name of the generator",
            "minLength": 1
        },
        "definition": {
            "type": "string",
            "additionalProperties": false,
            "description": "The description of the generator",
            "minLength": 1
        },
        "metadataTypeAccepted": {
            "type": "array",
            "additionalProperties": false,
            "description": "The list of the metadataType allowed in this generator",
            "minItems": 1,
            "items": {
                "type": "string",
                "additionalProperties": false,
                "minLength": 1
            }
        },
        "dependencies": {
            "type": "array",
            "additionalProperties": false,
            "description": "The list of the metadataType allowed in this generator",
            "items": {
                "id": "http://jsonschema.net/metadataTypeAccepted/0#",
                "type": "string",
                "additionalProperties": false,
                "minLength": 1
            }
        },
        "questions": {
            "type": "array",
            "additionalProperties": false,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "dtoAttribute"
                ],
                "properties": {
                    "dtoAttribute": {
                        "type": "string",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "type": {
                        "type": "string",
                        "additionalProperties": false,
                        "description": "The question type",
                        "enum": [
                            "simple",
                            "complex",
                            "directory",
                            "askCollection",
                            "askCollectionOverIterator"
                        ],
                        "default": "simple"
                    },
                    "text": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "factory": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "response": {
                        "$ref": "#/definitions/response"
                    },
                    "condition": {
                        "$ref": "#/definitions/condition"
                    },
                    "iteration": {
                        "type": "object",
                        "required": [
                            "text",
                            "iterator",
                            "retrieveBy"
                        ],
                        "properties": {
                            "iterator": {
                                "type": "string",
                                "description": "",
                                "additionalProperties": false
                            },
                            "retrieveBy": {
                                "type": "string",
                                "description": "",
                                "additionalProperties": false
                            },
                            "text": {
                                "type": "string",
                                "description": "",
                                "additionalProperties": false
                            },
                            "condition": {
                                "$ref": "#/definitions/condition"
                            }
                        }
                    }
                }
            },
            "required": [
                "0"
            ]
        },
        "directories": {
            "type": "array",
            "additionalProperties": false,
            "items": {
                "type": "string",
                "description": "",
                "additionalProperties": false
            },
            "required": [
                "0"
            ]
        },
        "templateVariables": {
            "type": "array",
            "additionalProperties": false,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "variableName": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "value": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "condition": {
                        "$ref": "#/definitions/condition"
                    }
                },
                "required": [
                    "variableName",
                    "value"
                ]
            },
            "required": [
                "0"
            ]
        },
        "filesList": {
            "type": "array",
            "additionalProperties": false,
            "minItems": 1,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "templatePath": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "destinationPath": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false,
                        "minLength": 1
                    },
                    "description": {
                        "type": "string",
                        "description": "",
                        "additionalProperties": false
                    },
                    "condition": {
                        "$ref": "#/definitions/condition"
                    }
                },
                "required": [
                    "templatePath",
                    "destinationPath"
                ]
            }
        }
    },
    "required": [
        "name",
        "definition",
        "metadataTypeAccepted",
        "questions",
        "directories",
        "templateVariables",
        "filesList"
    ]
}