in src/main/java/com/epam/digital/data/platform/restapi/core/converter/EntityConverter.java [113:127]
private Map<String, Object> listsToStrings(Map<String, Object> entityMap) {
return entityMap.entrySet().stream()
.filter(entry -> entry.getValue() instanceof List)
.map(entry -> {
var list = (List<?>) entry.getValue();
if(!list.isEmpty() && list.get(0) instanceof LinkedHashMap) {
var listOfStrings = ((List<LinkedHashMap>)entry.getValue()).stream()
.map(this::toCompatibleStringWithInnerMap)
.collect(Collectors.toList());
entry.setValue(listOfStrings);
}
return Map.entry(entry.getKey(), toCompatibleString((Collection<?>) entry.getValue()));
})
.collect(Collectors.toMap(Entry::getKey, Entry::getValue));
}