Skip to content

Commit

Permalink
fixed bug in FieldFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Apr 1, 2021
1 parent fc7d8ad commit 986e412
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ public void filter(ContainerRequestContext requestContext,
newEntity = getFilteredProperties(entity, fields);
} else if (entity instanceof Map) {
if (((Map) entity).containsKey("items")) {
newEntity = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> items = new ArrayList<>();
for (ParaObject item : (List<ParaObject>) ((Map) entity).get("items")) {
((List) newEntity).add(getFilteredProperties(item, fields));
items.add(getFilteredProperties(item, fields));
}
((Map) entity).put("items", newEntity);
((Map) entity).put("items", items);
newEntity = entity;
}
} else if (entity instanceof List) {
newEntity = new ArrayList<Map<String, Object>>();
Expand Down

0 comments on commit 986e412

Please sign in to comment.