Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UML Plugin: Fix top-level uses statement being ignored #891

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nkhancock
Copy link
Contributor

@nkhancock nkhancock commented Mar 14, 2024

When rendering YANG modules with a 'uses' statement at the module level, such as can be found the YANG module openconfig-telemetry@2018-11-21, the top-level uses statement is ignored. This pull request fixes this issue.

The following examples illustrate what has been fixed.

The following YANG data models were used to test this fix:

test-groupings
module test-groupings {
  namespace "http://www.adtran.com/ns/yang/test-groupings";
  prefix tst-grp;

  revision 2024-03-11 {
    description
      "Initial revision.";
    reference
      "None.";
  }

  grouping grouping-1 {
    description
      "A grouping with a top-level non-interior data node.";
    leaf a-top-level-leaf-in-a-grouping {
      type string;
      description
        "Bla bla bla.";
    }
  }

  grouping grouping-2 {
    description
      "A grouping with a top-level interior data node.";
    container a-top-level-container {
      leaf a-leaf-within-a-top-level-container-in-a-grouping {
        type string;
        description
          "Bla bla bla.";
      }
    }
  }
}
test-uses-top-level
module test-uses-top-level {
  namespace "http://www.adtran.com/ns/yang/test-uses-top-level";
  prefix tst-uses-top;

  import test-groupings {
    prefix tst-grp;
  }

  revision 2024-03-11 {
    description
      "Initial revision.";
    reference
      "None.";
  }

  uses tst-grp:grouping-1;
  uses tst-grp:grouping-2;

}

Example 1: UML option --uml-inline-groupings not used

Before the fix:

image

After the fix:

image

Example 2: UML option --uml-inline-groupings used

Before the fix:

image

After the fix:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant