-
Notifications
You must be signed in to change notification settings - Fork 599
Need descriptor for in memory proto schema #2318
Unanswered
vickydahiya
asked this question in
Q&A
-
I have an in-memory proto schema which I am reading from the schema registry. I am looking for a way or the best way if there are more than one, to get the descriptor for this schema. How can I do that? I am new to protobuf and pardon me if the provided information is not sufficient, but I can provide any required additional details.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
You could use SchemaEncoder and do something like
val schemaEncoder = SchemaEncoder(schema) val fileDescriptorSet = FileDescriptorSet.newBuilder() .addAllFile(schema.protoFiles.map { FileDescriptorProto.parseFrom( schemaEncoder.encode(it).toByteArray() ) }) .build()
I'm not sure why SchemaEncoder is under an internal package but it should work.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment