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

Node name collision for unique argument


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

      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]

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