[protobuf] How to workaround enum sibling issue in Java

2018-07-20 Thread jiandai via Protocol Buffers
Hi there, I am creating a protobuf message to match with a JSON data in legacy application. The problem is that legacy JSON has mulitple enum data, and some of them have the same enum name, like "NONE". I know protobuf requires enum name uniqueness on the scope of package and protobuf

Re: [protobuf] How to generate FileDescriptor Object which has custom options?

2018-07-20 Thread Josh Humphries
The issue is that when you access the descriptor that way, it does not know about the custom options. You need to create an ExtensionRegistry. You'll also need the Java code produced from the annotations.proto file: that generated code will have a way to access the extensions (to add them to your

[protobuf] How to generate FileDescriptor Object which has custom options?

2018-07-20 Thread Ankit Patel
Hi All, I have a simple .proto file syntax = "proto3"; package helloworld.v1; option java_package = "helloworld.v1"; option java_multiple_files = true; import "google/api/annotations.proto"; service HelloWorldService { rpc sayHello (SayHelloRequest) returns (SayHelloResponse) { option