I wrote a fairly extensive REST API using Java Jersey (and JAXB). I also wrote the documentation using the Wiki, but it was a completely manual process that is very error prone, especially when we need to make changes, people tend to forget to update the wiki.
From a look around, most other REST APIs also manually create their documentation. But I am wondering if this might be a good solution for this.
Things to be documented for each endpoint:
- Service name
- Category
- URI
- Parameter
- Types of Parameters
- Response Types
- Response Type Scheme (XSD)
- Request and Response Examples
- Request Type (Get / Put / Post / Delete)
- Description
- Error codes that may be returned
And then, of course, there are common things in common, such as
- Security
- REST Review
- Error processing
- Etc
These general things are perfectly described once and do not require automation, but for the methods of the web service itself it seems highly desirable to automate it.
I thought about the possibilities of using annotations and writing a small program that generates XML, and then XSLT, which should generate the actual documentation in HTML. Does it make sense to use a custom XDoclet?
Any help would be greatly appreciated Alan
java rest jersey documentation automation
Alan Mc Kernan Nov 11 '09 at 9:22 2009-11-11 09:22
source share