there's a hand-rolled method to perform JSONPath-like traversals of serde Value classes, but it only supports object-style paths such as request.origin_x or route.traversal_summary.distance. but in the age of k-shortest path results, we now may have an array of routes or trees. to traverse to the traversal summary of the route at index 2, one should be able to provide the path route[2].traversal_summary.distance.
there's a hand-rolled method to perform JSONPath-like traversals of serde Value classes, but it only supports object-style paths such as
request.origin_x
orroute.traversal_summary.distance
. but in the age of k-shortest path results, we now may have an array of routes or trees. to traverse to the traversal summary of the route at index 2, one should be able to provide the pathroute[2].traversal_summary.distance
.fortunately, this has been solved: https://docs.rs/serde_json_path/latest/serde_json_path/
install this and swap it out for the custom traverse method.