X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Frest%2Fimpl%2FJsonNormalizedNodeBodyReader.java;fp=restconf%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Frest%2Fimpl%2FJsonNormalizedNodeBodyReader.java;h=2195dc21ae3f0fe021b2f457854b938daab7e58e;hb=3e085c350e8a23e2335592ed08198cb37b5f4e7f;hp=83d2449a81a5629f8820287c3839fca5f359cf26;hpb=27358b351f0b446f319d17db848cbbbdfa7469f4;p=netconf.git diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java index 83d2449a81..2195dc21ae 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java @@ -30,6 +30,8 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; +import org.opendaylight.restconf.Draft11; +import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; @@ -50,7 +52,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -@Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft02.MediaTypes.OPERATION + RestconfService.JSON, +@Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft11.MediaTypes.DATA + RestconfConstants.JSON, + Draft02.MediaTypes.OPERATION + RestconfService.JSON, Draft11.MediaTypes.OPERATION + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { @@ -75,7 +78,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPr } } - private static void propagateExceptionAs(Exception e) throws RestconfDocumentedException { + private static void propagateExceptionAs(final Exception e) throws RestconfDocumentedException { if(e instanceof RestconfDocumentedException) { throw (RestconfDocumentedException)e; } @@ -134,7 +137,7 @@ public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsPr final List iiToDataList = new ArrayList<>(); InstanceIdentifierContext newIIContext; - while (result instanceof AugmentationNode || result instanceof ChoiceNode) { + while ((result instanceof AugmentationNode) || (result instanceof ChoiceNode)) { final Object childNode = ((DataContainerNode) result).getValue().iterator().next(); if (isPost) { iiToDataList.add(result.getIdentifier());