deep_pick
deep_pick copied to clipboard
How to convert value when picking a Map<String, MyObject>
I have a json object that includes a standard map/dictionary with string keys and values I'd like to convert to instances of MyObject. How can I do that? I see something similar to what I think I need for lists with .asListOrNull(SomeObject.fromPick)
but how do I do something similar when I want to pull out a Map?
Good point, .asMapOrNull
is missing a map
parameter as asListOrNull
offers.
I could imagine adding a mapValues
parameter.
I also just ran into this issue. it would be awesome to have a mapping callback.