Skip to content

encoding.json Marshallers for some of the well known types #169

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

Closed
rohitsaboo opened this issue Apr 13, 2016 · 3 comments
Closed

encoding.json Marshallers for some of the well known types #169

rohitsaboo opened this issue Apr 13, 2016 · 3 comments

Comments

@rohitsaboo
Copy link

Right now, the only way to support transformation of the well known types between proto and json is jsonpb and unfortunately, some well known types such as Struct and Values are not yet supported for transforming from json to proto. (Also, while I haven't investigated this, others have reported here that jsonpb is ~6x slower.)

It will be useful to have some marshallers and unmarshalers for some of the simpler, more commonly used well known types so that one can use these with encoding.json.

If the proposal sounds good, I can create changelists for a few of these well known types.

@bcmills
Copy link
Contributor

bcmills commented Nov 16, 2016

Arguably all generated message types ought to implement json.Marshaler and json.Unmarshaler (calling jsonpb under the hood). But that's a separate issue; I don't think adding a special-case for WKTs is appropriate.

@cybrcodr
Copy link
Contributor

Support for WKT have been implemented in 18c9bb3

@cybrcodr
Copy link
Contributor

Sorry, I missed out the subtle wording here for referring to encoding/json.Marshaler. I closed this bug as 18c9bb3 added support for WKT in jsonpb.

bcmills@ did file related issue #256 for supporting the general case of using encoding/json.

@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants