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

Disable HTML Escaping in jsonpb? #484

Open
briansorahan opened this issue Sep 19, 2018 · 4 comments
Open

Disable HTML Escaping in jsonpb? #484

briansorahan opened this issue Sep 19, 2018 · 4 comments

Comments

@briansorahan
Copy link

Opening this for discussion.
Here is the golang/protobuf issue for the same topic golang/protobuf#407
Should gogo enable this?
Would be really nice to have.

@yinzara
Copy link

yinzara commented Jan 11, 2019

I agree. When exposing an external web service, many times you can't make any guarantee about who is consuming the service and their ability to handle unmarshalling data encoded this way.

@dsnet
Copy link

dsnet commented Jan 11, 2019

If gogo/protobuf messages implement the upcoming v2 message interface, the gogo/protobuf project wouldn't have to maintain their own version of jsonpb. In my opinion it is healthier for the Go protobuf ecosystem if the v2 jsonpb package worked for golang/protobuf generated messages, gogo/protobuf generated message, or even dynamic messages, so long as they satisfy the new message interface (which knows how to behaviorally describe itself).

The currently implementation of v2 jsonpb does not do HTML escaping (but could change). See my comment in: https://go-review.googlesource.com/c/protobuf/+/134495

@dsnet
Copy link

dsnet commented Jan 11, 2019

ability to handle unmarshalling data encoded this way.

I should also note that the escaped HTML characters is still fully compliant with RFC 7159, so this is still indicative of a bug with those clients.

antoniomo added a commit to antoniomo/protobuf that referenced this issue Jun 1, 2020
@antoniomo
Copy link

antoniomo commented Jun 1, 2020

For those looking for a solution, a possible workaround is #694. I'll also maintain this fork for use with the grpc-gateway: https://github.com/antoniomo/gateway

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

4 participants