You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a problem where we want to represent a date as an ISO format string in JSON, but we wish to use google.type.Date in protobuf. I'm using the JsonFormat tool to build the protobuf from the JSON, but this fails since it sees a string in the JSON but the mergeMessage method expects it to be a JsonObject.
So would you consider a change where people can register custom parsers, so that users can extend the JsonFormat to support any types?
My proposal would involve the following steps:
1, Expose WellKnownTypeParser as a public interface.
2. Make wellKnownTypePrasers in ParserImpl non-static, add constructor params.
3. Add a usingTypeParser() method to Parser
And analogous steps for Printer.
Would this be viable?
The text was updated successfully, but these errors were encountered:
My gut is that this won't fly. JsonFormat is designed to supprot a single consistent and reproducible JSON format for protos across languages, not as a general purpose converter between arbitrary JSON formats and protos. I don't think we want to add complexity to the API to support this. However this could be a viable third party library.
We have a problem where we want to represent a date as an ISO format string in JSON, but we wish to use
google.type.Date
in protobuf. I'm using theJsonFormat
tool to build the protobuf from the JSON, but this fails since it sees a string in the JSON but themergeMessage
method expects it to be aJsonObject
.So would you consider a change where people can register custom parsers, so that users can extend the JsonFormat to support any types?
My proposal would involve the following steps:
1, Expose
WellKnownTypeParser
as a public interface.2. Make
wellKnownTypePrasers
inParserImpl
non-static, add constructor params.3. Add a
usingTypeParser()
method toParser
And analogous steps for
Printer
.Would this be viable?
The text was updated successfully, but these errors were encountered: