I have this part of code:
try {
ResponseEntity<T> responseEntity = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, null,
new ParameterizedTypeReference<T>() {
});
if (responseEntity == null || responseEntity.getBody() == null || responseEntity.getBody() == null) {
throw ApiException.createFrom(ResponseCode.REQUEST_INVALID, "Severity for this input is not found!");
} else {
return (LinkedHashMap<Object, Object>) responseEntity.getBody();
}
Problem is that i always get 400 null error.
When i ask in swagger with filter parameter : [{"attribute":"tapId","filterOperation":"EQUALS","expressionValue":"00b83d4c-afad-47fb-b66b-07c93971c69b"}]
I get this url :
?filter=%5B%7B"attribute"%3A"tapId"%2C"filterOperation"%3A"EQUALS"%2C"expressionValue"%3A"00b83d4c-afad-47fb-b66b-07c93971c69b"%7D%5D
and this is working, but when i call it with this part of code:
builder.queryParam("filter", String.join(",", filter));
and then
ResponseEntity<T> responseEntity = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.GET, null,
new ParameterizedTypeReference<T>() {
});
i get this url
?filter=%7B%22attribute%22:%22tapId%22,%22filterOperation%22:%22EQUALS%22,%22expressionValue%22:%2200b83d4c-afad-47fb-b66b-07c93971c69b%22%7D
and this is not working and im getting this error. Any suggestion how can i fix this?