I have this method in a SpringBoot 2 application:
@Test
public void shouldEchoTheParameter() throws Exception {
mockMvc.perform(get("/echo").param("echoMessage", "Test"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.message", is("Test")))
.andDo(document("echo-example",
preprocessResponse(prettyPrint()),
links(linkWithRel("self").ignored().optional()),
requestParameters(
parameterWithName("echoMessage").description("The message to be echoed")),
responseFields(
fieldWithPath("message").
description("The message echoed"))
));
}
I want to avoid to document this part of the payload:
{
"_links" : {
"self" : {
"href" : "http://localhost:8080/echo"
}
}
}
I included this:
links(linkWithRel("self").ignored().optional()),
but i have this error:
java.lang.IllegalStateException: No LinkExtractor has been provided and one is not available for the content type application/vnd.pxs.echo.v1+json;charset=UTF-8