Browse Source

Fixed version issue.

pull/183/merge
Kalle Stenflo 9 years ago
parent
commit
fdc4e020d2
  1. 8
      json-path/src/main/java/com/jayway/jsonpath/spi/mapper/JsonOrgMappingProvider.java

8
json-path/src/main/java/com/jayway/jsonpath/spi/mapper/JsonOrgMappingProvider.java

@ -33,16 +33,18 @@ public class JsonOrgMappingProvider implements MappingProvider {
List<Object> mapped = new ArrayList<Object>(); List<Object> mapped = new ArrayList<Object>();
JSONArray array = (JSONArray) source; JSONArray array = (JSONArray) source;
for (Object o : array) { for (int i = 0; i < array.length(); i++){
mapped.add(mapToObject(o)); mapped.add(mapToObject(array.get(i)));
} }
return mapped; return mapped;
} }
else if (source instanceof JSONObject){ else if (source instanceof JSONObject){
Map<String, Object> mapped = new HashMap<String, Object>(); Map<String, Object> mapped = new HashMap<String, Object>();
JSONObject obj = (JSONObject) source; JSONObject obj = (JSONObject) source;
for (String key : obj.keySet()) { for (Object o : obj.keySet()) {
String key = o.toString();
mapped.put(key, mapToObject(obj.get(key))); mapped.put(key, mapToObject(obj.get(key)));
} }
return mapped; return mapped;

Loading…
Cancel
Save