Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Need descriptor for in memory proto schema #2318

Unanswered
vickydahiya asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /