by aslom · 10y ago · 0 comments
However, what if the specs were able to capture what is in such human-readable pages (for example https://docs.cloudant.com/)? What if API spec could be automatically derived out of HTML pages? Embed some metadata in HTML page and then we have both cake (human-readable) and eat it (machine-readable)?
We ended up using Swagger, which doesn't solve as many of our problems (having documentation generated from code isn't as robust from a testing POV, particularly when your RESTful API is versioned), but my "perfect" is the enemy of the company's "good" :).
Scrape HTML to swagger: https://github.com/bobby-brennan/scrape-to-swagger
Swagger to HTML docs: https://github.com/lucybot/lucy-console
We also have a commercial version of the latter which you can see at any-api.com