How to navigate jsonMap object

Hello,
I have the need to select a random element from an array of json objects. I have taken the approach of putting all elements into an array then using an exec{} block to find a random element within the array. This then gives me a Treemap representation of the object. My trouble is, I am not sure the proper mechanism for traversing this object. Everything I have tried at runtime blows up so far. I need to access properties of this object that are at the top level and nested one level deep (ie an object member of the encapsulating object). What I have:

.exec(
http(“My Request”)
.post(“path to my endpoint)
.body(StringBody(payload”))
.check(jsonPath("$.topLevelObjectArray").ofType[Seq[Any]].saveAs(“myArray”))
)
.exec(session=> {
//I have all the elements
val allListings = session(“myArray”).as[Seq[Any]]
//this works fine. Although it’s an instance of org.boon.core.value.LazyValueMap
val entry = allListings(Random.nextInt(allListings.size))

//how do I access properties (key/values) on entry???
entry(“anystring”) //blows up with CastCastException

thank you,
Brandon

We plan on deep converting in a future version.
Until then, you are the one in charge of knowing the expected types of each node you’re traversing.
Here, you have a org.boon.core.value.LazyValueMap which implements java.util.Map. There’s no way you could be able to cast it into a Scala Seq.