You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with yanger-swagger plugin, there is a current limitation (for good reason) to having one YANG data model as input.
The issue it gives is that it then prevent the use of remote-augment from other modules that have "data" in them. Indeed if the remote-module does not have data then it is possible to just pass it as a second yang module in the input:
yanger -f swagger -t expand --swagger-path-filter=/data/parent:parent parent.yang no-data-child.yang -o test
user@server # yanger -f swagger -t expand [--swagger-path-filter=/data/parent:parent](url) parent.yang child.yang -o test
child.yang:0: error: Too many modules given, only one data module is supported for Swagger.
Workaround: if child.yang with data is added as a deviation-module then it works (I mean I can get the remote-augment to work) - I think this is because it bypass the check from the swagger-plugin emit function.
yanger -f swagger -t expand --swagger-path-filter=/data/parent:parent --deviation-module=child.yang parent.yang -o test
While I understand the current restriction - it is a bit non-intuitive to use deviation-module option to obtain the expected result.
The text was updated successfully, but these errors were encountered:
gmuloc
changed the title
Cannot get remote-augments in yanger-swagger plugin
Cannot get remote-augments from modules with data in yanger-swagger plugin
Apr 17, 2020
When working with yanger-swagger plugin, there is a current limitation (for good reason) to having one YANG data model as input.
The issue it gives is that it then prevent the use of remote-augment from other modules that have "data" in them. Indeed if the remote-module does not have data then it is possible to just pass it as a second yang module in the input:
However if child.yang defines also some other data node this will fail the first check in the plugin: https://github.com/mbj4668/yanger/blob/master/plugins/yanger_swagger.erl#L283 (the parsing is done correctly but then it fails in emit)
Workaround: if child.yang with data is added as a
deviation-module
then it works (I mean I can get the remote-augment to work) - I think this is because it bypass the check from the swagger-plugin emit function.While I understand the current restriction - it is a bit non-intuitive to use deviation-module option to obtain the expected result.
My 3 dummy yang modules below:
The text was updated successfully, but these errors were encountered: