Skip to content

Incorrect encoding #77

@senthilkumarv

Description

@senthilkumarv

I am have this schema

message Promo {
  string image = 1;
  string adUrl = 2;
  bool isAd = 3;
}

Used this data

promos=[Promo{image=https://djloboapp.com/main_images/djlobopromo_Android.jpg, isAd=false}, Promo{image=https://djloboapp.com/main_images/followDJLobo2_Android.jpg, adUrl=http://bit.ly/djloboinstagram, isAd=true}, Promo{image=https://djloboapp.com/main_images/djlobobooking_Android.jpg, isAd=false}]

Encoding this using exprotobuf produces

"=
9https://djloboapp.com/main_images/djlobopromo_Android.jpg"^
;https://djloboapp.com/main_images/followDJLobo2_Android.jpghttp://bit.ly/djloboinstagram"?
;https://djloboapp.com/main_images/djlobobooking_Android.jpg%

Any other implementation (I used google's implementation in Python & Golang) gives the following

";
9https://djloboapp.com/main_images/djlobopromo_Android.jpg"^
;https://djloboapp.com/main_images/followDJLobo2_Android.jpghttp://bit.ly/djloboinstagram"=
;https://djloboapp.com/main_images/djlobobooking_Android.jpg%

What is going wrong because of this:
I had no issues because of this until I decided to rewrite one part of the API in Go. The client was using Wire to decode response. Since Wire uses Boolean instead of boolean the response from any other library other than exprotobuf was making it null instead of false. Even though I wish other implementations follow what exprotobuf does, in current state, it does not follow the specification

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions