spring-restdocs icon indicating copy to clipboard operation
spring-restdocs copied to clipboard

Provide support for documenting query parameters

Open metoluke opened this issue 11 years ago • 1 comments

Having used spring-restdocs to document several of our hypermedia driven APIs, the only part that felt more manual than it perhaps could be, was the documentation of query parameters.

It would be good to be able to document these in a similar way to the withLinks() method, ideally with validation if any aren't specified.

I haven't had the chance to delve too much in to the code to know whether this is a valid suggestion! At some point I would like to contribute towards this project as I think the idea of tying the documenting to the tests is great.

metoluke avatar Mar 18 '15 13:03 metoluke

@metoluke Contributions, no matter how small, are always welcome.

I can imagine an API that's something like withQueryString(parameter("foo").withDescription("blah"), parameter("bar").withDescription("blah")). As you suggest, it could have similar validation to withLinks() so it would fail if a query parameter was used but was not documented and would also fail if a query parameter was documented but did not appear in the request.

wilkinsona avatar Mar 25 '15 10:03 wilkinsona