bitwalker / bitwalker/exprotobuf
Support in .new for composite messages
- Dominant language
- Elixir
- Stars
- 482
- Forks
- 68
- PR merge metrics
- No merged PRs in 30d
Description
The library does not appear to instantiate children messages for a message which has other messages declared as an attribute. For example, using the Messages.Msg definition in the Readme, calling
``` elixir
Messages.Msg.new(version: :'V2', sub: [value: 2])
```
results in the following
```
iex(8)> msg = Messages.Msg.new(version: :'V2', sub: [value: 2])
%Messages.Msg{sub: [value: 2], version: :V2}
```
It appears that the value for "sub" is just taken at face value and assigned rather than interpreted as another set of values for a different type of message. I would expect that it could recurse through the embeded layers and construct the sub-message(s) as long as they are supplying values of the correct type.
Is there a better way to deal with this?
Thanks
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Messages.Msg definition in the README and reproduce the Messages.Msg.new(version: :'V2', sub: [value: 2]) example. Trace how .new handles the sub attribute and verify that nested values are converted into the appropriate child message while preserving the expected type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100