docs.nestjs.com
docs.nestjs.com copied to clipboard
docs(openapi): Add docs to throw different exceptions under the same …
…http code
PR Checklist
Please check if your PR fulfills the following requirements:
- [ x] The commit message follows our guidelines: https://github.com/nestjs/docs.nestjs.com/blob/master/CONTRIBUTING.md
PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [x] Docs
- [ ] Other... Please describe:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
I think it's worthy to add this part to the docs because the decorator @ApiExtraModels()
doesn't have an concrete example of its implementation.
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
can you add a hint at the end to tell from where refs
is imported? I didn't find any reference to this utility in the docs yet
Like this one
@micalevisk Done, is it OK?
@Injectable()
export class CatController {
@ApiExtraModels(BadAppCodeException, BadEmailException)
@ApiBadRequestResponse({
schema: {
oneOf: refs(BadAppCodeException, BadEmailException),
},
})
multipleErrorsResponse() { ... }
}
some indentation
@micalevisk Added indentation