RestController post endpoint multipart_form_data with @ParameterObject and MultipartFile can't be executed from Swagger-UI
15:35 05 Nov 2025

I have a class with the @RestController annotation which contains an endpoint defined like this

    @PostMapping(path = "/submitJob", consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }, produces = {MediaType.APPLICATION_JSON_VALUE})
    @RequestBody(content = { @Content(encoding = { @Encoding(name = "jobData", contentType = "application/json")})})
    public ResponseEntity> postJob(
                              @ParameterObject @RequestPart(name = "jobData", required = true) @Valid JobData jobData,
                              @Parameter(description = "portfolio file with fund and holding information") @RequestPart(name = "portfolioFile", required = true) MultipartFile portfolioFile,
                              @Parameter(description = "optional benchmark file for trigger thresholds") @RequestPart(name = "benchMarkFile", required = false) MultipartFile benchMarkFile)

which looks great in the swagger-ui; the JobData object is expanded into its fields, each with their own descriptions which come from the @Schema annotations on those fields.

However, when I fill in the form and try to execute the call, I get

{
  "status": "fail",
  "message": "An error occurred while processing the request.",
  "errors": [
    "Required part 'jobData' is not present."
  ]
}

Removing the @ParameterObject will display the object as JSON and then I can execute the call. Keeping @ParameterObject and removing the @RequestBody gives the same error.

Spring 6.1.15; what am I missing that is preventing this from working?

spring-boot swagger