Skip to content

Request parameters ignored for HTTP DELETE #683

Closed
@giorgimode

Description

@giorgimode

In generated curl-request.adoc and http-request.adoc files the request parameters are ignored when using param builder:

this.mockMvc.perform(delete("/users").param("username", "Tester")) 
	.andExpect(status().isOk()) 
	.andDo(document("delete-user"))

However, this one works:

this.mockMvc.perform(delete("/users?username=Tester")) 
	.andExpect(status().isOk()) 
	.andDo(document("delete-user"))

I have tried using RestDocumentationRequestBuilders as well. Same result.
Generated curl-request.adoc:

[source,bash]
----
$ curl 'http://localhost:8080/users/' -i -X DELETE
----

How it looks like without using param builders:

[source,bash]
----
$ curl 'http://localhost:8080/users/?username=Tester' -i -X DELETE
----

Using:
org.springframework.boot:spring-boot:2.2.6.RELEASE
org.springframework.restdocs:spring-restdocs-mockmvc:2.0.4.RELEASE
org.springframework.restdocs:spring-restdocs-asciidoctor:2.0.4.RELEASE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions