@ApiResponses and @ApiResponses in swagger

20,273

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

Share:
20,273
Virat
Author by

Virat

Updated on July 09, 2022

Comments

  • Virat
    Virat almost 2 years

    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, enter image description here