i have a running Swagger UI container configured with the BaseURL to be : /restconf and host: http://NSO-IP:8080
as shown below:
i'm using NSO 5.2.1 and i used its yanger to generate the swagger.json file from the /opt/ncs/current/src/ncs/yang/tailf-ncs.yang yang file.
But i found that it failed to fetch because of the wrong URL sent with the API request :
i have changed it manually from tailf-ncs-package to tailf-ncs in the json file after testing it with curl and it works:
my question is, how to get the appropriate yang file to generate the correct json file with the correct paths ?
Thanks in advance !
Go to Solution.
It looks like you are hitting this (fixed) yanger issue https://github.com/mbj4668/yanger/pull/11
It was taking submodule names and using them as prefixes
Try with latest yanger release and please tell us if it worked for you.
View solution in original post
It seems you are compiling the tailf-ncs-packages YANG sub-module.This is probably why it takes the wrong module-name for the path.
Can you compile the tailf-ncs YANG module and perhaps use pathfilters to prune your Swagger file?
Hello @perander , Thank for reply
i have compiled the tailf-ncs.yang module path: /opt/ncs/current/src/ncs/yang/tailf-ncs.yang which includes all other sub-modules like tailf-ncs-packages, tailf-ncs-devices and so on.
i also tried to use path filters but the output json file have no paths match.
Any other ideas!
Hi @snovello, Thanks for your response.
indeed i have done something similar using python to update the tailf-ncs-(anything): to tailf-ncs: it works properly.
but i just got confused from the tailf-ncs.yang module for these strange paths and wanted to ensure that it's a bug to be in mind.
i will try to use the latest yanger and inform you back.
Appreciate your time and response @snovello @perander. Thanks!
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: