sstableinfo: Fix deserizalization of "properties"

Refs #76

Since the incoming json uses swagger "key", "value" syntax
we need to do explicit deserialization of this property
as well (not just extended props).

Message-Id: <20190930115432.27801-1-calle@scylladb.com>
This commit is contained in:
Calle Wilund 2019-09-30 11:54:33 +00:00 committed by Pekka Enberg
parent dc7f37b901
commit f915f8fc7a

View File

@ -118,6 +118,17 @@ public class SSTableInfo {
this.extendedProperties = extendedProperties; this.extendedProperties = extendedProperties;
} }
@JsonProperty("properties")
private void unpackProperties(List<Map<String, String>> maps) {
Map<String, String> result = new HashMap<>();
for (Map<String, String> map : maps) {
String key = map.get("key");
String value = map.get("value");
result.put(key, value);
}
properties = result;
}
@JsonProperty("extended_properties") @JsonProperty("extended_properties")
private void unpackNested(List<Map<String, Object>> properties) { private void unpackNested(List<Map<String, Object>> properties) {
Map<String, Map<String, String>> result = new HashMap<String, Map<String, String>>(); Map<String, Map<String, String>> result = new HashMap<String, Map<String, String>>();