I think you want to use the FileDescriptorProto
<https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto#L61>,
specifically it's options
<https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto#L79>
field.
On Sunday, December 18, 2022 at 5:52:04 AM UTC-8 vignesh suresh wrote:
> I have a proto with the following definitions.
>
> import "google/protobuf/descriptor.proto";
>
> extend google.protobuf.FieldOptions{
> optional bool is_key = 50002;
> }
>
> message Foo{
> int64 id = 1 [(is_key) = true];
> }
>
> I generated a .desc file for the above. I was able to access all the
> Fields and Message defined by the FieldDescriptorProto and DescriptorProto
> types but not sure how to access the options defined and the value provided
> to it in this case is_key.
>
> is there a java version that could access the field options from the .desc
> file
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/3c556daa-64c7-4467-b310-a3c3db73a8b8n%40googlegroups.com.