It’s my pleasure to announce the release of Spring REST Docs 1.1.0.RELEASE which is now available for Maven Central, JCenter and our release repository.
As an alternative to the lightweight server-less documentation generation offered by Spring Framework’s
MockMvc, you can now use REST Assured to test and document your RESTful services. This opens up Spring REST Docs to all four corners of the JVM and beyond, allowing you to document anything that you can access via HTTP.
The samples now include an app that is documented using REST Docs, built using Grails, and tested using Spock. A third-party sample that uses REST Docs to document an API implemented using Ratpack is also available. My thanks to Jenn Strater who wrote both samples.
Support has been added for generating Markdown snippets. On its own, Markdown isn’t as capable as Asciidoctor, but can work very well when combined with existing documentation toolchains such as Slate.
In addition to the existing support for using JUnit, you can now use Spring REST Docs with TestNG.
Snippets can now be created once with some common configuration and then reused. This reduces repetition when documenting common parts on an API, such as
self links. My thanks to Marcel Overdijk whose feedback and pull requests have significantly improved this new feature.
By default, Spring REST Docs will cause your tests to fail if you’ve neglected to document something or if you’ve attempted to document something that doesn’t exist. This is great for detailed API documentation, but can be restrictive when documenting a scenario where you want to focus on a specific part of a request or response. Rather than having to explicitly ignore everything that you don’t want to document, you can now use relaxed snippets for documenting links, request and response fields, and request and path parameters.
By default, Spring Boot 1.3 uses Spring REST Docs 1.0. To use 1.1, you should override the version configured in Boot’s dependency management in your pom.xml or build.gradle:
<properties> <spring-restdocs.version>1.1.0.RELEASE</spring-restdocs.version> </properties>