googleapis / gax-php

Google API Extensions for PHP
http://googleapis.github.io/gax-php/
BSD 3-Clause "New" or "Revised" License
237 stars 52 forks source link

feat: Add a custom encoder in Serializer #554

Closed saranshdhingra closed 6 months ago

saranshdhingra commented 6 months ago

While instantiating a Serializer we can pass a custom encoder as the last argument. When present, a proto will be converted into an array using the custom function(encoder) supplied instead of the encodeMessage method in the Serializer class.

Essentially this provides a way to short-circuit the encodeMessage method.