Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-352

leafref to leaf of type enum in grouping causes codegen failure

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Highest Highest
    • Fluorine
    • Oxygen, Fluorine, Nitrogen SR3
    • None
    • None

      This YANG causes the following error during maven code generation:

      Failed to find leafref target: /operations/operation/effort in module enum-leafref

      module enum-leafref {
        namespace "urn:donaldh:yang:leafref:bug";
        prefix l;

        typedef action-effort {
          type enumeration {
            enum best-effort {
      {{      }}}
            enum exact-match {
      {{      }}}}}
      {{    }}}
      {{  }}}
        container operations {
          list operation {
            key 'effort';
            uses operation-g;
      {{    }}}
      {{  }}}
        grouping operation-g {
          leaf effort {{{}}
            type action-effort;
      {{    }}}
          leaf-list operation {
            type leafref {{{}}
              path '/operations/operation/effort';
      {{      }}}
      {{    }}}
      {{  }}}
      }

      It is possible to work around the bug by either changing leaf "effort" to be type string or by collapsing grouping "operation-g" into list "operation".

            rovarga Robert Varga
            donaldh Donald Hunter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: