{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "additionalProperties": false,
  "if": {
    "properties": {
      "hasExposure": {
        "const": true
      }
    }
  },
  "properties": {
    "applications": {
      "description": "The applications that can enroll in experiments for this feature. Defaults to firefox-desktop if not present.",
      "items": {
        "enum": [
          "firefox-desktop",
          "firefox-desktop-background-task"
        ],
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    },
    "description": {
      "type": "string"
    },
    "exposureDescription": {
      "description": "A description of the implementation details of the exposure event, if one is sent.",
      "type": "string"
    },
    "hasExposure": {
      "description": "If the feature sends an exposure event.",
      "type": "boolean"
    },
    "isEarlyStartup": {
      "description": "If the feature values should be cached in prefs for fast early startup.",
      "type": "boolean"
    },
    "owner": {
      "description": "The owner of the feature.",
      "type": "string"
    },
    "schema": {
      "description": "For features with large number of variables we instead point to a JSONSchema file instead of specifying them in the variables field",
      "properties": {
        "path": {
          "description": "The path to the schema file relative to the repository root",
          "type": "string"
        },
        "uri": {
          "description": "A resource:// URI that can be loaded at runtime from within Firefox.",
          "format": "uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "path"
      ],
      "type": "object"
    },
    "variables": {
      "additionalProperties": false,
      "patternProperties": {
        "[a-zA-Z0-9_]+": {
          "additionalProperties": false,
          "dependentSchemas": {
            "fallbackPref": {
              "description": "setPref is mutually exclusive with fallbackPref",
              "properties": {
                "setPref": {
                  "const": null
                }
              }
            },
            "setPref": {
              "description": "fallbackPref is mutually exclusive with setPref",
              "properties": {
                "fallbackPref": {
                  "const": null
                }
              }
            }
          },
          "properties": {
            "description": {
              "description": "Explain how this value is being used",
              "type": "string"
            },
            "enum": {
              "description": "Validate feature value using a list of possible options (for string only values)."
            },
            "fallbackPref": {
              "description": "A pref that provides the default value for a feature when none is present",
              "type": "string"
            },
            "setPref": {
              "description": "A pref that should be set to the value of this variable when enrolling in experiments.",
              "type": "string"
            },
            "type": {
              "enum": [
                "json",
                "boolean",
                "int",
                "string"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "description"
          ],
          "type": "object"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "description",
    "hasExposure"
  ],
  "then": {
    "required": [
      "exposureDescription"
    ]
  },
  "type": "object"
}