添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have annotated my method like,

@ApiOperation( value = "Get time spent on category", response = CategoryBean.class, responseContainer = "List", notes = "API to get the time spent on all tasks based on category" )
@ApiImplicitParams( {
        @ApiImplicitParam( name = "x-auth-token", value = "", dataType = "string", required = true, paramType = "header" ) } )
@ApiResponses( value = {
        @ApiResponse( code = 200, message = "Success", response = CategoryBean.class, responseContainer = "List" ) } )
@RequestMapping( value = "/getTimeSpentOnCategory", method = RequestMethod.POST )
public ResponseEntity<?> getTimeSpentOnCategory( @RequestBody DashboardTaskRequestBean bean )
{/**some operation**/}

But in my swagger UI, I'am not able to get the Status code 200 and its message. Please explain why? The following picture is the snapshot of the UI, Where is the problem? At the top you see the status 200 with example value under Model Schema. At the bottom you see other possible codes. – gaganbm Apr 12, 2017 at 19:03 By the way, to the other question you have posted, please accept/upvote the answer if my answer clarified your question. That encourages developers to respond to questions on stackoverflow. – gaganbm Apr 12, 2017 at 19:05 Where is the message displayed which I configured for code 200? And, I have up voted the answers, but I'am short by 1 point of reputation, so it won't be reflected. So, please up vote my question, if you feels it is valid. – Virat Apr 13, 2017 at 7:03

This is a known issue and looks like it is fixed with version 3.0.

As I see it, you are able to see the response structure at the top, but it is not visible in the table at the bottom of the screenshot.

This is also raised here and is fixed with version 3.0 :

https://github.com/swagger-api/swagger-ui/issues/1505

https://github.com/swagger-api/swagger-ui/issues/1297

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.