{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tickfeed-pro/json-schema/tickfeed-pro-gaps-response-schema.json",
  "title": "GapsResponse",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tickfeed-pro-openapi.json#/components/schemas/GapsResponse",
  "properties": {
    "symbol": {
      "type": "string",
      "title": "Symbol"
    },
    "timeframe": {
      "$ref": "#/$defs/Timeframe"
    },
    "stored_bars": {
      "type": "integer",
      "title": "Stored Bars"
    },
    "gaps": {
      "items": {
        "$ref": "#/$defs/GapOut"
      },
      "type": "array",
      "title": "Gaps"
    },
    "note": {
      "type": "string",
      "title": "Note",
      "default": "Gaps are computed from stored bars only and are never filled. 'expected' gaps are market closures per the symbol's schedule. Unexplained gaps can be holidays (not modelled), minutes with no ticks (common on M1), or missing data; the collector periodically re-requests them."
    }
  },
  "type": "object",
  "required": [
    "symbol",
    "timeframe",
    "stored_bars",
    "gaps"
  ],
  "$defs": {
    "GapOut": {
      "properties": {
        "after": {
          "type": "string",
          "format": "date-time",
          "title": "After",
          "description": "Open time of the last stored bar before the gap."
        },
        "before": {
          "type": "string",
          "format": "date-time",
          "title": "Before",
          "description": "Open time of the first stored bar after the gap."
        },
        "missing_bars": {
          "type": "integer",
          "title": "Missing Bars"
        },
        "expected": {
          "type": "boolean",
          "title": "Expected",
          "description": "True if every missing bar falls outside scheduled trading hours."
        },
        "unexplained_bars": {
          "type": "integer",
          "title": "Unexplained Bars",
          "description": "Missing bars inside scheduled trading hours."
        }
      },
      "type": "object",
      "required": [
        "after",
        "before",
        "missing_bars",
        "expected",
        "unexplained_bars"
      ],
      "title": "GapOut"
    },
    "Timeframe": {
      "type": "string",
      "enum": [
        "S1",
        "S5",
        "S15",
        "S30",
        "M1",
        "M5",
        "M15",
        "M30",
        "H1",
        "H4",
        "D1"
      ],
      "title": "Timeframe"
    }
  }
}