Socket
Book a DemoInstallSign in
Socket

@betsys-nestjs/api-description-builder

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betsys-nestjs/api-description-builder

Builder for api description.

1.0.3
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
4
Weekly downloads
 
Created
Source

Api description library

This library is used to generate api description in form of a builder pattern style

Usage

Create new instance of builder. Reset buffer and start chaining commands to create your description. Finally, call build() to return string representation.

const descriptionBuilder: ApiDescriptionBuilder = new ApiDescriptionBuilder();

export class DummyController {
  @ApiOkResponse({
    description: descriptionBuilder
      .reset()
      .addReason('Dummy reason why response was ok.')
      .addMessage({ message: 'All good.' })
      .addReason('Different reason why response was ok.')
      .addMessage({ message: 'Its all good man.' })
      .build(),
  })
  async yourMethod(@Res() response: Response): Promise<void> {
    ...
  }
}

FAQs

Package last updated on 04 Jan 2023

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.