We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
related #532 cc @patrykpacewicz
Seems the PR that introduced this support only captures the first @Encoding definition. It's possible to have more than one.
@Encoding
package org.example.springbased.web; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Encoding; import io.swagger.v3.oas.annotations.parameters.RequestBody; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @RestController @RequestMapping("/test") public class TestController { @PostMapping(value ="/first", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity<String> uploadMultipartWithBody( @RequestBody(content = @Content(encoding = @Encoding(name = "file", contentType = MediaType.APPLICATION_OCTET_STREAM_VALUE))) @Parameter(required = true) @RequestPart("file") MultipartFile file, @RequestBody(content = @Content(encoding = @Encoding(name = "dto", contentType = MediaType.APPLICATION_JSON_VALUE))) @Parameter(description = "An extra JSON payload sent with file") @RequestPart("dto") DTO dto){ return ResponseEntity.ok("Request Accepted: " + dto.toString()); } }}
dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6' implementation 'org.springframework.boot:spring-boot-devtools' }
To Reproduce Steps to reproduce the behavior:
Expected behavior
The output should include both encoding definitions.
encoding
requestBody: content: 'multipart/form-data': schema: type: object required: - dto - file properties: dto: type: string file: type: string format: binary encoding: file: contentType: application/octet-stream dto: contentType: application/json
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
related #532
cc @patrykpacewicz
Seems the PR that introduced this support only captures the first
@Encoding
definition. It's possible to have more than one.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The output should include both
encoding
definitions.Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: