03-05-2020 07:41 AM
Hi, I would like to make swagger documentation using yanger. However, I have difficulty figuring out how to do it when my module import other modules.
My yanger command look something like this:
yanger \ --swagger-path-filter=/data/tailf-ncs-services:services/my_service:test \ --format=swagger \ -t expand \ --output=/tmp/test.swagger \ --swagger-host 127.0.0.1:8080 \ test.yang
Since in test.yang I have imported module "test2.yang", I get the following error:
test.yang:13: error: module 'test2' not found
Solved! Go to Solution.
03-05-2020 10:01 AM
Just tested. You can leave off the test2.yang and just specify the directory to the yang folder
so if /var/opt/ncs/packages/TEST/src/yang/test2.yang
it woudl be
-p /var/opt/ncs/packages/TEST/src/yang
03-05-2020 07:59 AM
Add the path for your yang module.
yanger \ --swagger-path-filter=/data/tailf-ncs-services:services/my_service:test \ --format=swagger \ -t expand \ -p /path/to/src/yang/test2.yang --output=/tmp/test.swagger \ --swagger-host 127.0.0.1:8080 \ test.yang
That should load the yang.
03-05-2020 09:09 AM
03-05-2020 10:01 AM
Just tested. You can leave off the test2.yang and just specify the directory to the yang folder
so if /var/opt/ncs/packages/TEST/src/yang/test2.yang
it woudl be
-p /var/opt/ncs/packages/TEST/src/yang
03-05-2020 10:13 AM
Thats works.
Thank you.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: