Skip to content

PaginatedMarketsResult.total is optional in TypeScript but required in Python #170

@realfishsam

Description

@realfishsam

Drift

The total field on PaginatedMarketsResult is optional in TypeScript but required (non-nullable) in Python.

TypeScript SDK

sdks/typescript/pmxt/models.ts, lines 216–225:

export interface PaginatedMarketsResult {
    data: UnifiedMarket[];
    total?: number;       // ← optional
    nextCursor?: string;
}

Python SDK

sdks/python/pmxt/models.py, lines 334–345:

@dataclass
class PaginatedMarketsResult:
    data: "List[UnifiedMarket]"
    total: int            # ← required, no default
    next_cursor: Optional[str] = None

Expected

Both SDKs should agree on nullability. If the server does not always return a total count, total should be Optional[int] = None in Python. If it is always present, TypeScript should remove the ?.

Impact

Python code will raise a TypeError at construction time if the server omits total, while TypeScript code handles the absence gracefully. Users who test with TypeScript and deploy Python (or vice versa) will encounter unexpected runtime failures.


Found by automated SDK cross-language drift audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions