I could solve this problem as follows. We can use the @APIImplicitParams annotation provided by the Swagger API to list all elements of the MultiValueMap form and use @APIignore in the MultiValueMap itself. Try it if something in the lines of code below works. Good luck. :)
@ApiOperation(value = "Create a new 'Student' object") @ApiImplicitParams({ @ApiImplicitParam(name = "X-ClientId", value = "X-ClientId", required = true, dataType = "String", paramType = "header"), @ApiImplicitParam(name = "id", value = "Enter an ID for the student.", dataTypeClass = String.class, paramType = "query"), @ApiImplicitParam(name = "name", value = "Enter a Name for the Student.", dataTypeClass = String.class, paramType = "query") }) ResponseEntity addStudent( @NotBlank @RequestHeader(value = X_CLIENTID) String headerXclient, @ApiIgnore @RequestParam MultiValueMap<String, String> requestParams) { StudentRequest request = new StudentRequest(requestParams); (... Your Code Implementation ...) };
source share