Hi,

If you are looking for a way to quickly document
your api based on http, have a look to this package

https://github.com/mh-cbon/testndoc

Using your test suite, it can generate a simple q&d documentation.

It works by proxy your router and spy the request  / responses
made on it.

For that idea credits goes to test2doc 
https://github.com/adams-sarah/test2doc

I made a new package for my own taste, 
- simpler templating / programming
- improved package data extraction
to not rely on a third party as much as possible.

For the moment testndoc 
- handles only mux.Routers, it is possible to support other router, if one 
wants it.
- handles only markdown output, up to you if you want stuff like API 
blueprint/wahtever/

It is still a WIP, lots of polish to be done, 
and it needs to support metadata injection
to add more information to the API 
that the spy can t determine by himself.
(nothing very difficult here, 
program loading and parsing is already done (thanks go/loader!!!), 
its just about string parsing)

Final, note it is quiet un-intrusive, 
it does not enforce you to declare your api in a special way.
The only modification is to replace your router with a proxy 
in your tests, see the doc.

Small example of a first generation result,
https://github.com/mh-cbon/testndoc/blob/master/demo.md

~~ HTH

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to