Swagger Ui forcing input as File upload type instead of Text

Viewed 185

I have an endpoint to save some data. I mapped the input json to a class with name File.

@PutMapping(path = "/file")
public boolean save(@RequestBody File file) {
   // logic
}

When hooked up with swagger, the swagger ui considers this as a file type input.

enter image description here

How can I force the value on swagger ui to consider it as a regular text instead of a file upload?

Expected:

enter image description here

I tried :

@PutMapping(path = "/file", consumes = "application/json")
0 Answers
Related