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
It would be really nice if the value bar could be extracted from an instance of plugin.CodeGeneratorRequest. The value exists in plugin.CodeGeneratorRequest.ProtoFile.*.Options.XXX_InternalExtensions, however there's no way to access it - proto.GetExtensions requires a proto.ExtensionDesc, but the values returned by proto.ExtensionDescs and friends return values containing just the "Field" field, which causes a panic if passed to proto.GetExtensions. In theory the extensions could be registered by importing the generated code, but that can't be done dynamically.
WRT motivation for such a change, I'm working on a documentation generator and I would like to do things like:
Annotate fields as "private" to omit them from generated docs
Annotate fields for generating "fake" example data, ie string address = 1 [(generator) = "email"];
Annotate the authentication requirements of RPC services and methods
Annotate endpoints for RPC services
Annotate field / message validation constraints
The text was updated successfully, but these errors were encountered:
Support for plugins in general needs to be discussed. If we decide to provide first-class support for plugins, there will probably be an entire redesign.
It's possible there's a way to do this that I've just missed, but...
Given a custom option like so:
It would be really nice if the value
bar
could be extracted from an instance ofplugin.CodeGeneratorRequest
. The value exists inplugin.CodeGeneratorRequest.ProtoFile.*.Options.XXX_InternalExtensions
, however there's no way to access it -proto.GetExtensions
requires aproto.ExtensionDesc
, but the values returned byproto.ExtensionDescs
and friends return values containing just the "Field" field, which causes a panic if passed toproto.GetExtensions
. In theory the extensions could be registered by importing the generated code, but that can't be done dynamically.WRT motivation for such a change, I'm working on a documentation generator and I would like to do things like:
string address = 1 [(generator) = "email"];
The text was updated successfully, but these errors were encountered: