I have a method signature for a rest method in a Spring-Boot RestController that looks like this:
@RequestMapping(
value = "/path",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
produces = MediaType.APPLICATION_JSON_VALUE
)
@ApiImplicitParams({
@ApiImplicitParam(
name = "message",
value = "Message that is sent to the method",
required = true,
dataType = "string",
paramType = "body"
)
})
public @ResponseBody String receiveMessage(@RequestBody String message) {
return "{\"success\": true}";
}
I would like to provide a “sample” value for a parameter messagethat is a JSON string (for example, {"key": "value"}). Does anyone know how I can do this using Swagger annotations? I did my best
@ApiImplicitParams({
@ApiImplicitParam(
// ...
example = "...JSON value..."
)
})
but it didn’t work. What I would like to have is an “approximate value” in the documentation, which the reader can click to fill in the parameter value field in the documentation with a given standard value. Is it possible?
Here is a screenshot of how this might look:

"" : String - - -.