Drift
fetch_markets_paginated / fetchMarketsPaginated disagree on the sentinel value used for total when the server does not return that field. The Python implementation hard-codes 0 as the default, which is indistinguishable from a server-reported count of zero markets. The TypeScript implementation passes the raw value through, which becomes undefined when absent — matching the model declaration of total?: number.
TypeScript SDK
sdks/typescript/pmxt/client.ts, line 835:
return {
data: data.data.map(convertMarket),
total: data.total, // undefined when absent — matches PaginatedMarketsResult.total?: number
nextCursor: data.nextCursor,
};
sdks/typescript/pmxt/models.ts, line 234:
export interface PaginatedMarketsResult {
data: UnifiedMarket[];
total?: number; // explicitly optional
nextCursor?: string;
}
Python SDK
sdks/python/pmxt/client.py, line 814:
return PaginatedMarketsResult(
data=[_convert_market(m) for m in data.get("data", [])],
total=data.get("total", 0), # BUG: hardcodes 0, not None
next_cursor=data.get("nextCursor"),
)
sdks/python/pmxt/models.py, line 399:
@dataclass
class PaginatedMarketsResult:
data: List[UnifiedMarket]
total: Optional[int] = None # model says None, code passes 0
next_cursor: Optional[str] = None
Expected
Both SDKs should use None / undefined (not 0) when the server omits total, so callers can distinguish "server did not report a count" from "server reported zero markets". The fix in Python is total=data.get("total") (default None).
Impact
Any Python caller that checks if result.total == 0 to detect an empty result set will incorrectly treat a missing-total response as empty. Callers that guard on if result.total is not None to decide whether to display a count will receive a misleading 0.
Found by automated SDK cross-language drift audit
Drift
fetch_markets_paginated/fetchMarketsPaginateddisagree on the sentinel value used fortotalwhen the server does not return that field. The Python implementation hard-codes0as the default, which is indistinguishable from a server-reported count of zero markets. The TypeScript implementation passes the raw value through, which becomesundefinedwhen absent — matching the model declaration oftotal?: number.TypeScript SDK
sdks/typescript/pmxt/client.ts, line 835:sdks/typescript/pmxt/models.ts, line 234:Python SDK
sdks/python/pmxt/client.py, line 814:sdks/python/pmxt/models.py, line 399:Expected
Both SDKs should use
None/undefined(not0) when the server omitstotal, so callers can distinguish "server did not report a count" from "server reported zero markets". The fix in Python istotal=data.get("total")(defaultNone).Impact
Any Python caller that checks
if result.total == 0to detect an empty result set will incorrectly treat a missing-total response as empty. Callers that guard onif result.total is not Noneto decide whether to display a count will receive a misleading0.Found by automated SDK cross-language drift audit