@betsys-nestjs/api-description-builder
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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> {
    ...
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @betsys-nestjs/api-description-builder

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

2.56 kB

Total Files

5

Last publish

Collaborators

  • betsys-development
  • pawelnowak1
  • andrejsoucek
  • jammie88
  • jiraspe2
  • jakubschneller
  • javor454
  • krizacekcz
  • flyrell