{
  "$id": "https://json.schemastore.org/poetry.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "poetry-author-pattern": {
      "description": "Pattern that matches `Name <email>` like 'King Arthur' or 'Miss Islington &lt;miss-islington@python.org&gt;'.",
      "type": "string",
      "pattern": "^(?:[- .,\\w\\d'’\"():&]+)(?: <(?:.+?)>)?"
    },
    "poetry-authors": {
      "type": "array",
      "description": "List of authors that contributed to the package. This is typically the main maintainers, not the full list.",
      "items": {
        "$ref": "#/definitions/poetry-author-pattern"
      }
    },
    "poetry-maintainers": {
      "type": "array",
      "description": "List of maintainers, other than the original author(s), that upkeep the package.",
      "items": {
        "$ref": "#/definitions/poetry-author-pattern"
      }
    },
    "poetry-include-path": {
      "type": "string",
      "description": "Path to file or directory to include."
    },
    "poetry-package-format": {
      "type": "string",
      "enum": ["sdist", "wheel"],
      "description": "A Python packaging format."
    },
    "poetry-package-formats": {
      "oneOf": [
        {
          "$ref": "#/definitions/poetry-package-format"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/definitions/poetry-package-format"
          }
        }
      ],
      "description": "The format(s) for which the package must be included."
    },
    "poetry-dependency-any": {
      "oneOf": [
        {
          "$ref": "#/definitions/poetry-dependency"
        },
        {
          "$ref": "#/definitions/poetry-long-dependency"
        },
        {
          "$ref": "#/definitions/poetry-git-dependency"
        },
        {
          "$ref": "#/definitions/poetry-file-dependency"
        },
        {
          "$ref": "#/definitions/poetry-path-dependency"
        },
        {
          "$ref": "#/definitions/poetry-url-dependency"
        },
        {
          "$ref": "#/definitions/poetry-multiple-constraints-dependency"
        }
      ]
    },
    "poetry-pep440-version": {
      "type": "string",
      "description": "A version constraint. Validates against the PEP 440's version pattern."
    },
    "poetry-dependency": {
      "$ref": "#/definitions/poetry-pep440-version"
    },
    "poetry-long-dependency": {
      "type": "object",
      "required": ["version"],
      "additionalProperties": false,
      "properties": {
        "version": {
          "$ref": "#/definitions/poetry-pep440-version"
        },
        "python": {
          "type": "string",
          "description": "The python versions for which the dependency should be installed."
        },
        "platform": {
          "type": "string",
          "description": "The platform(s) for which the dependency should be installed."
        },
        "markers": {
          "type": "string",
          "description": "The PEP 508 compliant environment markers for which the dependency should be installed."
        },
        "allow-prereleases": {
          "type": "boolean",
          "description": "Whether the dependency allows prereleases or not."
        },
        "allows-prereleases": {
          "type": "boolean",
          "description": "Whether the dependency allows prereleases or not."
        },
        "optional": {
          "type": "boolean",
          "description": "Whether the dependency is optional or not."
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this dependency.",
          "items": {
            "type": "string"
          }
        },
        "source": {
          "type": "string",
          "description": "The exclusive source used to search for this dependency."
        }
      }
    },
    "poetry-git-dependency": {
      "type": "object",
      "required": ["git"],
      "additionalProperties": false,
      "properties": {
        "git": {
          "type": "string",
          "description": "The url of the git repository.",
          "anyOf": [
            {
              "format": "uri"
            },
            {
              "pattern": "^([A-Za-z0-9\\-]+@|https://|http://)[A-Za-z0-9\\-]+\\.[A-Za-z0-9\\-]+(:|/)[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+\\.git$"
            }
          ]
        },
        "branch": {
          "type": "string",
          "description": "The branch to checkout."
        },
        "tag": {
          "type": "string",
          "description": "The tag to checkout."
        },
        "rev": {
          "type": "string",
          "description": "The revision to checkout."
        },
        "subdirectory": {
          "type": "string",
          "description": "The relative path to the directory where the package is located."
        },
        "python": {
          "type": "string",
          "description": "The python versions for which the dependency should be installed."
        },
        "platform": {
          "type": "string",
          "description": "The platform(s) for which the dependency should be installed."
        },
        "markers": {
          "type": "string",
          "description": "The PEP 508 compliant environment markers for which the dependency should be installed."
        },
        "allow-prereleases": {
          "type": "boolean",
          "description": "Whether the dependency allows prereleases or not."
        },
        "allows-prereleases": {
          "type": "boolean",
          "description": "Whether the dependency allows prereleases or not."
        },
        "optional": {
          "type": "boolean",
          "description": "Whether the dependency is optional or not."
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this dependency.",
          "items": {
            "type": "string"
          }
        },
        "develop": {
          "type": "boolean",
          "description": "Whether to install the dependency in development mode."
        }
      }
    },
    "poetry-file-dependency": {
      "type": "object",
      "required": ["file"],
      "additionalProperties": false,
      "properties": {
        "file": {
          "type": "string",
          "description": "The path to the file."
        },
        "python": {
          "type": "string",
          "description": "The python versions for which the dependency should be installed."
        },
        "platform": {
          "type": "string",
          "description": "The platform(s) for which the dependency should be installed."
        },
        "markers": {
          "type": "string",
          "description": "The PEP 508 compliant environment markers for which the dependency should be installed."
        },
        "optional": {
          "type": "boolean",
          "description": "Whether the dependency is optional or not."
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this dependency.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "poetry-path-dependency": {
      "type": "object",
      "required": ["path"],
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string",
          "description": "The path to the dependency."
        },
        "python": {
          "type": "string",
          "description": "The python versions for which the dependency should be installed."
        },
        "platform": {
          "type": "string",
          "description": "The platform(s) for which the dependency should be installed."
        },
        "markers": {
          "type": "string",
          "description": "The PEP 508 compliant environment markers for which the dependency should be installed."
        },
        "optional": {
          "type": "boolean",
          "description": "Whether the dependency is optional or not."
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this dependency.",
          "items": {
            "type": "string"
          }
        },
        "develop": {
          "type": "boolean",
          "description": "Whether to install the dependency in development mode."
        }
      }
    },
    "poetry-url-dependency": {
      "type": "object",
      "required": ["url"],
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string",
          "description": "The url to the file."
        },
        "python": {
          "type": "string",
          "description": "The python versions for which the dependency should be installed."
        },
        "platform": {
          "type": "string",
          "description": "The platform(s) for which the dependency should be installed."
        },
        "markers": {
          "type": "string",
          "description": "The PEP 508 compliant environment markers for which the dependency should be installed."
        },
        "optional": {
          "type": "boolean",
          "description": "Whether the dependency is optional or not."
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this dependency.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "poetry-multiple-constraints-dependency": {
      "type": "array",
      "minItems": 1,
      "items": {
        "oneOf": [
          {
            "$ref": "#/definitions/poetry-dependency"
          },
          {
            "$ref": "#/definitions/poetry-long-dependency"
          },
          {
            "$ref": "#/definitions/poetry-git-dependency"
          },
          {
            "$ref": "#/definitions/poetry-file-dependency"
          },
          {
            "$ref": "#/definitions/poetry-path-dependency"
          },
          {
            "$ref": "#/definitions/poetry-url-dependency"
          }
        ]
      }
    },
    "poetry-script-table": {
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/definitions/poetry-extra-script-legacy"
        },
        {
          "$ref": "#/definitions/poetry-extra-scripts"
        }
      ]
    },
    "poetry-script-legacy": {
      "type": "string",
      "description": "A simple script pointing to a callable object."
    },
    "poetry-extra-scripts": {
      "type": "object",
      "description": "Either a console entry point or a script file that'll be included in the distribution package.",
      "additionalProperties": false,
      "properties": {
        "reference": {
          "type": "string",
          "description": "If type is file this is the relative path of the script file, if console it is the module name."
        },
        "type": {
          "description": "Value can be either file or console.",
          "type": "string",
          "enum": ["file", "console"]
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this script. Only applicable if type is console.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["reference", "type"]
    },
    "poetry-extra-script-legacy": {
      "type": "object",
      "description": "A script that should be installed only if extras are activated.",
      "additionalProperties": false,
      "properties": {
        "callable": {
          "$ref": "#/definitions/poetry-script-legacy",
          "description": "The entry point of the script. Deprecated in favour of reference."
        },
        "extras": {
          "type": "array",
          "description": "The required extras for this script.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "poetry-build-script": {
      "type": "string",
      "description": "The python script file used to build extensions."
    },
    "poetry-build-config": {
      "type": "object",
      "description": "Build specific configurations.",
      "additionalProperties": false,
      "properties": {
        "generate-setup-file": {
          "type": "boolean",
          "description": "Generate and include a setup.py file in sdist.",
          "default": true
        },
        "script": {
          "$ref": "#/definitions/poetry-build-script"
        }
      }
    },
    "poetry-build-section": {
      "oneOf": [
        {
          "$ref": "#/definitions/poetry-build-script"
        },
        {
          "$ref": "#/definitions/poetry-build-config"
        }
      ]
    }
  },
  "type": "object",
  "additionalProperties": true,
  "required": ["name", "version", "description", "authors"],
  "properties": {
    "name": {
      "type": "string",
      "description": "Package name."
    },
    "version": {
      "type": "string",
      "description": "Version of the package. It should follow semantic versioning, but it is not enforced."
    },
    "description": {
      "type": "string",
      "description": "Short package description.",
      "pattern": "^[^\n]*$"
    },
    "keywords": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "A tag/keyword that this package relates to."
      }
    },
    "homepage": {
      "type": "string",
      "description": "Homepage URL for the project.",
      "format": "uri"
    },
    "repository": {
      "type": "string",
      "description": "Repository URL for the project.",
      "format": "uri"
    },
    "documentation": {
      "type": "string",
      "description": "Documentation URL for the project.",
      "format": "uri"
    },
    "license": {
      "type": "string",
      "description": "License name."
    },
    "authors": {
      "$ref": "#/definitions/poetry-authors"
    },
    "maintainers": {
      "$ref": "#/definitions/poetry-maintainers"
    },
    "readme": {
      "anyOf": [
        {
          "type": "string",
          "description": "The path to the README file."
        },
        {
          "type": "array",
          "description": "A list of paths to the readme files.",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "classifiers": {
      "type": "array",
      "description": "A list of trove classifiers."
    },
    "packages": {
      "type": "array",
      "description": "A list of packages to include in the final distribution.",
      "items": {
        "type": "object",
        "description": "Information about where the package resides.",
        "additionalProperties": false,
        "required": ["include"],
        "properties": {
          "include": {
            "$ref": "#/definitions/poetry-include-path"
          },
          "from": {
            "type": "string",
            "description": "Where the source directory of the package resides."
          },
          "format": {
            "$ref": "#/definitions/poetry-package-formats"
          }
        }
      }
    },
    "include": {
      "type": "array",
      "description": "A list of files and folders to include.",
      "items": {
        "anyOf": [
          {
            "$ref": "#/definitions/poetry-include-path"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": ["path"],
            "properties": {
              "path": {
                "$ref": "#/definitions/poetry-include-path"
              },
              "format": {
                "$ref": "#/definitions/poetry-package-formats"
              }
            }
          }
        ]
      }
    },
    "exclude": {
      "type": "array",
      "description": "A list of files and folders to exclude."
    },
    "dependencies": {
      "type": "object",
      "description": "This is a hash of package name (keys) and version constraints (values) that are required to run this package.",
      "required": ["python"],
      "properties": {
        "python": {
          "type": "string",
          "description": "The Python versions the package is compatible with.",
          "$ref": "#/definitions/poetry-dependency"
        }
      },
      "patternProperties": {
        "^(?!python$)[a-zA-Z-_.0-9]+$": {
          "$ref": "#/definitions/poetry-dependency-any"
        }
      }
    },
    "dev-dependencies": {
      "type": "object",
      "description": "This is a hash of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).",
      "patternProperties": {
        "^[a-zA-Z-_.0-9]+$": {
          "$ref": "#/definitions/poetry-dependency-any"
        }
      }
    },
    "extras": {
      "type": "object",
      "patternProperties": {
        "^[a-zA-Z-_.0-9]+$": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "group": {
      "type": "object",
      "description": "This represents groups of dependencies",
      "patternProperties": {
        "^[a-zA-Z-_.0-9]+$": {
          "type": "object",
          "description": "This represents a single dependency group",
          "required": ["dependencies"],
          "properties": {
            "optional": {
              "type": "boolean",
              "description": "Whether the dependency group is optional or not"
            },
            "dependencies": {
              "type": "object",
              "description": "The dependencies of this dependency group",
              "patternProperties": {
                "^[a-zA-Z-_.0-9]+$": {
                  "$ref": "#/definitions/poetry-dependency-any"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      }
    },
    "build": {
      "$ref": "#/definitions/poetry-build-section"
    },
    "scripts": {
      "type": "object",
      "description": "A hash of scripts to be installed.",
      "patternProperties": {
        "^[a-zA-Z-_.0-9]+$": {
          "oneOf": [
            {
              "$ref": "#/definitions/poetry-script-legacy"
            },
            {
              "$ref": "#/definitions/poetry-script-table"
            }
          ]
        }
      }
    },
    "plugins": {
      "type": "object",
      "description": "A hash of hashes representing plugins",
      "patternProperties": {
        "^[a-zA-Z-_.0-9]+$": {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z-_.0-9]+$": {
              "type": "string"
            }
          }
        }
      }
    },
    "urls": {
      "type": "object",
      "patternProperties": {
        "^.+$": {
          "type": "string",
          "description": "The full url of the custom url."
        }
      }
    }
  }
}
