deep_pick icon indicating copy to clipboard operation
deep_pick copied to clipboard

How to convert value when picking a Map<String, MyObject>

Open chrishibler opened this issue 3 years ago • 2 comments

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?

chrishibler avatar Feb 01 '22 20:02 chrishibler

Good point, .asMapOrNull is missing a map parameter as asListOrNull offers.

I could imagine adding a mapValues parameter.

passsy avatar Feb 01 '22 20:02 passsy

I also just ran into this issue. it would be awesome to have a mapping callback.

clragon avatar Jan 20 '24 01:01 clragon