{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/packer.json",
  "definitions": {
    "builder-type": {
      "enum": [
        "alicloud-ecs",
        "amazon-ebs",
        "azure-arm",
        "azure-chroot",
        "cloudstack",
        "custom",
        "digitalocean",
        "docker",
        "file",
        "googlecompute",
        "hcloud",
        "hyperone",
        "hyperv-iso",
        "hyperv-vmcx",
        "jdcloud",
        "linode",
        "lxc",
        "lxd",
        "ncloud",
        "null",
        "ocs-chroot",
        "oneandone",
        "openstack",
        "oracle-classic",
        "oracle-oci",
        "osc-bsu",
        "osc-bsusurrogate",
        "parallels-iso",
        "parallels-pvm",
        "profitbricks",
        "proxmox",
        "qemu",
        "scaleway",
        "tencentcloud-cvm",
        "triton",
        "ucloud-uhost",
        "vagrant",
        "virtualbox-iso",
        "virtualbox-ovf",
        "virtualbox-vm",
        "vmware-iso",
        "vmware-vmx",
        "vsphere-clone",
        "vsphere-iso",
        "yandex"
      ]
    },
    "builder-vagrant": {
      "type": "object",
      "properties": {
        "type": {
          "const": "vagrant"
        },
        "add_cacert": {
          "type": "string"
        },
        "add_capath": {
          "type": "string"
        },
        "add_clean": {
          "type": "boolean"
        },
        "add_force": {
          "type": "boolean"
        },
        "add_insecure": {
          "type": "boolean"
        },
        "box_name": {
          "type": "string"
        },
        "box_version": {
          "type": "string"
        },
        "checksum": {
          "type": "string"
        },
        "checksum_type": {
          "type": "string"
        },
        "global_id": {
          "type": "string"
        },
        "output_dir": {
          "type": "string"
        },
        "output_vagrantfile": {
          "type": "string"
        },
        "package_include": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "skip_add": {
          "type": "boolean"
        },
        "source_path": {
          "type": "string"
        },
        "teardown_method": {
          "type": "string"
        },
        "template": {
          "type": "string"
        }
      }
    },
    "builder-virtualbox-iso": {
      "type": "object",
      "properties": {
        "bundle_iso": {
          "type": "boolean"
        },
        "communicator": {
          "type": "string"
        },
        "disk_size": {
          "type": "integer"
        },
        "export_opts": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "format": {
          "type": "string"
        },
        "guest_additions_interface": {
          "type": "string"
        },
        "guest_additions_mode": {
          "type": "string"
        },
        "guest_additions_path": {
          "type": "string"
        },
        "guest_additions_sha256": {
          "type": "string"
        },
        "guest_additions_url": {
          "type": "string"
        },
        "guest_os_type": {
          "type": "string"
        },
        "hard_drive_interface": {
          "type": "string"
        },
        "hard_drive_nonrotational": {
          "type": "boolean"
        },
        "hard_driver_discard": {
          "type": "boolean"
        },
        "headless": {
          "type": "boolean"
        },
        "http_bind_address": {
          "type": "integer"
        },
        "http_directory": {
          "type": "string"
        },
        "http_port_max": {
          "type": "integer"
        },
        "http_port_min": {
          "type": "integer"
        },
        "iso_checksum": {
          "type": "string"
        },
        "iso_interface": {
          "type": "string"
        },
        "iso_target_extension": {
          "type": "string"
        },
        "iso_target_path": {
          "type": "string"
        },
        "iso_url": {
          "type": "string"
        },
        "iso_urls": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "keep_registered": {
          "type": "boolean"
        },
        "nvme_port_count": {
          "type": "integer"
        },
        "output_directory": {
          "type": "string"
        },
        "output_filename": {
          "type": "string"
        },
        "sata_port_count": {
          "type": "integer"
        },
        "shutdown_command": {
          "type": "string"
        },
        "skip_export": {
          "type": "boolean"
        },
        "type": {
          "const": "virtualbox-iso"
        },
        "virtualbox_version_file": {
          "type": "string"
        },
        "vm_name": {
          "type": "string"
        }
      }
    },
    "provisioner-ansible-local": {
      "type": "object",
      "properties": {
        "playbook_file": {
          "type": "string"
        }
      },
      "required": ["playbook_file"]
    },
    "provisioner-shell": {
      "type": "object",
      "properties": {
        "inline": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "provisioner": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["shell", "ansible-local"]
        }
      },
      "oneOf": [
        {
          "$ref": "#/definitions/provisioner-ansible-local"
        },
        {
          "$ref": "#/definitions/provisioner-shell"
        }
      ],
      "required": ["type"]
    },
    "post-processor": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": ["compress", "upload"]
        },
        "endpoint": {
          "type": "string"
        },
        "keep_input_artifact": {
          "type": "boolean"
        },
        "only": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "format": {
          "type": "string",
          "enum": ["tar.gz"]
        },
        "compression_level": {
          "type": "number"
        }
      }
    }
  },
  "properties": {
    "min_packer_version": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "variables": {
      "type": "object",
      "patternProperties": {
        "[a-zA-Z0-9_-]": {
          "type": "string"
        }
      }
    },
    "builders": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/definitions/builder-vagrant"
          },
          {
            "$ref": "#/definitions/builder-virtualbox-iso"
          }
        ]
      }
    },
    "provisioners": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/provisioner"
      }
    },
    "post-processors": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "enum": ["vagrant", "compress"]
          },
          {
            "$ref": "#/definitions/post-processor"
          }
        ]
      }
    }
  },
  "required": ["builders"],
  "type": "object"
}
