Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-272

Api explorer does not handle nodes with same name in yang module properly

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    • 6679

    Description

      If there are two or more Containers (Lists and others as well) with same name in one yang module, example is not rendered properly. It always takes the last one and render example based on that.
      e.g.:
      module -->

      container jukebox {
      container library {
      list artist {
      key name;

      leaf name {
      type string

      { length "1 .. max"; }

      }

      list song {
      key name;

      leaf name {
      type string

      { length "1 .. max"; }

      }
      leaf location

      { type string; mandatory true; }

      leaf format

      { type string; }

      leaf length

      { type uint32; }

      } // end list 'song'
      } // end list 'artist'
      } // end library

      list playlist {
      key name;

      leaf name

      { type string; }

      list song {
      key index;

      leaf index

      { type uint32; }

      leaf id {
      type leafref

      { path "/jbox:jukebox/jbox:library/jbox:artist/" + "jbox:album/jbox:song/jbox:name"; }

      mandatory true;
      }
      } // end song
      } //end playlist
      }// end jukebox

      example generated -->
      {
      "jukebox": {
      "library": {
      "artist": [
      {
      "song": [ <---- wrongly generated song. should contain name,location,format,length

      { "index": "integer", "id": "object" }

      ],
      "name": "string"
      }
      ]
      },
      "playlist": [
      {
      "song": [

      { "index": "integer", "id": "object" }

      ],
      "name": "string",
      }
      ]
      }
      }

      Attachments

        Issue Links

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

          Activity

            People

              miroslav.kovac@pantheon.tech Miroslav Kovac
              miroslav.kovac@pantheon.tech Miroslav Kovac
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: