+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.controller.sal.rest.impl;
import static com.google.common.base.Preconditions.checkNotNull;
private DataSchemaNode findFirstSchemaForNode(Node<?> node, Set<DataSchemaNode> 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()) {
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);