@betsys-nestjs/api-description-builder
v1.0.3
Published
Builder for api description.
Downloads
17
Maintainers
Keywords
Readme
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> {
...
}
}