How to validate JSON against a YANG module.
The need for some automated tool was expressed in the IETF CCAMP Transport NBI Design Team (https://github.com/danielkinguk/transport-nbi).
See validation.md
for a description of the process.
Prerequisites on Linux:
bash 4.3.11
python 2.7.6
pyang 1.7.1
exactly, not laterjing 20131210
xmllint
optionalrfcstrip 0.2
patched to accept-f
perl 5.18
or later and also the JSON module
sudo apt-get install libjson-perl
andsudo apt-get install libfile-slurp-perl
- the folding/unfolding script is downloaded from (https://tools.ietf.org/html/draft-kwatsen-netmod-artwork-folding-08)
- Clone the repo and execute following
- docker build -t jsonyang:1 .
- docker run -v src:dst -w /json-yang jsonyang:1 ./run.sh dst/<json_path> dst/<yang_path>
Many thanks to all the design team and in particular to Carlo Perocchio.