Slide 19
Slide 19 text
APIs
Spring REST Doc
© msg | November 2017 | Continuous Lifecycle Mannheim | Continuous Delivery for your Documentation | Alexander Schwartz 19
Test case plus Documentation Stub…
this.mockMvc.perform(get("/notes"))
.andExpect(status().isOk())
.andDo(document("notes-list-example",
links(
linkWithRel("self")
.description("Canonical link for this resource"),
linkWithRel("profile")
.description("The ALPS profile ...")),
responseFields(
subsectionWithPath("_embedded.notes")
.description("An array of ..."),
subsectionWithPath("_links")
.description("... to other resources"))));
[[resources-notes-list]]
=== Listing notes
A `GET` request will list all of the service's notes.
operation::notes-list-example
[snippets='response-fields,
curl-request,http-response,links']