{
  "$id": "https://json.schemastore.org/pubspec",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+(?:[+-]\\S+)?$"
    },
    "versionConstraint": {
      "description": "Version range of the package or SDK to use",
      "oneOf": [
        {
          "type": "string",
          "description": "Allows any version of the package. This is not recommended for performance reasons",
          "enum": ["any", ""]
        },
        {
          "$ref": "#/definitions/version"
        },
        {
          "type": "string",
          "examples": [">1.0.0 <2.3.0-beta", ">=1.0.0-pre.1 <=3.0.0"],
          "pattern": "^(?:(?:>=|>|<=|<)\\d+\\.\\d+\\.\\d+(?:[+-]\\S+)?\\s*)+$"
        },
        {
          "type": "string",
          "examples": ["^1.0.0"],
          "pattern": "^\\^\\d+\\.\\d+\\.\\d+(?:[+-]\\S+)?$"
        }
      ]
    },
    "dependency": {
      "oneOf": [
        {
          "$ref": "#/definitions/versionConstraint",
          "$comment": "Syntax in yaml: `foo: ^1.2.3`"
        },
        {
          "description": "Default dependency, matches any version of the package",
          "type": "null",
          "$comment": "Syntax in yaml: `foo:` or `foo: null`"
        },
        {
          "title": "SDK dependency",
          "type": "object",
          "properties": {
            "sdk": {
              "description": "The SDK which contains this package",
              "type": "string"
            },
            "version": {
              "$ref": "#/definitions/versionConstraint"
            }
          },
          "required": ["sdk"],
          "additionalProperties": false
        },
        {
          "title": "Hosted dependency",
          "type": "object",
          "properties": {
            "hosted": {
              "oneOf": [
                {
                  "type": "string",
                  "description": "URL of the package server hosting this package",
                  "format": "uri"
                },
                {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "url": {
                      "description": "The package server hosting this package",
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": ["url"]
                }
              ]
            },
            "version": {
              "$ref": "#/definitions/versionConstraint"
            }
          },
          "required": ["hosted"],
          "additionalProperties": false
        },
        {
          "description": "Git dependency",
          "type": "object",
          "properties": {
            "git": {
              "$comment": "Can either be a string (uri) or an object with ref etc.",
              "oneOf": [
                {
                  "description": "URI of the repository hosting this package",
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "URI of the repository hosting this package"
                    },
                    "path": {
                      "type": "string",
                      "description": "Path of this package relative to the Git repo's root"
                    },
                    "ref": {
                      "type": "string",
                      "description": "The branch, tag, or anything else Git allows to identify a commit."
                    }
                  }
                }
              ]
            }
          },
          "required": ["git"],
          "additionalProperties": false
        },
        {
          "description": "Path dependency",
          "type": "object",
          "properties": {
            "path": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "dependencies": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/dependency"
      }
    }
  },
  "description": "Dart Pubspec file",
  "properties": {
    "name": {
      "description": "The name of this package. The name is how other packages refer to yours, should you publish it.",
      "type": "string"
    },
    "version": {
      "$ref": "#/definitions/version"
    },
    "description": {
      "type": "string"
    },
    "authors": {
      "type": "array",
      "deprecated": true,
      "items": {
        "type": "string"
      }
    },
    "homepage": {
      "type": "string",
      "format": "uri"
    },
    "repository": {
      "type": "string",
      "format": "uri"
    },
    "issue_tracker": {
      "type": "string",
      "format": "uri"
    },
    "documentation": {
      "type": "string",
      "format": "uri"
    },
    "executables": {
      "type": "object"
    },
    "publish_to": {
      "type": "string"
    },
    "environment": {
      "type": "object",
      "examples": [
        {
          "sdk": ">=1.19.0 <3.0.0",
          "flutter": "^0.1.2"
        }
      ],
      "additionalProperties": {
        "$ref": "#/definitions/versionConstraint"
      }
    },
    "dependencies": {
      "$ref": "#/definitions/dependencies"
    },
    "dev_dependencies": {
      "$ref": "#/definitions/dependencies"
    },
    "dependency_overrides": {
      "$ref": "#/definitions/dependencies"
    }
  },
  "required": ["name"],
  "title": "Pubspec",
  "type": "object"
}