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
Where :name exists in the original struct, but :custom_property is calculated in same named function.
If I try to use sparse fields that include the custom property via e.g. fields[record]=custom-property, it breaks when trying to convert from dashed to underscored key value while building the attributes (error details below).
defsafe_atom_list(field_str)dofield_str|>String.split(",")|>Enum.map(&JaSerializer.ParamParser.Utils.format_key/1)# <---- this is the fix|>Enum.map(&String.to_existing_atom/1)end
After that, it all seems to be working fine. I can turn this into a PR, but I am not sure if this is the right place to fix the issue.
@elvanja sorry I haven't had a chance to look at this yet. It seems like this should affect any sparse field name that needs to get converted from dashes to underscore. If the regular (non-custom) property name has an underscore, does that break too?
I have a serializer defined like this:
Where
:name
exists in the original struct, but:custom_property
is calculated in same named function.If I try to use sparse fields that include the custom property via e.g.
fields[record]=custom-property
, it breaks when trying to convert from dashed to underscored key value while building the attributes (error details below).A fix for this is to just apply formatting while doing the conversion. E.g. in JaSerializer.Builder.Utils.safe_atom_list/1:
After that, it all seems to be working fine. I can turn this into a PR, but I am not sure if this is the right place to fix the issue.
And, here is the stack trace:
The text was updated successfully, but these errors were encountered: