You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the resulting OpenAPI spec you would expect that the response schema for doSomething is Reponse, the specialized subclass ResponseDto. However, the OpenAPI spec uses BaseResponse instead, the parent class.
Minimum reproduction code
Example in the description above
Steps to reproduce
No response
Expected behavior
For inherited classes I would expect the schema name of the subclass to be used, not of the parent class.
Is there an existing issue for this?
Current behavior
Assume you define two DTOs that inherit from each other:
Then use this class in your controller:
In the resulting OpenAPI spec you would expect that the response schema for
doSomething
isReponse
, the specialized subclassResponseDto
. However, the OpenAPI spec usesBaseResponse
instead, the parent class.Minimum reproduction code
Example in the description above
Steps to reproduce
No response
Expected behavior
For inherited classes I would expect the schema name of the subclass to be used, not of the parent class.
The error lies in the following piece of code in lib/services/schema-object-factory.ts:
It should be replaced by
to use the schema name of the subclass.
Package version
8.0.5
NestJS version
10.4.7
Node.js version
20.11.1
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: