bitwalker / bitwalker/exprotobuf

Support for :mapfields_as_maps

Open
#61 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
482
Forks
68
PR merge metrics
No merged PRs in 30d

Description

Hey there!

Recently I've opened an issue on [`grpc-elixir`](https://github.com/tony612/grpc-elixir/issues/9) trying to figure out a way to parse proto's maps as Elixir's maps rather than a list of tuples (default).

Taking a look at `exprotobuf` and `gpb`, I saw that the second [accepts an option](https://github.com/tomas-abrahamsson/gpb/blob/b2ed4c87f3f4629a1eb4bb24abc29b4263bc5ffd/src/gpb_compile.erl#L248) for such kind of map parsing. Then I tried to pass both options `[:mapfields_as_maps]` and `[{:maps, :mapfields_as_maps}]` to the [parse functions](https://github.com/bitwalker/exprotobuf/blob/master/lib/exprotobuf/parser.ex) but it didn't work as expected.

I couldn't find any test/spec covering this case so I'm just wondering how should I proceed to make use of this option and be able to use Elixir maps on my map fields.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.