Skip to content
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

Example of how to use existing proto types #11

Open
billonahill opened this issue Jun 25, 2019 · 1 comment
Open

Example of how to use existing proto types #11

billonahill opened this issue Jun 25, 2019 · 1 comment

Comments

@billonahill
Copy link

I'm trying to create a DynamicSchema that includes an existing proto message type that has been previously defined, compiled and included in my classpath. Could you show how to do that?

@os72
Copy link
Owner

os72 commented Jul 7, 2019

DynamicSchema is actually used as alternative to compiled protoc-generated types. You would obtain dynamic type builders (not generated ones) and build DynamicMessage objects:
https://github.com/os72/protobuf-dynamic/blob/master/src/test/java/com/github/os72/protobuf/dynamic/DynamicSchemaTest.java#L34

But you could compile your protos into a schema descriptor, include that in classpath, and create a DynamicSchema from that:
https://github.com/os72/protobuf-dynamic/blob/master/src/test/java/com/github/os72/protobuf/dynamic/DynamicSchemaTest.java#L254

Does this help? (I'm not quite sure what your usecase is)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants