diff --git a/src/Protobuf/Response/Response.php b/src/Protobuf/Response/Response.php index 9746de5..c942d3d 100644 --- a/src/Protobuf/Response/Response.php +++ b/src/Protobuf/Response/Response.php @@ -41,6 +41,9 @@ public static function jsonDeSerialize(mixed $data): static $payload = Parser::deserializeMessage([Payload::class, 'decode'], $data); $json = Json::decode($payload->getBody()->getValue()); + if(!isset($json['success'])){ + $json['success'] = $json['errorCode'] === 0; + } $class = Mapping::$mappings[$payload->getMetadata()->getType()] ?? null; if (! $class) { return new static(...self::namedParameters($json));