try {
final Optional<InstanceIdentifierContext> path = getIdentifierWithSchema();
+ if (entityStream.available() < 1) {
+ // represent empty nopayload input
+ return new NormalizedNodeContext(path.get(), null);
+ }
+
final DocumentBuilder dBuilder;
try {
dBuilder = BUILDERFACTORY.newDocumentBuilder();
final NormalizedNode<?, ?> result = parse(path.get(),doc);
return new NormalizedNodeContext(path.get(),result);
} catch (final Exception e) {
- LOG.debug("Error parsing json input", e);
+ LOG.debug("Error parsing xml input", e);
throw new RestconfDocumentedException("Error parsing input: " + e.getMessage(), ErrorType.PROTOCOL,
ErrorTag.MALFORMED_MESSAGE);
final String docRootElm = doc.getDocumentElement().getLocalName();
final String schemaNodeName = pathContext.getSchemaNode().getQName().getLocalName();
- // TODO : do we want to really follow netconf-restconf specification ?
if (!schemaNodeName.equalsIgnoreCase(docRootElm)) {
final Collection<DataSchemaNode> children = ((DataNodeContainer) schemaNode).getChildNodes();
for (final DataSchemaNode child : children) {
} else if(schemaNode instanceof ListSchemaNode) {
final ListSchemaNode casted = (ListSchemaNode) schemaNode;
return parserFactory.getMapEntryNodeParser().parse(elements, casted);
- }
+ } // FIXME : add another DataSchemaNode extensions e.g. LeafSchemaNode
return null;
}
}