spring-bootspring-mvcspring-restdocs

Rest doc for PUT request with request param but without request body setting content type as form url encoded


I have noticed that rest doc (HttpRequestSnippet.java) is setting APPLICATION_FORM_URLENCODED_VALUE as content type for PUT with request parameter and without request body. This should be corrected, may be introducing a MEDIATYPE as NONE and set content type as NONE or ALL when request body/content empty. For example, my put request is like below:

/api/v1/config/?mode=unknow

Solution

  • This sounds like a bug in Spring REST Docs' HttpRequestSnippet for which I've opened an issue.