ConfD User Community

Convert Yang models to JSON


Is there any tool, to convert yang models to json?
So far, I have been trying to work with ‘pyang -f jsonxsl -o test.xsl tailf-common.yang’ but end up getting bunch of errors.
If I try the same command for other yang models that import tailf-common, I get an error, stating that ‘JSONXSL plugin needs a valid module’.

Any help will be appreciated.


You probably do not want to convert tailf-common.yang itself, but you might need to have it on the search path. So the command would be something like

pyang -f jsonxsl -o test.xsl --path=$CONFD_DIR/src/confd/yang test.yang