10-07-2020 01:53 AM - edited 10-07-2020 04:07 AM
Hi,
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 !
Solved! Go to Solution.
10-07-2020 05:33 AM
Hello Islam
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.
Stefano
10-07-2020 04:45 AM - edited 10-07-2020 04:46 AM
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 path
filters to prune your Swagger file?
10-07-2020 05:02 AM
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!
10-07-2020 05:33 AM
Hello Islam
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.
Stefano
10-07-2020 05:48 AM
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!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide