WFransen

WFransen

Ex_protobuf not parsing proto file

Hello,

Trying to use the exprotobuf library, but get the following error message:

defmodule Messages do
  use Protobuf,
    from: Path.expand("/home/wannes/Documents/ex_cucumber_message/messages.proto")

  # use_package_names: true,
  # namespace: :"Elixir"
end

> $ mix compile                                                                                         
Compiling 1 file (.ex)

== Compilation error in file lib/cucumber_messages/messages.ex ==
** (CaseClauseError) no case clause matching: %Protobuf.Field{fnum: 1, name: :name, occurrence: :defaulty, opts: [], rnum: 2, type: :string}
    lib/exprotobuf/define_message.ex:147: Protobuf.DefineMessage.define_trivial_typespec_fields/2
    lib/exprotobuf/define_message.ex:135: Protobuf.DefineMessage.define_trivial_typespec/1
    lib/exprotobuf/define_message.ex:54: Protobuf.DefineMessage.def_message/3
    lib/exprotobuf/builder.ex:135: anonymous fn/6 in Protobuf.Builder.generate/2
    (elixir 1.10.3) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/exprotobuf/builder.ex:82: Protobuf.Builder.generate/2
    (stdlib 3.13) erl_eval.erl:680: :erl_eval.do_apply/6
    (stdlib 3.13) erl_eval.erl:449: :erl_eval.expr/5

I’ve put the code at : GitHub - WannesFransen1994/ex_cucumber_messages · GitHub . The proto file is messages.proto .

Note: The proto file can be parsed with the ahamez/protox library, which appears to be more performant but does require compile-time external dependencies. Hence my slight personal preference to exprotobuf, if it compiles.

Thank you in advance.

Most Liked

hauleth

hauleth

Just out of the interest - why not use Elixir-native implementations of Gherkin parser and/or full Cucumber-like BDD testing libraries? For example there is mine Watermelon library.

Where Next?

Popular in Questions Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New

We're in Beta

About us Mission Statement