syntax = "proto3";
import "google/protobuf/descriptor.proto";
extend google.protobuf.EnumValueOptions {
optional uint32 my_enum_value_option = 50005;
}
enum MyEnum {
UNKNOWN = 0;
FOO = 1 [(my_enum_value_option) = 321];
BAR = 2;
}
protoc -I . --elixir_out=gen_descriptors=true:. --plugin=/Users/alirezasharifianzadeh/.asdf/installs/elixir/1.11.1/.mix/escripts/protoc-gen-elixir *.proto
defmodule MyEnum do
@moduledoc false
use Protobuf, enum: true, syntax: :proto2
@type t :: integer | :UNKNOWN | :FOO | :BAR
def descriptor do
# credo:disable-for-next-line
Elixir.Google.Protobuf.EnumDescriptorProto.decode(
<<10, 6, 77, 121, 69, 110, 117, 109, 18, 11, 10, 7, 85, 78, 75, 78, 79, 87, 78, 16, 0, 18,
11, 10, 3, 70, 79, 79, 16, 1, 26, 2, 8, 0, 18, 7, 10, 3, 66, 65, 82, 16, 2>>
)
end
field :UNKNOWN, 0
field :FOO, 1
field :BAR, 2
end
%Google.Protobuf.EnumDescriptorProto{
name: "MyEnum",
options: nil,
reserved_name: [],
reserved_range: [],
value: [
%Google.Protobuf.EnumValueDescriptorProto{
name: "UNKNOWN",
number: 0,
options: nil
},
%Google.Protobuf.EnumValueDescriptorProto{
name: "FOO",
number: 1,
options: %Google.Protobuf.EnumValueOptions{
deprecated: false,
uninterpreted_option: []
}
},
%Google.Protobuf.EnumValueDescriptorProto{
name: "BAR",
number: 2,
options: nil
}
]
}
Hi, I am trying to parse this proto file:
with this command:
But the output does not contain my_enum_value_option value!
Here is the elixir output: