{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oxfordledge-com/json-schema/oxfordledge-com-bdcholdings-response-schema.json",
  "title": "BDCHoldingsResponse",
  "description": "`GET /api/bdc/holdings` response. F4 schema-tightening + correction\n(2026-04-30): `bdcTicker` and `holdings` REQUIRED. Previously declared\n`ticker` (snake_case) but handler returns `bdcTicker` (camelCase) plus\na richer set of stat fields (filingDate, filingType, periodEnd,\ntotalHoldings, totalParAmount, totalFairValue, weightedAvgPrice,\nbyLienPosition, topIndustries, portfolioStructure). Schema rewritten\nto match handler's actual wire format.\n\nF9 (2026-04-30 PM): added `data_source` + `fetched_at` for\nfreshness disclosure. The audit's persona Priya specifically\nflagged that BDC SOI data is filed quarterly, so on any given\nday the current view could be 0–90 days stale. Pre-F9 the page\ndidn't display the as-of date — undermined the differentiated-\ndata value prop. `filing_date` was already in the schema; F9\nadds the source attribution + the request-time fetched_at so\nthe frontend can render \"Source: SEC EDGAR · Filed YYYY-MM-DD ·\nFetched HH:MM ET\" above the panel.\n\nNO PAYWALL (corrected 2026-09-22, annotated not rewritten): this\ndocstring claimed a \"3-row teaser + `locked: true` overlay + `upgrade`\nmetadata\" until today, three months after that truncation was REMOVED\n(2026-06-12 OWNER QA + SF-MONETIZATION-V3). `locked` / `lockedTotal` /\n`upgrade` stay declared below, Optional and never written, as the\nDEFENSIVE shape the client reads against an older deploy. The 500\nfallback is `{bdcTicker, holdings: [], error}` (ErrorResponse).\n\nPAGING (2026-09-22): `page` + `completeness` ride ONLY when the caller\ndeclared `limit` / `offset`, so both are Optional and an undeclared call\nis unchanged. They page `holdings` alone; every filing-level figure above\nstays computed over the store's whole population.\n\nFrontend BDC holdings panel reads `data.bdcTicker` for the header\n+ iterates `data.holdings.forEach(...)` for the holdings table.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/oxfordledge-com-api-openapi.yml#/components/schemas/BDCHoldingsResponse",
  "properties": {
    "bdcTicker": {
      "type": "string",
      "title": "Bdcticker"
    },
    "holdings": {
      "items": {
        "$ref": "#/$defs/BDCHolding"
      },
      "type": "array",
      "title": "Holdings"
    },
    "bdcName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bdcname"
    },
    "dataSource": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Datasource"
    },
    "fetchedAt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fetchedat"
    },
    "filingDate": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filingdate"
    },
    "filingType": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filingtype"
    },
    "periodEnd": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Periodend"
    },
    "totalHoldings": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Totalholdings",
      "description": "REGISTRY count of parsed positions -- the population totalFairValue / byLienPosition / portfolioStructure cover. NOT len(holdings): the served list drops non-identity borrower cells (see holdingsReturned / nonBorrowerRowsExcluded)."
    },
    "holdingsReturned": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Holdingsreturned",
      "description": "len(holdings) as served: totalHoldings minus the rows the non-identity borrower filter dropped."
    },
    "nonBorrowerRowsExcluded": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Nonborrowerrowsexcluded",
      "description": "Rows read from the store but NOT served because their borrower cell carries no issuer identity (SOI section labels, bare legal suffixes, security-description text). Their fair value is still inside totalFairValue and the portfolio percentages."
    },
    "excludedRowsFairValue": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Excludedrowsfairvalue",
      "description": "Sum of fairValue over the excluded rows: sum(holdings[].fairValue) + this == parsedRowSumFairValue (or totalFairValue on a parsed-rows basis)."
    },
    "totalParAmount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Totalparamount"
    },
    "totalFairValue": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Totalfairvalue"
    },
    "fairValueReconciliation": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fairvaluereconciliation",
      "description": "BDC QA 2026-10-27 P3-2: whether the parsed rows reconcile to the filer's own total -- {status, pctVsFilerTotal, filerTotalFairValue, note, short} (data/bdc_fv_arbiter.reconciliation_status)."
    },
    "weightedAvgPrice": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Weightedavgprice"
    },
    "byLienPosition": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bylienposition"
    },
    "topIndustries": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Topindustries"
    },
    "portfolioStructure": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Portfoliostructure"
    },
    "locked": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Locked"
    },
    "locked_total": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Locked Total"
    },
    "upgrade": {
      "anyOf": [
        {
          "$ref": "#/$defs/InsiderUpgrade"
        },
        {
          "type": "null"
        }
      ]
    },
    "page": {
      "anyOf": [
        {
          "$ref": "#/$defs/BDCHoldingsPage"
        },
        {
          "type": "null"
        }
      ]
    },
    "completeness": {
      "anyOf": [
        {
          "$ref": "#/$defs/BDCHoldingsCompleteness"
        },
        {
          "type": "null"
        }
      ]
    },
    "weightedAvgPriceBasis": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Weightedavgpricebasis"
    },
    "unfundedRowCount": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unfundedrowcount"
    },
    "partlyFundedRowCount": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Partlyfundedrowcount"
    },
    "unfundedMarkNote": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unfundedmarknote"
    },
    "uniqueBorrowers": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Uniqueborrowers"
    },
    "uniqueBorrowersBasis": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Uniqueborrowersbasis"
    },
    "withheldFilings": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/BDCWithheldFiling"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Withheldfilings",
      "description": "Withheld (v271) filings newer than the one served -- skipped, never shown; present only when one exists (OWNER 2026-10-27)."
    },
    "fallbackFiling": {
      "anyOf": [
        {
          "$ref": "#/$defs/BDCFallbackFiling"
        },
        {
          "type": "null"
        }
      ],
      "description": "Present only when the newest filing is withheld and this is the filing before it: whether reportedTotalFairValue is THAT filing's own filer total (OWNER 2026-10-31)."
    },
    "bookStatus": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bookstatus",
      "description": "OWNER ruling 2026-11-04 #4: {status current|inactive|null, disposition archive|gone|redirect|null, successorTicker, lastFilingDate, totalWithheld, totalWithheldReason, note, withheldNote, withheldFilingDates} -- the inactive / withheld status and its note, from the sources /bdcs/<T>/ reads (data/bdc_book_status). A surface renders it; totalWithheld true means print no portfolio total."
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "bdcTicker",
    "holdings"
  ],
  "$defs": {
    "BDCFallbackFiling": {
      "properties": {
        "filingDate": {
          "type": "string",
          "title": "Filingdate"
        },
        "withheldFilingDate": {
          "type": "string",
          "title": "Withheldfilingdate"
        },
        "filerTotalKnown": {
          "type": "boolean",
          "title": "Filertotalknown"
        },
        "referenceSource": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Referencesource"
        },
        "referenceCapturedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Referencecapturedat"
        },
        "note": {
          "type": "string",
          "title": "Note"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "filingDate",
        "withheldFilingDate",
        "filerTotalKnown",
        "note"
      ],
      "title": "BDCFallbackFiling",
      "description": "`fallbackFiling` (OWNER ruling 2026-10-31): the BDC's newest stored\nfiling is withheld (v271), so the payload serves the filing BEFORE it.\n`filerTotalKnown` says whether `reportedTotalFairValue` is that served\nfiling's OWN filer total (from the v238 reconciliation snapshot,\n`referenceSource`); when false the figures are parsed rows, unreconciled,\nand `note` says why. Present ONLY on such a fallback\n(data/bdc_fallback_reference.py)."
    },
    "BDCHolding": {
      "properties": {
        "borrower": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Borrower"
        },
        "industry": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Industry"
        },
        "investment_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Investment Type"
        },
        "fair_value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fair Value"
        },
        "cost": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost"
        },
        "rate": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rate"
        },
        "maturity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Maturity"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "BDCHolding"
    },
    "BDCHoldingsCompleteness": {
      "properties": {
        "returned": {
          "type": "integer",
          "title": "Returned"
        },
        "limit": {
          "type": "integer",
          "title": "Limit"
        },
        "total_available": {
          "type": "integer",
          "title": "Total Available"
        },
        "complete": {
          "type": "boolean",
          "title": "Complete"
        },
        "completeness_basis": {
          "type": "string",
          "title": "Completeness Basis"
        },
        "rows_key": {
          "type": "string",
          "title": "Rows Key"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "returned",
        "limit",
        "total_available",
        "complete",
        "completeness_basis",
        "rows_key"
      ],
      "title": "BDCHoldingsCompleteness",
      "description": "The MCP-vocabulary completeness block that rides beside `page`.\n\nSupplied by the producer rather than left to a dispatcher default: with\nthe total KNOWN, a default that compares returned rows against `limit`\nwould call a full page \"at_cap_total_unknown\"."
    },
    "BDCHoldingsPage": {
      "properties": {
        "limit": {
          "type": "integer",
          "title": "Limit"
        },
        "offset": {
          "type": "integer",
          "title": "Offset"
        },
        "returned": {
          "type": "integer",
          "title": "Returned"
        },
        "total": {
          "type": "integer",
          "title": "Total"
        },
        "hasMore": {
          "type": "boolean",
          "title": "Hasmore"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "limit",
        "offset",
        "returned",
        "total",
        "hasMore"
      ],
      "title": "BDCHoldingsPage",
      "description": "The declared-page block on `GET /api/bdc/holdings`.\n\nPresent ONLY when the caller declared `limit` or `offset`; an undeclared\ncall is byte-for-byte the pre-paging wire. `total` is the SERVED row count\nbefore the slice (it equals `holdingsReturned`) -- the store's number, not\nthe page's, so `returned < total` is how a reader knows it holds a window.\nSame key set and meaning as the `search_bdc_borrower` page block, so a\nreader who has learned one BDC page block has learned both."
    },
    "BDCWithheldFiling": {
      "properties": {
        "ticker": {
          "type": "string",
          "title": "Ticker"
        },
        "filingDate": {
          "type": "string",
          "title": "Filingdate"
        },
        "note": {
          "type": "string",
          "title": "Note"
        },
        "quarterKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quarterkey"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "ticker",
        "filingDate",
        "note"
      ],
      "title": "BDCWithheldFiling",
      "description": "One entry of `withheldFilings` (OWNER ruling 2026-10-27 #2): a stored\nBDC filing the v271 display quarantine withholds, named because the\nrequest's scope included it. Present on /api/bdc/holdings, /api/bdc/soi and\n/api/bdc/borrower-mark-history ONLY when one is in scope; `note` is the\ndated public sentence (pg_db/queries/bdc_filing_quarantine.py)."
    },
    "InsiderUpgrade": {
      "properties": {
        "tier": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tier"
        },
        "tier_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tier Name"
        },
        "price": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Url"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Message"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "InsiderUpgrade"
    }
  }
}