Skip to content

Encoding section for multipart requests do not work #531

@patrykpacewicz

Description

@patrykpacewicz

Describe the bug
swagger.io documentation has support for adding your own Content-Type for specific parts of multipart / form-data request and springdoc also has this support, but when it's set, it doesn't appear in the result JSON

To Reproduce

@RestController
public class HelloController {

    @PostMapping(value = "/test/103", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    @Operation(
            requestBody = @RequestBody(content = @Content(encoding = @Encoding(name = "body", contentType = "application/json")))
    )
    public String postMyRequestBody(
            @RequestPart("body") ExampleBody body,
            @RequestParam("file") MultipartFile file
    ) { return null; }
}

Expected behavior
In the JSON response, we should see additional section

"encoding":{ "body":{ "contentType":"application/json" } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions