{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "https://schemas.conda.org/repodata-record-1.schema.json",
  "type": "object",
  "title": "Conda Package Metadata Record Schema",
  "description": "The schema for each package file's block of metadata in repodata.",
  "$comment": "TODO add these back to required: record_version ext fn subdir",
  "required": [
    "subdir",
    "name",
    "version",
    "build_number",
    "build",
    "fn",
    "sha256",
    "size",
    "md5"
  ],
  "properties": {
    "record_version": {
      "type": "integer",
      "description": "The API version or schema version of the record. Conda versions through at least Conda 4.8 are able to understand record_version <= 1.",
      "const": 1,
      "patchable": true
    },
    "origin_channel_name": {
      "$ref": "common-1.schema.json#/definitions/origin_channel_name"
    },
    "subdir": {
      "$ref": "common-1.schema.json#/definitions/subdir"
    },
    "namespace": {
      "$ref": "common-1.schema.json#/definitions/namespace"
    },
    "name": {
      "$ref": "common-1.schema.json#/definitions/name"
    },
    "version": {
      "$ref": "common-1.schema.json#/definitions/package_version"
    },
    "build_number": {
      "$ref": "common-1.schema.json#/definitions/build_number"
    },
    "build": {
      "$ref": "common-1.schema.json#/definitions/build"
    },
    "fn": {
      "type": "string",
      "description": "The file name should be generated based on other fields in the package's metadata, i.e. {name}-{version}-{build}{ext}. It should be validated against those fields.",
      "patchable": false,
      "examples": [
        "ansible-1.9.3-py27_0.tar.bz2",
        "basemap-1.2.0-py27hbee0394_0.conda"
      ]
    },
    "sha256": {
      "type": "string",
      "description": "The sha256 hash of the package file.",
      "patchable": false,
      "pattern": "^[0-9a-f]{64}$",
      "examples": [
        "2efb3826d65af3f3857a35f04a0ba5c6288b9b3e4e47c9e2118fbdcc190406b9"
      ]
    },
    "size": {
      "type": "integer",
      "description": "The size of the package file in bytes.",
      "patchable": false,
      "minimum": 0,
      "examples": [
        15874157
      ]
    },
    "md5": {
      "type": "string",
      "description": "The md5 hash of the package file.",
      "pattern": "^[0-9a-f]{32}$",
      "examples": [
        "9ceda9e08e97868b6ff7c0961a40544f"
      ]
    },
    "timestamp": {
      "$ref": "common-1.schema.json#/definitions/timestamp"
    },
    "patch_version": {
      "type": "integer",
      "minimum": 0,
      "description": "Metadata record patch version. Incremented for each change of the metadata record.",
      "patchable": true
    },
    "depends": {
      "type": "array",
      "description": "The package's dependencies. A list of MatchSpecs required when installing the package.",
      "patchable": true,
      "items": {
        "type": "string",
        "description": "Valid Conda MatchSpec.",
        "examples": [
          "geos >=3.6.2,<3.6.3.0a0",
          "matplotlib >=1.0.0",
          "numpy >=1.11.3,<2.0a0",
          "pyproj >=1.9.3",
          "pyshp >=1.2.0",
          "python >=2.7,<2.8.0a0",
          "six",
          "vc 9.*"
        ]
      }
    },
    "constrains": {
      "type": "array",
      "description": "The package's constraints on other packages in the environment. If the package is to be installed into an environment, the other packages in the environment must conform to these constratins. A constraint can be thought of as a 'reverse dependency'.",
      "patchable": true,
      "items": {
        "type": "string",
        "description": "Valid Conda MatchSpec.",
        "examples": [
          "proj4 <6",
          "proj <6"
        ]
      }
    },
    "features": {
      "deprecated": true,
      "type": "string",
      "description": "The features provided by the package. Format is a space-delimited string of items.",
      "patchable": true,
      "pattern": "^([a-z0-9-_.]+( |$))*$"
    },
    "track_features": {
      "type": "string",
      "description": "The features 'tracked' by the package. Format is a space-delimited string of items. https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#track-features",
      "patchable": true,
      "pattern": "^([a-z0-9-_.]+( |$))*$"
    },
    "noarch": {
      "deprecated": true,
      "type": "string",
      "description": "The noarch type of a package (if applicable).",
      "patchable": true,
      "enum": [
        "generic",
        "python"
      ]
    },
    "license": {
      "$comment": "TODO don't allow null",
      "type": [
        "string",
        "null"
      ],
      "title": "The package's license.",
      "description": "A free-form text field describing the packages license.",
      "patchable": true,
      "examples": [
        "MIT"
      ]
    },
    "license_family": {
      "$ref": "common-1.schema.json#/definitions/license_family"
    },
    "spdx_license": {
      "$ref": "common-1.schema.json#/definitions/spdx_license"
    },
    "vulns_active": {
      "type": "array",
      "description": "Vulnerabilities that have been identified for the package that are potentially active and exploitable.",
      "patchable": true,
      "items": {
        "$ref": "common-1.schema.json#/definitions/vuln_id"
      }
    },
    "vulns_mitigated": {
      "type": "array",
      "description": "Vulnerabilities that have been identified for the package but have proactively been mitigated in this package build through a code patch.",
      "patchable": true,
      "items": {
        "$ref": "common-1.schema.json#/definitions/vuln_id"
      }
    },
    "vulns_cleared": {
      "type": "array",
      "description": "Vulnerabilities associated with the package that have been analyzed and determined to not be applicable.",
      "patchable": true,
      "items": {
        "$ref": "common-1.schema.json#/definitions/vuln_id"
      }
    },
    "vulns_disputed": {
      "type": "array",
      "description": "Vulnerabilities where legitimacy as an actual vulnerability is disputed by upstream project maintainers or other community members.",
      "patchable": true,
      "items": {
        "$ref": "common-1.schema.json#/definitions/vuln_id"
      }
    },
    "post_solve_message": {
      "type": "string",
      "patchable": true
    },
    "post_link_message": {
      "type": "string",
      "patchable": true
    }
  }
}
