{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-filter-options-schema.json",
  "title": "FilterOptions",
  "description": "Available filter options for a connector",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-connector-filters-api-openapi.yml#/components/schemas/FilterOptions",
  "type": "object",
  "properties": {
    "filters": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Filter field key used in API calls"
          },
          "displayName": {
            "type": "string",
            "description": "Human-readable label shown in the UI"
          },
          "description": {
            "type": "string",
            "description": "Optional tooltip / help text for the filter"
          },
          "filterType": {
            "type": "string",
            "enum": [
              "string",
              "boolean",
              "datetime",
              "list",
              "multiselect",
              "number"
            ],
            "description": "Data type of the filter value"
          },
          "category": {
            "type": "string",
            "enum": [
              "sync",
              "indexing"
            ],
            "description": "`sync` filters control which source records are fetched; `indexing` filters control which content types are indexed.\n"
          },
          "required": {
            "type": "boolean",
            "description": "Whether the user must supply a value for this field"
          },
          "defaultValue": {
            "description": "Pre-filled value rendered in the UI (type varies by filterType)"
          },
          "defaultOperator": {
            "type": [
              "string",
              "null"
            ],
            "description": "Operator pre-selected in the UI. Null means no operator is pre-selected."
          },
          "noImplicitOperatorDefault": {
            "type": "boolean",
            "description": "When `true` the frontend must not fall back to the first available operator when `defaultOperator` is null (e.g. date-range fields where an empty state is meaningful). Only present when `true`.\n"
          },
          "operators": {
            "type": "array",
            "description": "Allowed operators for this filter type",
            "items": {
              "type": "string"
            }
          },
          "optionSourceType": {
            "type": "string",
            "enum": [
              "manual",
              "static",
              "dynamic"
            ],
            "description": "`static` — options are embedded in the schema; `dynamic` — options must be fetched via `GET /connectors/{connectorId}/filters/{filterKey}/options`.\n"
          },
          "options": {
            "type": "array",
            "description": "Static options (only present when `optionSourceType` is `static`)",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}