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

YANG parser should honor RFC7950 section 6.2.1 restrictions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 3.0.6, 2.1.13, 4.0.2
    • 2.1.12, 3.0.5, 4.0.1
    • parser
    • None

      As in RFC 7950 section 6.2.1:

      o All leafs, leaf-lists, lists, containers, choices, rpcs, actions,
      notifications, anydatas, and anyxmls defined (directly or through
      a "uses" statement) within a parent node or at the top level of
      the module or its submodules share the same identifier namespace.
      This namespace is scoped to the parent node or module, unless the
      parent node is a case node. In that case, the namespace is scoped
      to the closest ancestor node that is not a case or choice node
      .

      We should take into consideration the following 3 models:

      module bar {
          yang-version 1.1;
          namespace bar;
          prefix bar;
      
          revision "2018-02-11";
      
          grouping foo {
            container bar {
      
            }
          }
      
          container cont {
            choice bar {
              case foo {
                uses foo;
              }
            }
          }
      
          augment "/cont" {
            choice foo {
              case foo {
                uses foo;
              }
            }
          }
      }
      
      module baz {
          yang-version 1.1;
          namespace baz;
          prefix baz;
      
          revision "2018-02-28";
      
          grouping foo {
            container bar {
      
            }
          }
      
          container cont {
            choice bar {
              case foo {
                uses foo;
              }
            }
      
            container bar {
      
            }
          }
      }
      
      module foo {
          yang-version 1.1;
          namespace foo;
          prefix foo;
      
          revision "2018-02-11";
      
          grouping foo {
            container bar {
      
            }
          }
      
          container cont {
            choice bar {
              case foo {
                uses foo;
              }
            }
          }
      
          augment "/cont/bar" {
            case foo2 {
              uses foo;
            }
          }
      }
      
      

            rovarga Robert Varga
            JieHan2017 Jie Han
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: