08-21-2019 06:19 AM - edited 08-21-2019 06:21 AM
Hi all,
NSO is using yanger to validate the yang models internally.
Is it possible to generate a HTML document based on defined yang model, like pyang does it?
If not: It is recommend to generate a HTML doc by pyang, although NSO is using only yanger?
Output of yanger help page:
$ yanger --help Usage: yanger [-h] [-v] [--print-error-code] [-p <path>] [-P <plugindir>] [-c] [--strict] [-e] [-W <warning>] [-w <no_warning>] [-E <error>] [-f <format>] [-t <transform>] [--deviation-module <deviation_module>] [-F <features>] [-o <outfile>] [--no-deviation-apply] [--print] [--print-all] <file>... [...] -f, --format Convert to FORMAT. Supported formats are: fxs,jsoninfo,sn,swagger,tree,yang.
Output of pyang help page:
$ pyang --help
Usage: pyang [options] [<filename>...]
Validates the YANG module in <filename> (or stdin), and all its dependencies.
Options:
[...]
-f FORMAT, --format=FORMAT Convert to FORMAT. Supported formats are: dsdl, depend, sample-xml-skeleton, omni, yin, tree, html, jstree, capability, yang, xsd, uml, rest-doc, jtox, jsonxsl
Thanks
Solved! Go to Solution.
08-22-2019 01:22 AM
There is no HTML output format for Yanger.
The closest thing is a two step procedure where Swagger (for RESTCONF) can be generated with Yanger and saved to file
yanger -t expand -f swagger example-jukebox.yang > example-jukebox.yang.swagger.json
This file can then be viewed with Swagger/OpenAPI tools, e.g. Swagger UI.
08-22-2019 01:22 AM
There is no HTML output format for Yanger.
The closest thing is a two step procedure where Swagger (for RESTCONF) can be generated with Yanger and saved to file
yanger -t expand -f swagger example-jukebox.yang > example-jukebox.yang.swagger.json
This file can then be viewed with Swagger/OpenAPI tools, e.g. Swagger UI.
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