You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@nanogiants/nestjs-swagger-api-exception-decorator

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nanogiants/nestjs-swagger-api-exception-decorator

NestJS Swagger decorator for API exceptions

1.7.2
latest
Source
npmnpm
Version published
Weekly downloads
17K
-7.94%
Maintainers
0
Weekly downloads
 
Created
Source

NestJS Swagger API Exception Decorator

Node.js CI Quality Gate Status Coverage npm npm downloads

Description

NestJS Swagger decorator for API exceptions.

Installation

$ npm i @nanogiants/nestjs-swagger-api-exception-decorator

Example

import { ApiException } from '@nanogiants/nestjs-swagger-api-exception-decorator';

@ApiException(() => UnauthorizedException)
export class Controller {
  @ApiOperation({ summary: 'Changes the users password' })
  @ApiException(() => [PasswordsDidNotMatchException, OldAndNewPasswordMatchException, CredentialsNotValidException])
  @Patch('/password')
  async changeUserPassword(@Res() res: Response): Promise<void> {
    return res.sendStatus(HttpStatus.OK);
  }
}

Getting Started

Please visit our documentation to get started.

Release Notes

Please visit the Release Notes in our documentation for major and minor releases. Patch releases are documentated in GitHub Releases.

Keywords

nestjs

FAQs

Package last updated on 07 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts