php protobuf uint64 is converted to negative number

Viewed 23

I have this proto definition

message Product {
    uint64 id = 1;
    uint64 order_id = 2;
}

then build the response in PHP

(new Product())
->setId(3)
->setOrderId(3875412541)

what I get then is

{
  "id": 3,
  "order_id": -419554755
}

the order id in this example is 10 characters long. Starting from 11 characters I get

13 INTERNAL: Failed to parse server response

it only works if the order_id is 8 characters long

{
  "id": 3,
  "order_id": 38754125
}
0 Answers
Related