/pyang-json-schema-plugin

Pyang JSON Schema output plugin

Primary LanguagePythonApache License 2.0Apache-2.0

pyang-json-schema-plugin

This is a pyang JSON Schema output plugin. It takes YANG files and tries to produce a JSON Schema that validates JSON content payload as defined in RFC7951.

Here's an example when running from the test directory:

$ cd test/
$ pyang --plugindir ../ -f jsonschema ./test-module.yang > test-module.jsonschema

You can then validate the generated schema using e.g. the tv4 tool like so:

$ tv4 -b -v -s test-module.jsonschema -j test-module.json
Schema is valid
JSON is valid.