Skip to content
Advertisement

Tag: jayway

How to get path for child in Array[String] returned by Jayway

I have nested json data, like so: And I am using the jayway jsonpath library in Scala to parse it. I could use something like JsonPath.read(myData,”$.libraries[*].genres[*].books[*]”) to get an array of all the books pooled from every library. What I want is to know the path for each book, e.g. “$.libraries(0).genres(1).books(0)”. Is there a ways to get an array of

Advertisement