-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add Bytes and Enum handlers to proto3ConvertFuncs
#423
Comments
Bytes was implemented in: #489 |
@loderunner, thanks for implementing the bytes support. I've been wondering if anyone ever considered encoding bytes as a hex string instead of base64. I'd love to make this configurable. I've been digging through the different runtime.convert methods to see if there is any support for configuration in runtime.convert or in the ConvertFuncExpr.
But it looks like there isn't really anything that would do something similar. I might go ahead and propose an implementation but I've wanted to open the discussion here first to hear what you think. |
@lucasvo I went for base64 because it is the standard mapping for protobuf I'm curious as to how you would want to configure this. It seems to me the operation of the gRPC I'm interested in how you'd do this, keep me posted if you get started, and don't be shy to ask questions. |
Thanks for the comment @loderunner Having spent a bit more time with protobuf in the past couple days your argument makes sense. I didn't know the base64 encoding was a protobuf default. However one small detail I'm trying to fix is the padding: Is there a way to get it to accept a padded value or remove the padding from the json response body?
|
I agree. I first thought I'd use url-safe base64 encoding with no padding, to make sure we could send it in a URL. But I now think the discrepancy between the JSON body and the URL variable is unacceptable. We'll just have to make sure unsafe characters are correctly escaped. I won't be doing it right now, but if you want to check, I can give you a couple of pointers. You'll want to try replacing |
I can take care of changing this. I'll try to get a PR ready for this in the next couple of days. |
@loderunner Hey, I just tried to get
|
@loderunner would love to get your feedback on #565 ! |
This is an issue to track the TODO on this line in types.go.
The text was updated successfully, but these errors were encountered: