Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-1600

queryDataNodes does not return list element with integer leaf value

XMLWordPrintable

      Using the bookstore model, queryDataNodes returns nothing in this case:

      cpsQueryService.queryDataNodes(FUNCTIONAL_TEST_DATASPACE, BOOKSTORE_ANCHOR, '/bookstore/categories[@code=1]', INCLUDE_ALL_DESCENDANTS)
      

      (regardless of fetchDescendantsOption.)

      Meanwhile, getDataNodes returns correct data:

      cpsDataService.getDataNodes(FUNCTIONAL_TEST_DATASPACE, BOOKSTORE_ANCHOR, '/bookstore/categories[@code=1]', INCLUDE_ALL_DESCENDANTS)
      

      returns:

      • /bookstore/categories[@code='1']
        • /bookstore/categories[@code='1']/books[@title='Matilda']
        • /bookstore/categories[@code='1']/books[@title='The Gruffalo']

      Difference of integer/string leaf value

      In the bookstore.yang model, categories key is defined as "code" attribute:

       

      list categories {
          key "code";
          leaf code {
              type string;
          }
      ...

       

      So using a string leaf value returns correct results:

      /bookstore/categories[@code="1"]

      while this returns nothing:

      /bookstore/categories[@code=1]

      However, both these queries return same results:

      • /bookstore/categories[@code=1]/books[@title="Matilda"]
      • /bookstore/categories[@code="1"]/books[@title="Matilda"]

      Not to mention getDataNodes returns same results for these:

      • /bookstore/categories[@code=1]
      • /bookstore/categories[@code="1"]

            ToineSiebelink Toine Siebelink
            danielhanrahan Daniel Hanrahan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: