Dropwizard Spring REST Docs Demo
Sample application demonstrating how to use Spring REST Docs
with non-Spring projects like Dropwizard.
This is possible with REST Assured and it can even be used to document external REST APIs.
Just because it is possible, it does not mean that it’s a good idea.
Therefore, advantages and disadvantages are listed below.
This project was created with
$ mvn archetype:generate -DarchetypeGroupId=io.dropwizard.archetypes -DarchetypeArtifactId=java-simple -DarchetypeVersion=1.2.2
and afterwards Spring REST Docs was added with a minimal configuration.
See the BookResourceTest
for an example of such a test.
Advantages
Disadvantages
For projects using Jersey, restdocsext-jersey can be used as an alternative.
The Jersey Test Framework allows to write more lightweight tests.
See the GitHubApiTest
for an example of such a test.
Advantages
Disadvantages
The API documentation can be generated with mvn package
.
It can also be
viewed here.