Skip to content

RestDocumentationRequestBuilders' methods for multipart file uploads are not aligned with MockMvc's MockMvcRequestBuilders #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marcgemis opened this issue Jan 7, 2022 · 2 comments
Labels
Milestone

Comments

@marcgemis
Copy link

The documentation under https://docs.spring.io/spring-restdocs/docs/2.0.5.RELEASE/reference/html5/#documenting-your-api-request-parts for MockMvc has
this.mockMvc.perform(multipart("/upload").file("file", "example".getBytes()))

I think this should be
this.mockMvc.perform(fileUpload("/upload").file("file", "example".getBytes()))

as fileUpload is defined in RestDocumentationRequestBuilders and multipart in MockMvcRequestBuilders

@wilkinsona wilkinsona changed the title Documentation for Request Parts mentions 'multipart' instead of 'fileUpload' RestDocumentationRequestBuilders' methods for multipart file uploads are not aligned with MockMvc's MockMvcRequestBuilders Jan 7, 2022
@wilkinsona
Copy link
Member

Thanks, @marcgemis. Rather than changing the docs, I think that RestDocumentationRequestBuilders should be updated so that it offers multipart methods. The existing fileUpload methods should probably be deprecated as well to keep things closely aligned with MockMvcRequestBuilders.

@wilkinsona wilkinsona added type: bug A bug and removed status: waiting-for-triage Untriaged issue labels Jan 7, 2022
@wilkinsona wilkinsona added this to the 2.0.6.RELEASE milestone Jan 7, 2022
@marcgemis
Copy link
Author

Please note that in https://docs.spring.io/spring-restdocs/docs/2.0.5.RELEASE/reference/html5/#documenting-your-api-request-parts-payloads-body "fileUpload" is used in the documentation. This will have to be updated when "multipart" became the new standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants