You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using inject alongside enumerations, the namespace of the enumeration modules is inconsistent, causing the call to get_default to error with a no match, coming from here.
Because of mismatch of the naming (MessageTest.Message.Status in the field vs :enum, :"Message.Status" in the key), when the field is looked up in proto3_type_default, lists:keyfind/3 returns false, rather than a match.
If you open a PR with a fix, I'll be happy to work with you on it there, I think we'll have to iterate on it a bit, but if you kick things off I can pick up where you leave off if time is an issue.
When using inject alongside enumerations, the namespace of the enumeration modules is inconsistent, causing the call to get_default to error with a no match, coming from here.
Reference protobuf
Example
Module
Defs
Because of mismatch of the naming (
MessageTest.Message.Status
in the field vs:enum, :"Message.Status"
in the key), when the field is looked up inproto3_type_default
,lists:keyfind/3
returns false, rather than a match.I was able to circumvent this by adding
use_module_namespace: true
, unfortunately this has the side effect of ignoring theinject
andonly
option, as there is no function clause that takes it into accountWhen not using inject, the field defs are generated as expected
Example
Module
Defs
I'm happy to make a pr solving this issue, but would like to get some feedback on the direction to take with this before making a pr.
The text was updated successfully, but these errors were encountered: