1.0.3 • Published 1 year ago

@betsys-nestjs/api-description-builder v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago