迁移向导¶
如果你正在使用@nestjs/swagger@3.*,请注意下面在 4.0 版本中对/API 的更改。
突发的变化¶
以下装饰器已被更改/重命名:
@ApiModelPropertyis now@ApiProperty@ApiModelPropertyOptionalis now@ApiPropertyOptional@ApiResponseModelPropertyis now@ApiResponseProperty@ApiImplicitQueryis now@ApiQuery@ApiImplicitParamis now@ApiParam@ApiImplicitBodyis now@ApiBody@ApiImplicitHeaderis now@ApiHeader@ApiOperation({ title: 'test' })is now@ApiOperation({ summary: 'test' })@ApiUseTagsis now@ApiTags
DocumentBuilder breaking changes (updated method signatures):
addTagaddBearerAuthaddOAuth2setContactEmailis nowsetContactsetHosthas been removedsetSchemeshas been removed (use theaddServerinstead, e.g.,addServer('http://'))
新方法¶
添加了以下方法:
addServeraddApiKeyaddBasicAuthaddSecurityaddSecurityRequirements