From 483c08d628b9c9e463155eb6f259d539fba63d64 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Fri, 1 Jun 2018 16:16:47 -0400 Subject: [PATCH] RestconfDocumentedExceptionMapper not returning json The media types returned from HttpHeaders returns wildcard type "/" which we were incorrectly filtering out. So it was defaulting to xml instead of json. Change-Id: I2f64840ca4bbc48651c2a8bbe72fdbbc666024a2 Signed-off-by: Tom Pantelis --- .../sal/rest/impl/RestconfDocumentedExceptionMapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java index b4b2890954..aa6b7c0b69 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java @@ -100,7 +100,8 @@ public class RestconfDocumentedExceptionMapper implements ExceptionMapper type != MediaType.WILDCARD_TYPE).findFirst().orElse(MediaType.APPLICATION_JSON_TYPE); + .filter(type -> !type.equals(MediaType.WILDCARD_TYPE)).findFirst() + .orElse(MediaType.APPLICATION_JSON_TYPE); LOG.debug("Using MediaType: {}", mediaType); -- 2.36.6