-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
How to specify the error response types for swagger #540
Comments
it looks like a good way to support this could be to check the Something like this perhaps? /**
* @throws {import("./errors/version-not-found.error").VersionNotFoundExeption}
*/
@TypedRoute.Post("/build")
buildFirmware(@Body() body: CreateBuildFirmwareDTO) {
return this.firmwareService.buildFirmware(body);
} export const VersionNotFoundError = 'Version not found';
export class VersionNotFoundExeption extends HttpException {
constructor() {
super(VersionNotFoundError, HttpStatus.BAD_REQUEST);
}
} |
Will support new decorator function But as I'm working another thing ( |
Is there at least a way to use both legacy decorators and nestia to generate a swagger document? that would allow us to keep using nestia while waiting for the exceptions to be implemented. Not having this feature would mean that we would have to stop using nestia in our project |
Not possible to adapt Instead, I'll provide you The next version will be published at this week. |
Upgrade to |
Even when no description being configured, the `description` field in swagger documents must have a `string` value at least `""`.
Complement #540 - `ISwaggerRoute.IResponseBody.description` is required.
Using the nestjs swagger api, I used to set the response errors and code with the different decorators like so
How can I specify those possible responses with nestia?
The text was updated successfully, but these errors were encountered: