What version of protobuf and what language are you using?
Version: v3.13.0 / v4.0.0RC2
Language: PHP 7.2.20
OS: macOS Catalina 10.15.6 / Amazon Linux AMI release 2018.03

We have implemented the Google Maps Booking API proto which is proto3. The 
Reserve with Google team are requesting that we explicitly return some 
values but where we need the value to be 0. protobuf-php is returning an 
empty array when we call serializeToJsonString() for example 

namespace Ext\Maps\Booking\Feeds;

$cancellationPolicy = new CancellationPolicy;
$refundCondition = new CancellationPolicy\RefundCondition;

$refundCondition->setMinDurationBeforeStartTimeSec(0);
$refundCondition->setRefundPercent(0);

$cancellationPolicy->setRefundCondition([$refundCondition]);
echo $cancellationPolicy->serializeToJsonString();

will return 

{"refundCondition":[{}]}

while Reserve with Google are requesting it return 

{"refundCondition":[{"minDurationBeforeStartTimeSec":"0","refundPercent":0}]}

Looking at Google\Protobuf\Internal\Message I think returning an empty 
array would be the expected behaviour or is there something we can do 
change that? 

Thanks 

Gaz

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/b39b6e1b-79ba-429e-b4ba-5b6f09b46cc6n%40googlegroups.com.

Reply via email to