I use spring rest docs to document my api.
Now I want to document my document my path in the form of
.../accounts/{userId}
but I get
.../accounts/123
The test part look as follows:
mockMvc.perform(RestDocumentationRequestBuilders.get("/accounts/{userId}",123)
.
.
.
.andDo(document("{methodName}",
preprocessRequest(prettyPrint()),
preprocessResponse(prettyPrint()),
pathParameters(
parameterWithName("userId").description("userId of the requested user.")
In my index.html, the path params are documented like I expect. What I found was that the table header of my path parameter docs is just the way I want it:
So had a look at the default snippets. Here I found the following:
So it seems that there is/was a problem with the curly brackets. I tried to copy that +{{path}}+
in a custom http-request.snippet. No success. I also tried to remove the nowrap
option but again, the in the path the value shown insted of the variable name.
Can someone tell me what might be the problem here? I hope I geave enough details.