0

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?

2
  • This is a bug in Spring REST Docs. Could you please open an issue so that we can fix it? Commented Oct 3, 2019 at 17:18
  • 1
    Thank you @AndyWilkinson . I have opened issue #647. Commented Oct 4, 2019 at 13:38

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.