-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi-
We are using an older version 0.8 and it wasn't generating the swagger documents. I've upgraded to the latest version (2.3.1) and also it was not generating. I've traced the issue to an abstract DTO we had defined.
export abstract class AbstractDto {
/**
* Required method for all DTOs for Swagger documentation.
* Forces subclass to implement the required Swagger / OpenAPI "public static example()" method.
*/
public static example(): ApiResponseDto<unknown> | AbstractDto {
//JDR - TEST Commenting the throw out to see if Swagger Generates
//throw new Error(`Concrete DTO implementations must implement their own method: "public static example(): ApiResponseDto"`);
return this;
}
}
Originally it just had the throw. As you can see I commented out the throw and had it return itself. After I did that the swagger documentation generated without error. We have the exception in place there to ensure all implement the "example" method when creating. But this causes the generation of open-api.json GET call to fail. We don't want to remove our guardrail here if possible.
Metadata
Metadata
Assignees
Labels
No labels