{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "crate": {
      "type": "object",
      "properties": {
        "display_name": {
          "description": "Crate name used for display purposes, without affecting semantics.",
          "title": "Display name",
          "type": "string"
        },
        "root_module": {
          "description": "Path to the root module of the crate.",
          "title": "Root module",
          "type": "string"
        },
        "edition": {
          "description": "Edition of the crate.",
          "title": "Edition",
          "type": "string",
          "enum": ["2015", "2018", "2021"]
        },
        "deps": {
          "description": "Crate dependencies.",
          "title": "Dependencies",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "$ref": "#/definitions/dep"
          }
        },
        "version": {
          "description": "The crate's version",
          "title": "Version",
          "type": "string",
          "pattern": "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?$"
        },
        "is_workspace_member": {
          "description": "Whether this crate should be treated as a member of the current \"workspace\".",
          "title": "Is workspace member?",
          "type": "boolean"
        },
        "source": {
          "description": "(Super)set of `.rs` files comprising this crate.",
          "title": "Source",
          "type": "object",
          "properties": {
            "include_dirs": {
              "title": "Included directories",
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              }
            },
            "exclude_dirs": {
              "title": "Excluded directories",
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              }
            }
          },
          "required": ["include_dirs", "exclude_dirs"]
        },
        "cfg": {
          "description": "The set of cfgs activated for a given crate.",
          "title": "Configurations",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string"
          }
        },
        "target": {
          "description": "Target triple for this crate.",
          "title": "Target",
          "type": "string"
        },
        "env": {
          "description": "Environment variables, used for the `env!` macro",
          "title": "Environment variables",
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "is_proc_macro": {
          "description": "Whether the crate is a proc-macro crate.",
          "title": "Is proc-macro?",
          "type": "boolean"
        },
        "proc_macro_dylib_path": {
          "description": "For proc-macro crates, path to compiled proc-macro (.so file).",
          "title": "Path to compiled proc-macro",
          "type": "string"
        },
        "repository": {
          "description": "URL to the source repository of the crate.",
          "title": "Repository",
          "type": "string"
        }
      },
      "required": ["root_module", "edition", "deps"]
    },
    "dep": {
      "title": "Dependencies",
      "type": "object",
      "properties": {
        "crate": {
          "description": "Index of a crate in the `crates` array.",
          "title": "Crate index",
          "type": "integer"
        },
        "name": {
          "description": "Name as should appear in the (implicit) `extern crate name` declaration.",
          "title": "Name",
          "type": "string"
        }
      },
      "required": ["crate", "name"]
    }
  },
  "id": "https://json.schemastore.org/rust-project.json",
  "properties": {
    "sysroot": {
      "description": "Path to sysroot.",
      "title": "Sysroot",
      "type": "string"
    },
    "sysroot_src": {
      "description": "Path to the directory with source code of sysroot crates.",
      "title": "Sysroot source",
      "type": "string"
    },
    "crates": {
      "description": "The set of crates comprising the current project.",
      "title": "Crates",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/definitions/crate"
      }
    }
  },
  "required": ["crates"],
  "title": "JSON schema for non-Cargo based Rust projects",
  "type": "object"
}
