Safely combined produces and consumes
(2394)
@@ -36,6 +36,7 @@ import java.util.List;
import java.util.Set;
import static com.google.common.collect.Sets.*;
+import static springfox.documentation.builders.BuilderDefaults.*;
public class CombinedRequestHandler implements RequestHandler {
private final RequestHandler first;
@@ -81,12 +82,12 @@ public class CombinedRequestHandler implements RequestHandler {
@Override
public Set<? extends MediaType> produces() {
- return Sets.union(first.produces(), second.produces());
+ return Sets.union(nullToEmptySet(first.produces()), nullToEmptySet(second.produces()));
}
@Override
public Set<? extends MediaType> consumes() {
- return Sets.union(first.consumes(), second.consumes());
+ return Sets.union(nullToEmptySet(first.consumes()), nullToEmptySet(second.consumes()));
}
@Override
