Tag Archives: spring restdocs

Last year I found out about spring restdocs, I really liked the idea so I created a small example and I wrote a post about it. That example is a simple REST service that exposes one resource and allows only GET operation on it. Last week I started a personal project that is also a REST service but exposes more resources and allows more HTTP operations on them so it is much better suited for a post about spring restdocs. In previous post I described all steps needed to setup a project for spring restdocs so in this one I will not repeat them and I will focus only in differences between them.

The first difference is related with how to run junit tests in a spring-boot project. In version 1.3.5.RELEASE it was like below:

.description("Error causes (OPTIONAL). If present, it contains the name of the fields related with this error.")

.optional(),

fieldWithPath("causes[].key")

.description("Error key. This should be used to locate the right translation for the error")

)));

}

and generated documentation looks like:

All the other resources and operations from this project are similar with these two and it does not make sense to repeat the information. I hope you found this post usefull and if you want all details, you can check the code and the entire generated documentation.