Skip to content

Commit

Permalink
add limit_scope_type_all Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
karle0wne committed Aug 17, 2023
1 parent 7f40ca1 commit 0a81b00
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,15 @@ private Tags getTags(LimitsData dto, LimitConfigEntity limitConfigEntity) {

@SneakyThrows
private List<Tag> getLimitScopeTypeTags(String limitScopeTypesJson) {
return objectMapper.readValue(limitScopeTypesJson, new TypeReference<List<Map<String, Object>>>() {
var tags = objectMapper.readValue(limitScopeTypesJson, new TypeReference<List<Map<String, Object>>>() {
})
.stream()
.flatMap(stringObjectMap -> stringObjectMap.keySet().stream())
.map(s -> Tag.of(String.format("limit_scope_type_%s", s), "true"))
.collect(Collectors.toList());
if (tags.isEmpty()) {
tags.add(Tag.of(String.format("limit_scope_type_%s", "all"), "true"));
}
return tags;
}
}

0 comments on commit 0a81b00

Please sign in to comment.