Skip to content
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

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

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

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.

@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
Projects
None yet
Development

No branches or pull requests

3 participants