Closed drumcircle closed 5 years ago
In this document, metricValues is a Map<string,double>.
"metricValues": { "metric1": 10.977, "metric2": 0.062111801242236024 }
Variations of this expression:
Collection<Object> metricValues = surfer.collectAll(json, "$.body.metricValues.*");
<Object>
Are pulling up the numbers (10.977) but not the keys ("metric1").
I've tried to cast to maps, classes with name-value, etc.
Suggestions?
You can use this API to get current field name in JsonPathListener: https://github.com/jsurfer/JsonSurfer/blob/master/jsurfer-core/src/main/java/org/jsfr/json/ParsingContext.java#L65
In this document, metricValues is a Map<string,double>.
"metricValues": { "metric1": 10.977, "metric2": 0.062111801242236024 }
Variations of this expression:
Collection
<Object>
metricValues = surfer.collectAll(json, "$.body.metricValues.*");Are pulling up the numbers (10.977) but not the keys ("metric1").
I've tried to cast to maps, classes with name-value, etc.
Suggestions?