jsonrestgrails-3.0

How to create documentation for a JSON API using Grails3


We will create a Grails 3 project exposing a REST JSON API using Grails Controllers.

Is there a way to generate automatically an API documentation for the REST API, using annotations, or any other manageable form that will keep up with our development? In other words we need a way to automatically generate the API documentation in sync with changes in controller actions and parameters / returned objects.

We looked at Swagger and some similar projects but we could not manage to find a way to integrate a documentation workflow in our Grails 3 REST API development process. So far we found those really promising projects that could help us, but we have not found any way to integrate to Grails 3:


Solution

  • This library looks like the most popular choice for Grails 3:

    https://github.com/rahulsom/swaggydoc

    You can see from the issues that some people have had success getting it to work with 3.x, but as with any open source project your millage may vary.

    https://github.com/rahulsom/swaggydoc/issues