{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$comment": "See https://github.com/rstudio/renv",
  "title": "renv.lock file",
  "description": "A schema for renv.lock files generated by {renv}",
  "type": "object",
  "properties": {
    "R": {
      "description": "Version of R used in the project",
      "type": "object",
      "properties": {
        "Version": {
          "description": "The version of R used",
          "type": "string",
          "examples": ["4.2.3"]
        },
        "Repositories": {
          "description": "The R repositories used in this project",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "Name": {
                "description": "Name of the repository",
                "type": "string",
                "examples": ["CRAN"]
              },
              "URL": {
                "description": "URL of the repository",
                "type": "string",
                "format": "uri",
                "examples": ["https://cloud.r-project.org"]
              }
            },
            "required": ["Name", "URL"]
          }
        }
      },
      "required": ["Version", "Repositories"]
    },
    "Bioconductor": {
      "description": "",
      "type": "object",
      "properties": {
        "Version": {
          "description": "Release of Bioconductor",
          "type": "string",
          "examples": ["3.18"]
        }
      },
      "required": ["Version"]
    },
    "Python": {
      "description": "Version of Python used in the project",
      "type": "object",
      "properties": {
        "Name": {
          "description": "Path to the Python environment",
          "type": "string",
          "examples": [
            ".venv",
            "./renv/python/virtualenvs/renv-python-3.10"
          ]
        },
        "Type": {
          "description": "Type of Python environment",
          "type": "string",
          "examples": ["virtualenv"]
        },
        "Version": {
          "description": "Version of Python required",
          "type": "string",
          "examples": ["3.10.12", "3.9.0"]
        }
      },
      "required": ["Name", "Type", "Version"]
    },
    "Packages": {
      "description": "Packages required by the R project",
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "Package": {
            "description": "The package name",
            "type": "string",
            "examples": ["ggplot2", "dplyr"]
          },
          "Version": {
            "description": "The package version",
            "type": "string",
            "examples": ["1.0.0", "3.4.6"]
          },
          "Source": {
            "description": "The location from which this package was retrieved",
            "type": "string",
            "examples": [
              "Repository", 
              "Bioconductor",
              "/mnt/r/pkg/package_name_1.0.1.tar.gz"
            ]
          },
          "Repository": {
            "description": "The name of the repository (if any) from which this package was retrieved",
            "type": "string",
            "examples": ["CRAN"]
          },
          "Hash": {
            "description": "A unique hash for this package, used for package caching",
            "type": "string",
            "pattern": "^[a-fA-F0-9]{32}$",
            "examples": ["06230136b2d2b9ba5805e1963fa6e890"]
          },
          "biocViews": {
            "description": "Bioconductor package dependencies",
            "type": "string"
          },
          "RemoteType": {
            "description": "Type of the remote, typically written for packages installed by the devtools, remotes and pak packages",
            "type": "string",
            "examples": ["standard", "github"]
          },
          "RemoteHost": {
            "description": "Host for the remote",
            "type": "string",
            "format": "hostname",
            "examples": ["api.github.com"]
          },
          "RemoteUsername": {
            "description": "Username for the remote",
            "type": "string"
          },
          "RemoteRepo": {
            "description": "Repositories for the package",
            "type": "string",
            "examples": [
              "https://cran.rstudio.com",
              "https://cloud.r-project.org"
            ]
          },
          "RemoteRepos": {
            "description": "Repositories for the package",
            "type": "string",
            "format": "uri",
            "examples": [
              "https://cran.rstudio.com",
              "https://cloud.r-project.org"
            ]
          },
          "RemoteRef": {
            "description": "Ref of the package",
            "type": "string",
            "examples": ["renv", "main"]
          },
          "RemotePkgRef": {
            "description": "Name of the packages",
            "type": "string"
          },
          "RemotePkgPlatform": {
            "description": "Architecture/platform of the remote",
            "type": "string",
            "examples": ["aarch64-apple-darwin20"]
          },
          "RemoteSha": {
            "description": "Version number of the package",
            "type": "string",
            "examples": ["1763e0dcb72fb58d97bab97bb834fc71f1e012bc"]
          },
          "Requirements": {
            "description": "Dependencies of the package",
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "R",
                "jsonlite",
                "lifecycle",
                "magrittr",
                "stringi"
              ],
              [
                "R6",
                "Rcpp",
                "later",
                "magrittr",
                "rlang",
                "stats"
              ]
            ]
          }
        },
        "required": ["Package"]
      }
    }
  },
  "required": ["R", "Packages"]
}
