Environment
- maxapi-python: 2.4.0
- Python: 3.12
- Client: WebClient
Problem
Calling get_reactions() sends messageIds as strings:
payload={'chatId': -72218689395283, 'messageIds': ['117093598374465578']}
MAX rejects the request:
proto.payload: Expected number at 30 (Ошибка валидации)
After this response, the WebSocket connection is closed. This can interrupt unrelated work such as chat synchronization.
Cause
GetReactionsPayload currently declares:
class GetReactionsPayload(CamelModel):
chat_id: int
message_ids: list[str]
Other message payloads and the MAX endpoint expect numeric message IDs.
Expected fix
Change the field to:
The service method annotation should be changed to list[int] as well.
I verified locally that coercing these IDs to integers produces the expected MessagePack number type
Environment
Problem
Calling
get_reactions()sendsmessageIdsas strings:MAX rejects the request:
After this response, the WebSocket connection is closed. This can interrupt unrelated work such as chat synchronization.
Cause
GetReactionsPayloadcurrently declares:Other message payloads and the MAX endpoint expect numeric message IDs.
Expected fix
Change the field to:
The service method annotation should be changed to
list[int]as well.I verified locally that coercing these IDs to integers produces the expected MessagePack number type