{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "definitions": {
    "non-empty-string": {
      "type": "string",
      "minLength": 1
    },
    "module-name": {
      "type": "string",
      "minLength": 1,
      "pattern": "^[^\\s/\\\\*+]+(\\.[^\\s/\\\\*+]+)*$"
    },
    "module-pattern": {
      "type": "string",
      "minLength": 1,
      "pattern": "^[^\\s/\\\\+]+(\\.[^\\s/\\\\+]+)*$"
    },
    "module-pattern-or-expression": {
      "anyOf": [
        {
          "$ref": "#/definitions/module-pattern"
        },
        {
          "$ref": "#/definitions/python-expression"
        }
      ]
    },
    "python-expression": {
      "$ref": "#/definitions/non-empty-string"
    }
  },
  "type": "array",
  "items": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "module-name": {
        "$ref": "#/definitions/module-name"
      },
      "parameters": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "name": {
              "$ref": "#/definitions/non-empty-string"
            },
            "values": {
              "$ref": "#/definitions/python-expression"
            },
            "default": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "values"
          ]
        }
      },
      "constants": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "declarations": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/definitions/python-expression"
            }
          }
        }
      },
      "variables": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "environment": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/definitions/python-expression"
            }
          },
          "setup_code": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/python-expression"
            }
          },
          "declarations": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/definitions/python-expression"
            }
          },
          "when": {
            "$ref": "#/definitions/python-expression"
          }
        }
      },
      "data-files": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "dest_path": {
              "$ref": "#/definitions/non-empty-string"
            },
            "dirs": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "raw_dirs": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "patterns": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "empty_dirs": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "empty_dir_structures": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "include-pyi-file": {
              "type": "string",
              "enum": [
                "yes",
                "no"
              ]
            },
            "include-metadata": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "when": {
              "$ref": "#/definitions/python-expression"
            }
          }
        }
      },
      "dlls": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "from_sources": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "source_paths": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "dest_names": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "source_paths"
              ]
            },
            "from_filenames": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "relative_path": {
                  "type": "string"
                },
                "relative_to": {
                  "$ref": "#/definitions/module-name"
                },
                "prefixes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "suffixes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[^.]\\w*$"
                  }
                },
                "executable": {
                  "type": "string",
                  "enum": [
                    "yes",
                    "no"
                  ]
                }
              },
              "required": [
                "prefixes"
              ]
            },
            "by_code": {
              "additionalProperties": false,
              "type": "object",
              "properties": {
                "setup_code": {
                  "type": "string"
                },
                "filename_code": {
                  "type": "string"
                },
                "executable": {
                  "type": "string",
                  "enum": [
                    "yes",
                    "no"
                  ]
                }
              }
            },
            "dest_path": {
              "$ref": "#/definitions/non-empty-string"
            },
            "when": {
              "$ref": "#/definitions/python-expression"
            }
          }
        }
      },
      "anti-bloat": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "description": {
              "$ref": "#/definitions/non-empty-string"
            },
            "context": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "module_code": {
              "type": "string"
            },
            "replacements_plain": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/definitions/non-empty-string"
              },
              "additionalProperties": {
                "type": "string"
              }
            },
            "global_replacements_re": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "global_replacements": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/python-expression"
              }
            },
            "global_replacements_plain": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/definitions/non-empty-string"
              },
              "additionalProperties": {
                "type": "string"
              }
            },
            "replacements_re": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "replacements": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/python-expression"
              }
            },
            "change_class": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/non-empty-string"
              }
            },
            "global_change_function": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/non-empty-string"
              }
            },
            "change_function": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/non-empty-string"
              }
            },
            "append_result": {
              "$ref": "#/definitions/python-expression"
            },
            "append_plain": {
              "$ref": "#/definitions/python-expression"
            },
            "no-follow": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/definitions/module-pattern"
              },
              "additionalProperties": {
                "$ref": "#/definitions/non-empty-string"
              }
            },
            "no-auto-follow": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/definitions/module-name"
              },
              "additionalProperties": {
                "$ref": "#/definitions/non-empty-string"
              }
            },
            "limit-auto-follow": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/module-pattern"
              }
            },
            "conditional-auto-follow": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/definitions/module-name"
              },
              "additionalProperties": {
                "$ref": "#/definitions/module-name"
              }
            },
            "bloat-mode-overrides": {
              "type": "object",
              "propertyNames": {
                "$ref": "#/definitions/module-name"
              },
              "additionalProperties": {
                "type": "string",
                "enum": [
                  "error",
                  "warning",
                  "nofollow",
                  "allow"
                ]
              }
            },
            "annotations": {
              "type": "string",
              "enum": [
                "default",
                "yes",
                "no"
              ]
            },
            "doc_strings": {
              "type": "string",
              "enum": [
                "default",
                "yes",
                "no"
              ]
            },
            "asserts": {
              "type": "string",
              "enum": [
                "default",
                "yes",
                "no"
              ]
            },
            "when": {
              "$ref": "#/definitions/python-expression"
            }
          }
        }
      },
      "implicit-imports": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "depends": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/module-pattern-or-expression"
              }
            },
            "pre-import-code": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "post-import-code": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "when": {
              "$ref": "#/definitions/python-expression"
            }
          }
        }
      },
      "options": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "description": {
                  "$ref": "#/definitions/non-empty-string"
                },
                "macos_bundle": {
                  "type": "string",
                  "enum": [
                    "yes",
                    "no",
                    "recommend"
                  ]
                },
                "macos_bundle_as_onefile": {
                  "type": "string",
                  "enum": [
                    "yes",
                    "no"
                  ]
                },
                "support_info": {
                  "type": "string",
                  "enum": [
                    "error",
                    "warning",
                    "info",
                    "parameter",
                    "plugin",
                    "perfect"
                  ]
                },
                "when": {
                  "$ref": "#/definitions/python-expression"
                }
              }
            }
          }
        }
      },
      "import-hacks": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "overridden-environment-variables": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "force-environment-variables": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "package-paths": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/module-name"
              }
            },
            "package-dirs": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "find-dlls-near-module": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/module-name"
              }
            },
            "acceptable-missing-dlls": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "global-sys-path": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "package-system-dlls": {
              "type": "string",
              "enum": [
                "yes",
                "no"
              ]
            },
            "recompile-extensions": {
              "type": "string",
              "enum": [
                "default",
                "never",
                "yes",
                "no"
              ]
            },
            "when": {
              "$ref": "#/definitions/python-expression"
            }
          }
        }
      }
    }
  }
}
