Skip to content

list_orders errors with missing properties on order model #9

@badokun

Description

@badokun

The order model requires these properties for the serialisation to ListOrdersResponse

   post_only: bool
    order_edit_history: []
    is_raise_exact: bool
    display_size: str

Reference:

def list_orders(self, request: ListOrdersRequest) -> ListOrdersResponse:
        path = f"/portfolios/{request.portfolio_id}/orders"
...
 response = self.client.request("GET", path, query=query_params, allowed_status_codes=request.allowed_status_codes)
        return ListOrdersResponse(response.json())

Error:

lib/python3.12/site-packages/prime_sdk/base_response.py", line 59, in __post_init__
    parsed_list = [inner_type(**item) for item in raw_value]
                   ^^^^^^^^^^^^^^^^^^
TypeError: Order.__init__() got an unexpected keyword argument 'post_only'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions