Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-654

singleton lists are not rendered as lists by StructuredDataToJsonProvider

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • None
    • restconf
    • None
    • Operating System: Mac OS
      Platform: PC

    • 1449

    Description

      If I have a model with a list of string, like the leaf-list on line 32 here:
      https://git.opendaylight.org/gerrit/#/c/8975/4/ttp-model/model/src/main/yang/ttp.yang

      And I use the builder to add a singleton list of strings like this:
      NDMMetadata NDMmeta = new NDMMetadataBuilder()
      .setDoc(Arrays
      .asList("TTP supporting L2 VLANs (unicast, multicast, flooding) with optional VID translation."))
      .setAuthority("org.opennetworking.fawg").build();

      When I covert it to JSON, I get a single string, not a list containing a single stiring. That is I get this:
      {
      "NDM_metadata":

      { "authority": "org.opennetworking.fawg", "doc": "TTP supporting L2 VLANs (unicast, multicast, flooding) with optional VID translation." }

      }

      but, I'd expect this:
      {
      "NDM_metadata":

      { "authority": "org.opennetworking.fawg", "doc": ["TTP supporting L2 VLANs (unicast, multicast, flooding) with optional VID translation."] }

      }

      Is this a bug or expected behavior?

      If you want to check it out, this patch set has an example:
      https://git.opendaylight.org/gerrit/#/c/8975/4/

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jgloncak Jozef Gloncak
            colindixon Colin Dixon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: