spring-restdocs
spring-restdocs copied to clipboard
Provide a fluent API for snippet configuration
Since REST assured is based on a fluent API it would be awesome if Spring REST docs could provide a fluent (builder) API in addition to the varargs based approach.
(haven't looked in the Spring MVC usage pattern yet).
For example, instead of
responseFields(
fieldWithPath("contact").description("The user's contact details"),
fieldWithPath("contact.email").description("The user's email address"))
maybe sth like
request()
.param("id","User's id")
response()
.field("contact","The user's contact details")
.field("contact.email","The user's email address")
Just a minor enhancement but would probably better align the paradigms. Nothing serious ;-)
I'd like to investigate this one as part of 2.1. I'm interested in what's possible with a Java 8 baseline and lambdas.