X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fimpl%2FJsonMapper.java;h=ca318e4f3692d28da298810d0b4ff7272bc4f615;hp=357b599ec75917bb7f4e9cbc91fe458c8fec8845;hb=aefdbf9e014411a197cac01f9de53b3fd35179cb;hpb=f207c0c13689d0744c2ed2eb0395076fee82ffe6 diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java index 357b599ec7..ca318e4f36 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/JsonMapper.java @@ -134,7 +134,7 @@ class JsonMapper { private DataSchemaNode findFirstSchemaForNode(Node node, Set dataSchemaNode) { for (DataSchemaNode dsn : dataSchemaNode) { - if (node.getNodeType().getLocalName().equals(dsn.getQName().getLocalName())) { + if (node.getNodeType().equals(dsn.getQName())) { return dsn; } else if (dsn instanceof ChoiceNode) { for (ChoiceCaseNode choiceCase : ((ChoiceNode) dsn).getCases()) { @@ -300,10 +300,16 @@ class JsonMapper { String nameForOutput = node.getNodeType().getLocalName(); if (schema.isAugmenting()) { ControllerContext contContext = ControllerContext.getInstance(); - CharSequence moduleName; - moduleName = contContext.toRestconfIdentifier(schema.getQName()); + CharSequence moduleName = null; + if (mountPoint == null) { + moduleName = contContext.toRestconfIdentifier(schema.getQName()); + } else { + moduleName = contContext.toRestconfIdentifier(mountPoint, schema.getQName()); + } if (moduleName != null) { nameForOutput = moduleName.toString(); + } else { + logger.info("Module '{}' was not found in schema from mount point", schema.getQName()); } } writer.name(nameForOutput);