[MDSAL-352] leafref to leaf of type enum in grouping causes codegen failure Created: 19/Jun/18  Updated: 09/Aug/18  Resolved: 09/Aug/18

Status: Resolved
Project: mdsal
Component/s: None
Affects Version/s: Oxygen, Fluorine, Nitrogen SR3
Fix Version/s: Fluorine

Type: Bug Priority: Highest
Reporter: Donald Hunter Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File enum-leafref.yang     Text File stacktrace.txt    
Issue Links:
Duplicate
is duplicated by MDSAL-367 CodeGeneratorImpl: Failed to find lea... Resolved

 Description   

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".



 Comments   
Comment by Robert Varga [ 19/Jun/18 ]

Looks like confusion around how to look up the target type after acquiring the target leaf.

Comment by Robert Varga [ 07/Aug/18 ]

This is blocking inclusion of ietf-hardware model, hence scheduling for Fluorine and marking as blocker.

Generated at Wed Feb 07 20:09:35 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.