question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@ApiParam(example="..") doesn't work for @RequestBody

See original GitHub issue

Hi! @ApiParam(example="..") doesn’t work for @RequestBody. For example, in such case “message” is not rendered in Swagger UI.

    @PostMapping(path = "/simple")
    String simple(@ApiParam(example = "message") @RequestBody String body) {
        return body;
    }

I’ve already investigated the problem, will submit a PR soon. Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
smily75commented, Sep 3, 2019

I have the same problem, in the swagger ui it doesn’t work, but in the editor I see the example. Is anything wrong with my configuration?

1reaction
dumbdonkeycommented, Jul 30, 2019

same problem here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot + Swagger + Swagger UI and @RequestBody ...
You could work around it by not using @ApiImplicitParams , but by annoting your method parameter itself with the @ApiParam annotation:
Read more >
Swagger @ApiParam vs @ApiModelProperty - Baeldung
The @ApiModelProperty annotation allows us to control Swagger-specific definitions such as description (value), name, data type, example values, ...
Read more >
Adding Examples - Swagger
An example illustrates what the value is supposed to be. A default value is what the server uses if the client does not...
Read more >
Building requests | Postman Learning Center
For example, if you're working with an API for a To Do list ... If your request doesn't require body data, auth, or...
Read more >
Springfox Reference Documentation - GitHub Pages
Downloading the source archive and building will NOT work! 1.4.1. Pre-Commit Build. Code quality (code coverage, checkstyle).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found