In a project I was working on, I developed a nice couple of classes to automagically document our API for us, later I extracted it to an external component for other applications to use it, and now I'm putting it out here for the world.
It's nothing complicated, but it helps set a standard across different apps that publish an API in your organization.
All you need to do, is
-
Add the dependency to the component in your web application
ar.com.jmfsg api-doc 0.0.27 -
Import the component context in your application context
-
Write your doc file -- see the sample application with an example.
-
Specify where to find the doc file
And that's it!
When you run your application, you'll see your pretty documentation
-
The sections supported in the detailed view are kind of hardcoded (they are optional, but hardcoded) to what we used internally -- parameters, filters, options, and facets. I plan on making it generic so you can define your own sections somewhere in the doc file, and specify the field list for them. (this will probably break compatibility, but I don't expect it to be that difficult)
-
The toggle is suboptimal code, there's a TODO in there.