{
  "config_schema": {},
  "items": {
    "core_schema": {
      "engine": {
        "type": "string",
        "default": "jerakia",
        "optional": false
      },
      "value": {
        "default": "UNSET",
        "optional": false
      }
    },
    "plugin": {
      "engine": {
        "jerakia_schema": {
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "glob": {
            "default": "ansible.yml",
            "anyOf": [
              {
                "type": "string"
              }
            ]
          }
        }
      },
      "backend": {
        "hier_schema": {
          "hier": {
            "default": null,
            "optional": true,
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              },
              {
                "additionalProperties": true,
                "properties": {
                  "data": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "null"
                      },
                      {
                        "type": "string"
                      },
                      {
                        "type": "array"
                      }
                    ]
                  },
                  "var": {
                    "type": "string",
                    "default": "hier_item",
                    "optional": true
                  },
                  "separator": {
                    "type": "string",
                    "default": "/",
                    "optional": true
                  },
                  "reversed": {
                    "type": "boolean",
                    "default": false,
                    "optional": true
                  }
                }
              }
            ]
          }
        },
        "loop_schema": {
          "loop": {
            "description": [
              "\n    This module helps to loop over a backend\n    "
            ],
            "default": null,
            "optional": true,
            "examples": [
              {
                "value": "site/{{ loop_env }}/config/{{ os }}",
                "loop": {
                  "var": "loop_env",
                  "data": [
                    "dev",
                    "preprod",
                    "prod"
                  ]
                },
                "comment": "The module will loop three time over the value, and the variable `loop_env` will consecutely have `dev`, `preprod` and `prod` as value"
              },
              {
                "value": "site/{{ loop_env2 }}/config/{{ os }}",
                "loop": {
                  "var": "loop_env2",
                  "data": "my_scope_var"
                },
                "comment": "Like the previous example, but it will fetch the list from any scope variables"
              },
              {
                "loop": null,
                "comment": "Disable this module, no loop will operate"
              }
            ],
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "default": {},
                "title": "Complete config",
                "description": "",
                "properties": {
                  "data": {
                    "default": null,
                    "optional": false,
                    "title": "Module configuration",
                    "description": "Data list used for iterations. It only accept lists as type. It disable the module if set to `null`.",
                    "anyOf": [
                      {
                        "type": "null",
                        "title": "Disable Module",
                        "description": "Disable the module"
                      },
                      {
                        "type": "string",
                        "title": "Scope variable",
                        "description": "Will look the value of the loop list from the scope. TOFIX: What if variablle does not exists?"
                      },
                      {
                        "type": "array",
                        "title": "Hardcoded list",
                        "description": "Simply enter the list of value to be iterated to."
                      }
                    ]
                  },
                  "var": {
                    "type": "string",
                    "default": "loop_item",
                    "optional": true,
                    "title": "Module configuration",
                    "description": "Name of the variable to be used in templating language"
                  }
                }
              },
              {
                "type": "string",
                "title": "Short config",
                "description": "If set to string, it will define the name of the variable to lookup into the scope."
              },
              {
                "type": "null",
                "title": "Disable",
                "description": "If set to null, it disable the module"
              }
            ]
          }
        }
      }
    }
  }
}
