{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/measure-sh/json-schema/measure-sh-filter-key-schema.json",
  "title": "FilterKey",
  "description": "One thing an entity can be filtered by.",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dashboard.yaml#/components/schemas/FilterKey",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name `filter_expr` conditions and `key_name` refer to the key by."
    },
    "label": {
      "type": "string",
      "description": "What the key is called on screen."
    },
    "description": {
      "type": "string"
    },
    "key_group": {
      "type": "string",
      "description": "The group the key is offered under, and the tab the filter bar\nputs it in. Always one of the `key_groups` the keys response\nlists.\n"
    },
    "value_type": {
      "type": "string",
      "description": "The kind of value the key holds, which decides the operators it can\noffer. A numeric type names the width and sign of the column the key\nis compared against, so a value outside that range is refused rather\nthan sent to the database.\n",
      "enum": [
        "string",
        "enum",
        "uuid",
        "int32",
        "int64",
        "uint32",
        "float64",
        "bool",
        "datetime"
      ]
    },
    "operators": {
      "type": "array",
      "description": "The operators this key offers, in the order to show them. A key may\noffer fewer operators than its type allows but not more.\n",
      "items": {
        "type": "string",
        "enum": [
          "in",
          "not_in",
          "contains",
          "not_contains",
          "starts_with",
          "ends_with",
          "eq",
          "neq",
          "gt",
          "gte",
          "lt",
          "lte",
          "is_set",
          "is_not_set",
          "before",
          "after",
          "between"
        ]
      }
    },
    "value_suggestion_mode": {
      "type": "string",
      "description": "Where a key's values come from. full_list is a fixed set the key\ndeclares and accepts no other values; sample contains values reported\nby the app, shown as a recent sample but still open to values not in\nthe list; none provides no suggestions and accepts values typed\ndirectly. A key that takes no values indicates this through its\noperators, which take none.\n",
      "enum": [
        "full_list",
        "sample",
        "none"
      ]
    }
  }
}