ConfD User Community

Convert Yang models to JSON


#1

Hi,
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.
Thanks


#2

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