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

Some BBF yang devices using actions have invalid swagger URLs generated.


      This problem was discovered in Lighty.io version14.0 and version15.1 - which can be seen on ODL versions Silicon and Phosphorus SR1. 

      It seems that some BBF (Broadband Forum) yang files that include "actions" construct invalid "POST" urls in the swagger. 

      This is an extension to NETCONF-859.  The same yang files are included in this JIRA, HOWEVER, the bbf-software-management yang has been modified to work with swagger (workaround for NETCONF-859). The version of the yang included here is the same, but the file content differs slightly to address NETCONF-859. The delta in the bbf-software-management yang file is shown below - the leafref path was changed to the actual definition. 

      < type uint8;

      > type leafref

      { > path "../../../../../../../bbf-swm:revisions/bbf-swm:revision/bbf-swm:id"; > }

      < type bbf-yang:string-ascii64;

      > type leafref

      { > path "../../../../../../../bbf-swm:revisions/bbf-swm:revision/bbf-swm:alias"; > }

      Inside the yang file, there is an action called "download" which exists in a container called "download":
      container download {
      when "boolean(../../capability='bbf-swm:download') and count(../revision[state='downloading'])=0"

      { description "Only applicable if the 'download' capability is supported and no other download of a revision is in progress for this software."; }

      presence "Downloading of revisions for this software is
      config false;
      "Provides containment for the action 'download'.";
      action download {
      if-feature "software-actions";
      "Download the specified software revision to this

      The bbf-software-manager yang augments ietf-hardware. Under ietf-hardware we can see that the URL for the "download" above is messed up.

      The picture of this is attached.
      The URL shown/generated is


      The beginning of the generated URL should be /restconf/operations/...

      Also included in this set of yang files is the bbf-hardware yang file which includes a "reset" action. The yang may be easier to look at for this one. It also is an "action" to do a reset, and it also contains a URL that is messed up.



      To recreate this, use netconf testtool to create a device simulator using all the yang models attached to this JIRA. The device will get mounted. Go into swagger and you will notice that the two mentioned generated URLs which are POST requests for underlying "actions" have bad URLs. Also, there is no parameters - each URL has some parameters, but the parameters section in the swagger does not show any.


            yaroslav.lastivka Yaroslav Lastivka
            rmagaldi Robert Magaldi
            0 Vote for this issue
            2 Start watching this issue