Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-405

Compilation error: grouping address-family and identity address-family both exist in ietf-routing.yang

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: Linux
      Platform: PC

    • 2655

    Description

      Hi,

      I tried to generate JAVA class from ietf-routing.yang (see http://www.netconfcentral.org/modules/ietf-routing), but the generated classes cannot compile, as follows.

      If you already developed maven artifacts for ietf-routing, please let me know. If not, could you solve the bug? Thanks!

      ietf-routing.yang:

      identity address-family

      { description "Base identity from which identities describing address families are derived."; }

      grouping address-family {
      description
      "This grouping provides a leaf identifying an address
      family.";
      leaf address-family {
      type identityref

      { base address-family; }

      mandatory true;
      description "Address family.";
      }
      } // grouping address-family

      identity ipv4 {
      base address-family;
      description
      "This identity represents IPv4 address family.";
      }

      Please notice there are 2 address-family definitions in ietf-routing.yang, one is identity, the other is grouping, this will cause the problem.

      The generated Ipv4 class extended an interface, so it cannot compile.

      public abstract class Ipv4 extends AddressFamily
      {
      public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:ietf:params:xml:ns:yang:ietf-routing","2014-05-24","ipv4");;

      public Ipv4() {

      }
      }

      public interface AddressFamily
      extends
      DataObject

      { public static final QName QNAME = org.opendaylight.yangtools.yang.common.QName.create("urn:ietf:params:xml:ns:yang:ietf-routing","2014-05-24","address-family");; /** * Address family. * */ java.lang.Class<? extends org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.routing.rev140524.AddressFamily> getAddressFamily(); }

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              minna.hu@ericsson.com Minna Hu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: