-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
types/dynamicpb: add support for dynamic messages #199
Comments
I like using https://github.com/katydid/katydid/blob/master/parser/proto/proto.go#L121 |
I have a proof-of-concept of this working in a fork |
@abe-winter Awesome :) IIt would be great if it wouldn't depend on cgo, though. Is there a reason you didn't use descriptors in proto-encoding? |
@Merovius the output of ParseSchema is a FileDescriptorProto, and all the downstream code uses the proto. My use case requires schema parsing. An alternative is to shell out to the protoc program, but then protoc needs to be installed everywhere. Would it make sense to set a |
☝️ I was wrong above -- I'm already relying on libprotobuf being installed, might as well rely on protoc. I'll move schema parsing to its own package so it's truly optional. |
Great, I think it's a good idea to have the schema-parsing in a separate package. Another change I would suggest, is to add a |
Hmm. You have two points here:
|
I've been working on something related to this, to be able to use the service reflection to build clients. I haven't gotten to a point of implementing the equivalent of |
FWIW, I have an all-Go implementation of dynamic messages: It's not 100% yet -- mainly missing useful support for proto3 well-known-types and knobs for better controlling JSON output (for example). I'd say it's currently beta-quality right now -- not a lot of miles on it other than the tests, and there are several TODOs for more tests (though a lot of the code does get exercised by the tests that are present). The It can't yet be used with the Of course, APIs that accept a |
Placing on hold until #364 is complete. |
Work on #364 is in full swing and support for dynamic messages is planned. |
This is fixed in the v1.20.0 release. See the |
Since gRPC now has support for server-side reflection (https://github.com/grpc/grpc-go/tree/master/reflection, basically
stubby ls
) it would be able to process dynamic messages in Go.I'd be interested in adding this support either in
protobuf
or in an outside, but would probably need some restructuring inprotobuf
itself: e.g. allowing to use the same encoding/decoding methods but with the schema driven from aFileDescriptorProto
instead of Golang tags.The text was updated successfully, but these errors were encountered: