Swagger: ApiResponse hierarchy

Created on 22 Jan 2018  路  4Comments  路  Source: nestjs/swagger

First of all, nice work integrating Swagger, I'll use it on my next project.

This is a possible feature. At this moment, if you use ApiResponse decorator at controller level, when you add additional ApiResponse at method level, you loose the main api responses configured before.

Example
dummy.controller.ts
@Controller('dummy') @ApiResponse({ status: 400, description: 'Bad request'}) @ApiResponse({ status: 403, description: 'Forbidden.'}) export class DummyController { @Post() @ApiResponse({ status: 201, description: 'Created'}) public getItems(@Req() req, @Res() res) { ... } }

In this case, Swagger only displays the status 201 as response. Maybe it would be more helpful to inherit main controller responses, displaying 201, 400 & 403.

What do you think?

bug

Most helpful comment

Fixed. I'll push it soon. 馃檪

All 4 comments

@fwoelffel @kamilmysliwiec any info on this issue?

I'm also having this issue

Fixed. I'll push it soon. 馃檪

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alisherks picture alisherks  路  4Comments

itslenny picture itslenny  路  3Comments

djedlajn picture djedlajn  路  4Comments

leefordjudes picture leefordjudes  路  4Comments

cdiaz picture cdiaz  路  4Comments