Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add default type to Api Error Responses #1480

Closed

Conversation

dariusj18
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Currently each of the error api response decorators do not specify a type, despite the responses having common information.

What is the new behavior?

This PR adds a DTO class for each response type and sets them as the default value for type. It is set before the spread operator so that the use can still pass in their own type.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

This adds a default type to each response, which may not be expected.

@kamilmysliwiec
Copy link
Member

This will generate an incorrect schema for everyone with a custom global exception filter.

Let's track the alternative solution/approach to this issue here #2548

@nestjs nestjs locked and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants