API Docs
nickl- opened this issue · 3 comments
Would you please tell me, should you know, what is used to generate http://pve.proxmox.com/pve2-api-doc/ from json-schema?
I would owe you a huge favour in return =)
To be honest... I actually have no idea :s
I just did up my docos and stuff for this class manually. No autogen used here...
.
https://git.proxmox.com/?p=pve2-api-doc.git;a=blob;f=data/extractapi.pl
This script is run as part of installation of the PVE2 API Doc package. It actually generates the JSON schema itself from the Perl source on whatever machine it's installed on, where the expected Schema values are defined/maintained alongside the actual logic they describe. Then, a custom-built ExtJS app actually reads in the schema and presents it in the Proxmox UI fashion. The schema is actually placed at the top of a file called apidoc.js
, which also contains the ExtJS application itself, so you could probably leverage that to present your own JSON schema in the same fashion - simply replace the PVE2 API schema with your own.
As a side note, the version of the API docs linked above (and in the README) is actually lagging behind the actual API present in the latest ProxMox version(s). I'm not sure by how much, though.