I'm using Spring REST Docs (2.0.3.RELEASE) and Spring Auto Restdocs (2.0.6) to document a REST API.
When the request contains a query parameter that has no assigned value (empty string) the snippets produced by CliDocumentation.curlRequest()
and HttpDocumentation.httpRequest()
show the parameter duplicated. For example:
$ curl 'http://localhost:7001/my.app/books?code=&code=' -i -X
This happens whether I do
this.mockMvc.perform(
get("/my.app/books?code=")
...
or
this.mockMvc.perform(
get("/my.app/books").param("code", "")
...
This is similar to issue and duplicate, however this only happens for valueless parameters and the bug mentioned there was fixed in version 1.1.2.RELEASE of Spring REST Docs.
Note: I assume the issue is not with Spring Auto Restdocs since these are standard Spring REST Docs snippets.
Am I missing something?
As mentioned in the comments, this was a minor bug in Spring REST Docs that has been promptly fixed by @AndyWilkinson in this commit, to be released in version 2.0.5.RELEASE. Many thanks to @AndyWilkinson!