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

Get list node returns multiple lists with individual list items instead of a singular list

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Won't Do
    • Icon: Medium Medium
    • Montreal Release
    • None
    • CPS-Core
    • None

      If there is a list stored in the DB as follows (with xpath /bookstore):

       

      [
        {
          "stores:bookstore": {
            "store-name": "My Bookstore",
            "store-owner": "James",
            "categories": [
              {
                "name": "Test book",
                "price": 100,
                "stock": false,
                "book-category": "SciFi"
              },
              {
                "name": "Kids book",
                "price": 200,
                "stock": true,
                "book-category": "Kids"
              }
            ]
          }
        }
      ]

      When the list data node is retrieved (using xpath /bookstore/categories), we get multiple individual lists with each list containing on list item of the list named categories:

      [
        {
          "stores:categories": {
            "name": "Test book",
            "price": 100,
            "stock": false,
            "book-category": "SciFi"
          }
        },
        {
          "stores:categories": {
            "name": "Kids book",
            "price": 200,
            "stock": true,
            "book-category": "Kids"
          }
        }
      ] 

      Whereas the expected response should be as follows:

      [
        {
          "categories": [
            {
              "name": "Test book",
              "price": 100,
              "stock": false,
              "book-category": "SciFi"
            },
            {
              "name": "Kids book",
              "price": 200,
              "stock": true,
              "book-category": "Kids"
            }
          ]
        }
      ] 

      Remarks: After looking into the overall functioning of CPS it was concluded that this is an expected behavior.

            Unassigned Unassigned
            arpitsingh arpitsingh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: