08-03-2020 06:46 AM - edited 08-03-2020 06:53 AM
I would like to create a swagger documentation with yanger but when i running the yanger commands with imported module, its giving me error.
yanger \
--format=swagger \
-t expand \
--output=/tmp/test.swagger \
--swagger-host 127.0.0.1:8080 \
--path test-common.yang \
test-cloud-connect-cfs.yang
am getting the below error while running,
test-cloud-connect-cfs.yang:0: error: No data modules given, at least one data module is required for Swagger.
could someone help on this please?
08-05-2020 11:51 AM
Here what I use:
yanger -p yang/. -t expand -f swagger yang/etsi-nfv-descriptors.yang --swagger-host 127.0.0.1:8080 --swagger-basepath /restconf | python -m json.tool > nfvo_swagger.json
05-19-2022 06:45 AM
hi rogo,
I tried to generate swagger file for one of our module,
yanger -p access-port/src/yang/ -t expand -f swagger l2vpn/src/yang/l2vpn.yang --swagger-host 127.0.0.1:8080 --swagger-basepath /restconf | python -m json.tool > nfvo_swagger.json
i got the following,
access-port/src/yang/access-port.yang:16: error: module 'Cisco-IOS-XR-um-interface-cfg' not found
access-port/src/yang/access-port.yang:54: error: the node 'interfaces' from module 'Cisco-IOS-XR-um-interface-cfg' (in node 'config' from 'tailf-ncs') is not found
Expecting value: line 1 column 1 (char 0)
I understood that, need to put the NED file in the path.
yanger -p access-port/src/yang/ -p cisco-iosxr-nc-7.5/src/yang -t expand -f swagger l2vpn/src/yang/l2vpn.yang --swagger-host 127.0.0.1:8080 --swagger-basepath /restconf | python -m json.tool > nfvo_swagger.json
now got the following,
/nso/install/ncs/ncs-5.6.4/src/ncs/yang/tailf-ncs-cluster.yang:461: error: typedef 'aes-256-cfb-128-encrypted-string' in module 'tailf-common' not found
/nso/install/ncs/ncs-5.6.4/src/ncs/yang/tailf-ncs-devices.yang:4321: error: typedef 'aes-256-cfb-128-encrypted-string' in module 'tailf-common' not found
questions is,
how to import user-defined module (like access-port) and NED folder which is dependency for the target module ?
need samples.
08-10-2020 03:59 AM
You need at least one data node, e.g. container, list, leaf-list, leaf etc.
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: