From: Tom Pantelis Date: Fri, 1 Jun 2018 20:16:47 +0000 (-0400) Subject: RestconfDocumentedExceptionMapper not returning json X-Git-Tag: release/fluorine~67 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=483c08d628b9c9e463155eb6f259d539fba63d64;p=netconf.git 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 --- 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);