Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect encoding #77

Open
senthilkumarv opened this issue Jul 25, 2017 · 1 comment
Open

Incorrect encoding #77

senthilkumarv opened this issue Jul 25, 2017 · 1 comment

Comments

@senthilkumarv
Copy link

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

@bitwalker
Copy link
Owner

I'm a bit unclear what exprotobuf should be doing here - do you have a reference to the spec for this, and perhaps a bit more detail pointing out what is different and what you think exprotobuf should be doing? It may be the case that this is something which needs to be addressed in gpb, but I'll definitely take a look at this if I know a bit more about what's wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants