Closed nkhancock closed 8 months ago
Am closing this PR temporarily as I have identified an issue with the --uml-inline-augments not working as previously on notifications. I will reopen, once I have corrected the issue.
Am reopening this pull request as the cause of the issue discussed in the last comment lies with PlantUML's stricter scoping rules and not with the changes made in this pull request. The issue does not occur when rendering the UML with a PlantUML release < 1.2023.2.
Note the stricter scoping rules impacts the correct rendering of the UML-specific option --uml-inline-augment for classes representing containers and lists as well. The impact of the stricter scoping rules on the rendering of inline augments has to be addressed separately in a further pull request.
Keywords defined within a package apparently now only have scope within that package and therefore keywords for data nodes defined in module B to be augmented to the class in module A are not visible in module A, so the data nodes are rendered in module B.
The initial commit for this pull request had issues when the UML-specific option --uml-inline-augments was selected. This was in addition to issues arising when using a PlantUML release >= 1.2023.2.
When rendering using PlantUML release 1.2022.12 using the UML-specific option --uml-inline-augments, duplicate attribute definitions and relations for augmented nodes were present, although duplicate relations were also seen in the master branch without these changes. When rendering using PlantUML 1.2023.9 the inline augments did not work and further issues are seen.
Commit a8e17d0 removes the duplicate attribute definitions seen using PlantUML release 1.2022.12 and the inline augmentation behavior is now consistent with that in the master branch.
When rendering using PlantUML 1.2023.9 the inline augments still do not work as a result of the stricter scoping rules in PlantUML release >= 1.2023.2. A further pull request will need to address these issues (which I am working, but may take a while).
The following YANG modules were used to test this fix:
Notifications defined in interior data nodes (containers, lists) are not rendered in the UML diagram generated by the UML Plugin. This pull request fixes this shortcoming,
The following example illustrate what has been fixed.
The following YANG data model were used to test this fix:
test-notifications
``` module test-notifications { yang-version 1.1; namespace "http://www.example.com/ns/yang/test-notifications"; prefix tst-nfc; revision 2023-07-21 { description "Initial revision."; reference "None."; } grouping notificatication-grouping { description "A grouping defining a notification."; notification grp-nfc { description "A notification in a list."; leaf binary-leaf { type binary; description "A leaf in a notification that is in a list."; } } } container container-a { description "A top-level container."; list list-a { key name; description "A list in a top-level container."; leaf name { type string; description "The name of the entry."; } notification list-a-nfc { description "A notification in a list."; leaf binary-leaf { type binary; description "A leaf in a notification that is in a list."; } container container-3 { description "A container in a notification that is in a list."; leaf another-leaf { type string; description "Just another leaf."; } leaf b-list-ref { type leafref { path "/tst-nfc:container-b" + "/tst-nfc:list-b/tst-nfc:name"; } } } } } } container container-b { description "A another top-level container."; list list-b { key name; description "A list in a top-level container."; leaf name { type string; description "The name of the entry."; } uses notificatication-grouping; } } notification top-level-nfc { description "A top-level notification."; container container-4 { description "A container in a top-level notification."; leaf a-leaf { type uint32; description "Just a leaf."; } leaf list-b-ref { type leafref { path "/tst-nfc:container-b" + "/tst-nfc:list-b/tst-nfc:name"; } } } leaf just-a-leaf { type string; description "A leaf in a top-level notification."; } } } ```Example
Before the fix:
After the fix: