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 uses attributes not hidden when using UML option --uml-classes-only #892

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nkhancock
Copy link
Contributor

When rendering YANG modules with 'uses' statements using the UML option --uml-classes-only, the {uses} attributes of the class representing the YANG statement in which the 'uses' statement is used are not suppressed as would be expected. 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-interior
module test-uses-interior {
  namespace "http://www.adtran.com/ns/yang/test-uses-interior";
  prefix tst-uses-int;

  import test-groupings {
    prefix tst-grp;
  }

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

  container top-level-container {
    description
      "A uses statement within a top-level interior node
       (container).";
    uses tst-grp:grouping-1;
    uses tst-grp:grouping-2;
  }
}

Example

--uml-classes-only not used

image

--uml-classes-only 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