-
Notifications
You must be signed in to change notification settings - Fork 144
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
pbf ext.json field not mapped into the json_name
field property
#162
Comments
Hi @paulbalomiri! Let me try to address your questions.
No. JSON and Extensions are totally distinct features.
These https://github.com/syncthing/syncthing/blob/v1.18.0/proto/ext.proto Apparently, the
Since this is private to Syncthing's own implementation, I don't think we could safely support it in this lib. But let's hear what the maintainers have to say about it.
As mentioned above, these are specific to Syncthing, so I'd say no. To make it forward-compatible at the compiler level, they'd probably have to consider including both as part of an eventual migration strategy from custom JSON to built-in JSON: - repeated ObservedDevice ignored_devices = 7 [(ext.json) = "remoteIgnoredDevices", (ext.xml) = "remoteIgnoredDevice"];
+ repeated ObservedDevice ignored_devices = 7 [json_name = "remoteIgnoredDevices", (ext.json) = "remoteIgnoredDevices", (ext.xml) = "remoteIgnoredDevice"]; |
Thanks for the great explanations and context @britto. Agreed with everything you said. This is not something that we can safely implement in this library in a generic way. Sorry @paulbalomiri! Thanks for the report either way 💟 |
Thanks @britto & sorry to have completely overlooked this issue. When i get back to this I'll have to look into it again. I ended up transforming the protobuf definition source files to make Thank you for this lib! |
Some context info first:
the proto definitions contain the
ext.json
extension variables for the json encoding, which is used to serve the Rest endpoints. The spec files look like this:the json extension property on field names, however, is not used for code generated which looks like this:
I have read the initial JSON proposal and am using the JSON functionality of the lib.
Questions
Protobuf.JSON
thought to be an extension in the sense of Extensions #14 ?ext
as inext.json
from the pb codequote. the extension name or a general holder for field/message variables of various extensionsext.json
intoProtobuf.JSON
(& friends in modules sharing theProtobuf.JSON
name prefix) ?The text was updated successfully, but these errors were encountered: