Browse Source

Filters out null matrix parameters

pull/556/head
Nick Smith 4 years ago committed by Olga MaciaszekSharma
parent
commit
421df91a80
  1. 5
      spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/annotation/MatrixVariableParameterProcessor.java

5
spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/annotation/MatrixVariableParameterProcessor.java

@ -75,9 +75,8 @@ public class MatrixVariableParameterProcessor implements AnnotatedParameterProce @@ -75,9 +75,8 @@ public class MatrixVariableParameterProcessor implements AnnotatedParameterProce
private String expandMap(Object object) {
Map<String, Object> paramMap = (Map) object;
return paramMap.keySet().stream()
.map(key -> ";" + key + "=" + paramMap.get(key).toString())
.collect(Collectors.joining());
return paramMap.keySet().stream().filter(key -> paramMap.get(key) != null)
.map(key -> ";" + key + "=" + paramMap.get(key).toString()).collect(Collectors.joining());
}
}

Loading…
Cancel
Save