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 : https://github.com/WannesFransen1994/ex_cucumber_messages . 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

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
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 Postg...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New

We're in Beta

About us Mission Statement