Allow data path to end with a list for get and ls

Change-Id: I3facc8315fa6192da4318012a85121de37e7314b
diff --git a/src/ast_path.cpp b/src/ast_path.cpp
index 56d33c0..1f01a72 100644
--- a/src/ast_path.cpp
+++ b/src/ast_path.cpp
@@ -43,6 +43,11 @@
 {
 }
 
+schemaNode_::schemaNode_(decltype(m_suffix) node)
+    : m_suffix(node)
+{
+}
+
 schemaNode_::schemaNode_(module_ module, decltype(m_suffix) node)
     : m_prefix(module)
     , m_suffix(node)
@@ -186,7 +191,7 @@
     return res;
 }
 
-std::string pathToSchemaString(const dataPath_& path)
+std::string pathToSchemaString(const schemaPath_& path)
 {
     std::string res;
     for (const auto it : path.m_nodes) {
@@ -198,6 +203,11 @@
     return res;
 }
 
+std::string pathToSchemaString(const dataPath_& path)
+{
+    return pathToSchemaString(dataPathToSchemaPath(path));
+}
+
 struct dataSuffixToSchemaSuffix : boost::static_visitor<decltype(schemaNode_::m_suffix)> {
     auto operator()(const listElement_& listElement) const
     {