bitwalker / exprotobuf

Protocol Buffers in Elixir made easy!
Apache License 2.0
486 stars 69 forks source link

Oneof string decoding into character list #71

Closed zmagajna closed 7 years ago

zmagajna commented 7 years ago

I have defined the structure as:

message Msg {      
        oneof x_present {
                                       string x = 2;
        }
}

When i create new message for this structure as a string the decoding is returning the character list

iex(3)> msg = Messages.Msg.new(x_present: {:x, “aaa”})
%ProtoExample.Messages.Msg{x_present: {:x, “aaa”}}

iex(5)> msg |> Msg.encode |> Msg.decode
%ProtoExample.Messages.Msg{x_present: {:x, ‘aaa’}}

Is this right behavior or a bug?

bitwalker commented 7 years ago

Closed via PR :)