Firstly, thank you for this library! Hopefully this will all make sense but essentially we're trying to use which-one-of and one-of with a snake-case field and we're getting actual: java.lang.IllegalArgumentException: Cannot check which one-of for :snakey_field. We're using the default :key-name-fn in our defmapper by not specifying anything.
If you take the example people.proto and alter the Address message to change the home field to be home_details:
message Address {
string city = 1;
string street = 2;
int32 house_num = 3;
oneof home_details {
House house = 4;
Apartment apartment = 5;
}
UUID address_id = 6;
}
And alter the one-of-testhere to attempt to use the new home_details field:
The test will start failing with the above IllegalArgumentException as it's trying to look for :home-details in the proto-map rather than :home_details. one-of will also fail similarly if the field name inside the oneof is also snake-case.
I think the bug comes from this line and that should be using the :key-name-fn from the respective mapper in some way. It looks like this might be a bit more than minor surgery to solve this using my limited knowledge of the project so I thought I should at least report it to get some ideas on how best to solve it.
Firstly, thank you for this library! Hopefully this will all make sense but essentially we're trying to use
which-one-of
andone-of
with a snake-case field and we're gettingactual: java.lang.IllegalArgumentException: Cannot check which one-of for :snakey_field
. We're using the default:key-name-fn
in ourdefmapper
by not specifying anything.If you take the example
people.proto
and alter theAddress
message to change thehome
field to behome_details
:And alter the
one-of-test
here to attempt to use the newhome_details
field:The test will start failing with the above
IllegalArgumentException
as it's trying to look for:home-details
in the proto-map rather than:home_details
.one-of
will also fail similarly if the field name inside theoneof
is also snake-case.I think the bug comes from this line and that should be using the
:key-name-fn
from the respective mapper in some way. It looks like this might be a bit more than minor surgery to solve this using my limited knowledge of the project so I thought I should at least report it to get some ideas on how best to solve it.