{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/pubspec",
  "$comment": "See https://dart.dev/tools/pub/pubspec",
  "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": [
        {
          "$comment": "Syntax in yaml: `foo: ^1.2.3`",
          "$ref": "#/definitions/versionConstraint"
        },
        {
          "$comment": "Syntax in yaml: `foo:` or `foo: null`",
          "description": "Default dependency, matches any version of the package",
          "type": "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."
                    },
                    "tag_pattern": {
                      "type": "string",
                      "description": "Pattern for matching git tags with version placeholders"
                    }
                  }
                }
              ]
            },
            "version": {
              "$ref": "#/definitions/versionConstraint"
            }
          },
          "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. [Learn more](https://dart.dev/tools/pub/pubspec#name)",
      "pattern": "[a-z0-9_]",
      "type": "string",
      "examples": ["path", "convert", "http"]
    },
    "version": {
      "$ref": "#/definitions/version",
      "description": "A version number is required to host your package on the pub.dev site, but can be omitted for local-only packages. If you omit it, your package is implicitly versioned 0.0.0. [Learn more](https://dart.dev/tools/pub/pubspec#version)",
      "default": "0.1.0",
      "examples": ["1.2.3", "1.2.3+4", "1.2.3-pre.1", "1.2.3-pre.1+4"]
    },
    "description": {
      "description": "A short, plain text sales-pitch for your package in English. [Learn More](https://dart.dev/tools/pub/pubspec#description)",
      "type": "string",
      "examples": [
        "A string-based path manipulation library. All of the path operations you know and love, with solid support for Windows, POSIX (Linux and Mac OS X), and the web.",
        "Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types.",
        "A composable, multi-platform, Future-based API for HTTP requests."
      ]
    },
    "homepage": {
      "description": "A URL pointing to the website for your package. [Learn more](https://dart.dev/tools/pub/pubspec#homepage)",
      "type": ["string", "null"],
      "format": "uri",
      "examples": ["https://flutter.dev", "https://dart.dev/"]
    },
    "repository": {
      "description": "The optional repository field should contain the URL for your package's source code repository. [Learn more](https://dart.dev/tools/pub/pubspec#repository)",
      "type": "string",
      "format": "uri",
      "examples": ["https://github.com/flutter/flutter"]
    },
    "issue_tracker": {
      "description": "A URL for the package's issue tracker, where existing bugs can be viewed and new bugs can be filed. [Learn more](https://dart.dev/tools/pub/pubspec#issue_tracker)",
      "type": "string",
      "format": "uri",
      "examples": ["https://github.com/flutter/flutter/issues"]
    },
    "documentation": {
      "description": "A site that hosts documentation, separate from the main homepage and from the Pub-generated API reference. [Learn more](https://dart.dev/tools/pub/pubspec#documentation)",
      "type": "string",
      "format": "uri",
      "examples": ["https://flutter.dev/docs", "https://dart.dev/guides"]
    },
    "executables": {
      "description": "A package may expose one or more of its scripts as executables that can be run directly from the command line. [Learn more](https://dart.dev/tools/pub/pubspec#executables)",
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "examples": [
        {
          "dartfmt": "bin/dartfmt.dart",
          "dartdoc": null
        }
      ]
    },
    "platforms": {
      "description": "The platforms field specifies which platforms the package supports. [Learn more](https://dart.dev/tools/pub/pubspec#platforms)",
      "type": "object",
      "properties": {
        "android": {
          "type": "null"
        },
        "ios": {
          "type": "null"
        },
        "linux": {
          "type": "null"
        },
        "macos": {
          "type": "null"
        },
        "web": {
          "type": "null"
        },
        "windows": {
          "type": "null"
        }
      },
      "additionalProperties": false
    },
    "publish_to": {
      "description": "Can be used to specify a custom pub package server to publish. Specify none to prevent a package from being published. [Learn more.](https://dart.dev/tools/pub/pubspec#publish_to)",
      "type": "string",
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "string",
          "enum": ["none"]
        }
      ]
    },
    "funding": {
      "description": "List of URLs where users can sponsor development of the package. [Learn more.](https://dart.dev/tools/pub/pubspec#funding)",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "examples": [
        [
          "https://www.buymeacoffee.com/example_user",
          "https://www.patreon.com/some-account"
        ]
      ]
    },
    "false_secrets": {
      "description": "Gitignore style list of files where pub will not search for accidentally exposed keys. [Learn more.](https://dart.dev/tools/pub/pubspec#false_secrets)",
      "type": "array",
      "examples": [
        [
          "/lib/src/hardcoded_api_key.dart",
          "/test/localhost_certificates/*.pem"
        ]
      ]
    },
    "screenshots": {
      "description": "Showcase widgets or other visual elements using screenshots displayed that will be displayed on pub.dev. [Learn more.](https://dart.dev/tools/pub/pubspec#screenshots)",
      "type": "array",
      "maxItems": 10,
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "maxLength": 160
          },
          "path": {
            "type": "string",
            "pattern": "^.+\\.(png|jpg|gif|webp)$"
          }
        },
        "required": ["description", "path"]
      }
    },
    "topics": {
      "description": "Pub.dev displays the topics on the package page as well as in the search results. [See the list of available topics](https://pub.dev/topics) [Learn more.](https://dart.dev/tools/pub/pubspec#topics)",
      "type": "array",
      "maxItems": 5,
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9-]{0,30}[a-z0-9]$"
      },
      "examples": [
        ["network", "http"],
        ["graphql", "langchain", "wasm"]
      ]
    },
    "ignored_advisories": {
      "description": "A list of security advisory identifiers that are ignored for this package. [See pub.dev Security Advisories](https://dart.dev/tools/pub/security-advisories) [Learn more.](https://dart.dev/tools/pub/pubspec#ignored_advisories)",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "environment": {
      "type": "object",
      "examples": [
        {
          "sdk": ">=1.19.0 <3.0.0",
          "flutter": "^0.1.2"
        }
      ],
      "additionalProperties": {
        "$ref": "#/definitions/versionConstraint"
      }
    },
    "workspace": {
      "type": "array",
      "items": { "type": "string" }
    },
    "resolution": {
      "type": "string",
      "enum": ["external", "local", "workspace"]
    },
    "dependencies": {
      "$ref": "#/definitions/dependencies"
    },
    "dev_dependencies": {
      "$ref": "#/definitions/dependencies"
    },
    "dependency_overrides": {
      "$ref": "#/definitions/dependencies"
    },
    "flutter": {
      "description": "Flutter-specific metadata. [Learn more.](https://docs.flutter.dev/tools/pubspec)",
      "type": ["object", "null"],
      "properties": {
        "uses-material-design": {
          "description": "Whether this project uses the Material Design package. Required if you use the Material icon font",
          "type": "boolean",
          "default": true
        },
        "generate": {
          "description": "Enables generation of localized strings from arb files",
          "type": "boolean",
          "default": false
        },
        "assets": {
          "description": "A list of directories or files that contain images or other assets. [Learn more.](https://flutter.dev/docs/development/ui/assets-and-images)",
          "type": "array",
          "items": {
            "oneOf": [
              {
                "description": "A directory or a file containing assets. A directory has a trailing slash. [Learn more.](https://flutter.dev/docs/development/ui/assets-and-images)",
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string",
                    "examples": ["images/", "postscript_tiger.svg"]
                  },
                  "flavors": {
                    "title": "Asset Flavors",
                    "description": "A list of flavors that include the asset. [Learn more.](https://docs.flutter.dev/deployment/flavors#conditionally-bundling-assets-based-on-flavor)",
                    "type": "array",
                    "items": {
                      "description": "The name of the flavor",
                      "type": "string"
                    }
                  },
                  "transformers": {
                    "title": "Asset Transformers",
                    "description": "A list of transformers to apply to the asset. [Learn more.](https://docs.flutter.dev/ui/assets/asset-transformation)",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "package": {
                          "description": "A Dart command-line app that is invoked with dart run with at least two arguments: --input, which contains the path to the file to transform and --output, which is the location where the transformer code must write its output to",
                          "type": "string",
                          "examples": ["vector_graphics_compiler"]
                        },
                        "args": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "minItems": 1,
                          "examples": [["--tessellate", "--font-size=14"]]
                        }
                      },
                      "required": ["package"],
                      "examples": []
                    },
                    "examples": [
                      [
                        {
                          "package": "vector_graphics_compiler",
                          "args": ["--tessellate", "--font-size=14"]
                        }
                      ]
                    ]
                  },
                  "platforms": {
                    "title": "Asset Platforms",
                    "description": "A list of platforms that include the asset. [Learn more.](https://docs.flutter.dev/tools/pubspec#assets)",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "android",
                        "ios",
                        "linux",
                        "macos",
                        "web",
                        "windows"
                      ]
                    }
                  }
                },
                "required": ["path"],
                "additionalProperties": false
              }
            ]
          },
          "examples": [
            ["images/", "fonts/"],
            [
              "my_icon.png",
              {
                "path": "svg/",
                "transformers": [
                  {
                    "package": "vector_graphics_compiler",
                    "args": ["--tessellate", "--font-size=14"]
                  }
                ]
              }
            ]
          ]
        },
        "fonts": {
          "title": "Fonts",
          "description": "A list of font families and their fonts. [Learn more.](https://docs.flutter.dev/cookbook/design/fonts#declare-the-font-in-the-pubspec-yaml-file)",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "family": {
                "description": "The name of the typeface. You use this name in the `fontFamily` property of a `TextStyle` object.",
                "type": "string"
              },
              "fonts": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "asset": {
                      "description": "The path to the font file. Flutter supports the following font formats: OpenType font collections: .ttc, TrueType fonts: .ttf, OpenType fonts: .otf. Flutter does not support fonts in the Web Open Font Format, .woff and .woff2, on desktop platforms.",
                      "type": "string",
                      "pattern": "^.+\\.(ttf|otf|ttc)$"
                    },
                    "style": {
                      "description": "The style property specifies whether the glyphs in the font file display as either italic or normal. These values correspond to the FontStyle. You can use these styles in the fontStyle property of a TextStyle object. [Learn more.](https://docs.flutter.dev/cookbook/design/fonts#set-font-weight)",
                      "type": "string",
                      "enum": ["normal", "italic"]
                    },
                    "weight": {
                      "description": "The weight property specifies the weight of the outlines in the file. These values correspond to the FontWeight and can be used in the fontWeight property of a TextStyle object. You can't use the weight property to override the weight of the font. [Learn more.](https://docs.flutter.dev/cookbook/design/fonts#specify-the-font-weight)",
                      "type": "integer",
                      "enum": [100, 200, 300, 400, 500, 600, 700, 800, 900]
                    }
                  },
                  "required": ["asset"]
                }
              }
            },
            "required": ["family", "fonts"]
          }
        },
        "shaders": {
          "title": "Fragment Shaders",
          "description": "Shaders, in the form of GLSL files with the .frag extension. The Flutter command-line tool compiles the shader to its appropriate backend format, and generates its necessary runtime metadata. The compiled shader is then included in the application just like an asset. [Learn more](https://docs.flutter.dev/ui/design/graphics/fragment-shaders#adding-shaders-to-an-application)",
          "type": "array",
          "items": {
            "type": "string",
            "description": "Path to a GLSL shader",
            "pattern": "\\.frag$",
            "examples": ["shaders/myshader.frag"]
          },
          "examples": [["shaders/triangle.frag", "glsl/motion_blur.frag"]]
        }
      }
    }
  },
  "required": ["name"],
  "title": "Pubspec",
  "type": "object"
}
