Socket
Socket
Sign inDemoInstall

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

Package Overview
Dependencies
0
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

NestJS Swagger decorator for API exceptions


Version published
Weekly downloads
14K
increased by2.45%
Maintainers
3
Install size
44.1 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 12 Sep 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc