{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/drupal-info.json",
  "allOf": [
    {
      "if": {
        "properties": {
          "type": {
            "const": "module"
          }
        }
      },
      "then": {
        "properties": {
          "configure": {
            "title": "A route name of the configuration form",
            "type": "string"
          },
          "dependencies": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/dependency"
            }
          },
          "test_dependencies": {
            "title": "Dependencies that are needed to run certain automated tests for this extension",
            "type": "array",
            "items": {
              "$ref": "#/definitions/dependency"
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "theme"
          }
        }
      },
      "then": {
        "properties": {
          "base theme": {
            "title": "Base theme",
            "default": "classy",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "libraries": {
            "title": "A list of libraries to add to all pages where the theme is active",
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_\\-.]+$"
            }
          },
          "libraries-override": {
            "title": "A collection of libraries and assets to override",
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "object"
                },
                {
                  "type": "string"
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "libraries-extend": {
            "title": "A collection of libraries and assets to add whenever a library is attached",
            "type": "object",
            "additionalProperties": {
              "type": "array"
            }
          },
          "engine": {
            "title": "The theme engine",
            "default": "twig",
            "type": "string"
          },
          "logo": {
            "title": "The path to logo relative to the theme's .info.yml",
            "type": "string"
          },
          "screenshot": {
            "title": "The path to screenshot relative to the theme's .info.yml file",
            "type": "string"
          },
          "regions": {
            "title": "A list of theme regions",
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "regions_hidden": {
            "title": "A list of inherited regions to remove",
            "type": "array",
            "uniqueItems": true
          },
          "features": {
            "title": "A list of features to expose on the theme 'Settings' page",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "stylesheets-remove": {
            "title": "A list of stylesheets from other modules or themes to remove from all pages where the theme is active",
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "ckeditor_stylesheets": {
            "title": "A list of stylesheets to add to the CKEditor frame",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "profile"
          }
        }
      },
      "then": {
        "properties": {
          "distribution": {
            "title": "Declare the installation profile as a distribution",
            "type": "object",
            "properties": {
              "name": {
                "title": "The distribution name",
                "type": "string"
              },
              "install": {
                "type": "object",
                "properties": {
                  "theme": {
                    "$ref": "#/definitions/machine_name",
                    "title": "The theme for the distribution installation"
                  }
                }
              },
              "langcode": {
                "type": "string"
              }
            }
          },
          "dependencies": {
            "title": "Required modules",
            "type": "array",
            "items": {
              "$ref": "#/definitions/machine_name"
            },
            "uniqueItems": true
          },
          "install": {
            "title": "Modules to install to support the profile",
            "type": "array",
            "items": {
              "$ref": "#/definitions/dependency"
            },
            "uniqueItems": true
          },
          "theme": {
            "title": "List any themes that should be installed as part of the profile installation",
            "type": "array",
            "items": {
              "$ref": "#/definitions/machine_name"
            },
            "uniqueItems": true
          }
        }
      }
    }
  ],
  "definitions": {
    "dependency": {
      "title": "Extension dependency",
      "type": "string",
      "pattern": "^[a-z0-9_]+:[a-z0-9_]+( \\(.+\\))?$"
    },
    "machine_name": {
      "title": "Machine name",
      "type": "string",
      "pattern": "^[a-z0-9_]+$"
    }
  },
  "properties": {
    "name": {
      "title": "The human-readable name",
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": ["module", "theme", "profile", "theme_engine"]
    },
    "core": {
      "type": "string",
      "pattern": "^\\d+\\.x$"
    },
    "core_version_requirement": {
      "title": "Semantic core version requirement",
      "type": "string"
    },
    "description": {
      "title": "Extension description",
      "type": "string"
    },
    "package": {
      "title": "A key that allows to group extension together an administrative pages",
      "type": "string"
    },
    "version": {
      "title": "The version of the extension",
      "type": "string"
    },
    "project": {
      "title": "The machine name of extension project on drupal.org",
      "type": "string"
    },
    "datestamp": {
      "title": "The date and time when the extension was packaged",
      "type": "integer"
    },
    "hidden": {
      "title": "Do not the extension in admin interface",
      "type": "boolean"
    },
    "php": {
      "title": "The minimal PHP version that is required for this extension",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^\\d+\\.\\d+(\\.\\d+)$"
        },
        {
          "type": "number"
        }
      ]
    }
  },
  "required": ["type", "core_version_requirement", "name"],
  "title": "JSON schema for Drupal extension info file",
  "type": "object"
}
