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

Node name collision for unique argument

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • High
    • Resolution: Done
    • 8.0.6
    • 10.0.1, 9.0.3, 8.0.9
    • parser
    • None

    Description

      When unique statement is used within a grouping used by another grouping, YANG parser fails to build effective model.

      For example, the following YANG model

      module foo {
        namespace "urn:foo";
        prefix "foo";
      
        grouping bar-group {
          list bar {
            key bar;
            unique baz;
      
            leaf bar {
              type string;
            }
      
            leaf baz {
              type string;
            }
          }
        }
      
        grouping foo-group {
          container foo {
            uses bar-group;
          }
        }
      
        uses foo-group;
      }
      

      causes this SourceException:

      Caused by: org.opendaylight.yangtools.yang.parser.spi.source.SourceException: Error in module 'foo': cannot add '(urn:foo)baz'. Node name collision: '(urn:foo)baz' already declared at foo.yang:14:7 [at foo.yang:14:7]
      

      Attachments

        Issue Links

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

          Activity

            People

              rovarga Robert Varga
              sangwookha Sangwook Ha
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: