We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
springdoc
Learn more about funding links in repositories.
Report abuse
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
Describe the bug A controller that consumes a MultipartFile and has a query parameter generates an incorrect spec.
MultipartFile
To Reproduce Steps to reproduce the behavior:
"/api/v1/file-upload": { "post": { "operationId": "uploadFile", "parameters": [ { "name": "targetDirectory", "in": "query", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "required": [ "file" ], "type": "object", "properties": { "file": { "type": "string", "format": "binary" } } } } } } [...] } },
"/api/v1/file-upload": { "post": { "operationId": "uploadFile", "requestBody": { "content": { "multipart/form-data": { "schema": { "required": [ "file" ], "type": "object", "properties": { "file": { "type": "string", "format": "binary" }, "targetDirectory": {} } } } } } [...] } },
@RestController @RequestMapping("/api/v1/file-upload") public class FileUploadController { @PostMapping(consumes = {"multipart/form-data"}) @ResponseStatus(HttpStatus.NO_CONTENT) @PreAuthorize(UPLOAD_FILES) public void uploadFile( @RequestParam("targetDirectory") String targetDirectory, @RequestParam("file") MultipartFile multipartFile) throws IOException { } }
Expected behavior
targetDirectory
CC @Digirik
The text was updated successfully, but these errors were encountered:
@Nikos410,
This is not a bug. But is an expected behavior. Both representations are correct. A property will be introduced to accept both.
Starting from next release 1.6.11 you can use:
1.6.11
springdoc.default-support-form-data=false
Sorry, something went wrong.
Query parameter part of request body in controller with MultiPartFile. …
7ad1bb7
…Fixes #1793
Changes report #1793
6024bed
No branches or pull requests
Describe the bug
A controller that consumes a
MultipartFile
and has a query parameter generates an incorrect spec.To Reproduce
Steps to reproduce the behavior:
Expected (Generated spec with version 1.5.10):
Expected behavior
targetDirectory
should be a query parameter, not part of the request bodyCC @Digirik
The text was updated successfully, but these errors were encountered: