Closed mlbonniec closed 1 year ago
Please provide a minimum reproduction repository. You can start from this minimal project.
@micalevisk I've updated the original message, sorry :)
If you're using swagger, then you should use PartialType
from @nestjs/swagger
, not @nestjs/mapped-types
Is there an existing issue for this?
Current behavior
Hi, I've noticed that when extending a class (
Child
) from another (Parent
), usingPartialType
(for example, but this is the same with the other wrappers) doesn't add theParent
properties decorators to theChild
.How did I notice this ? I've some swagger
@ApiProperty()
decorators in myCreateDto
, and when extending theUpdateDto extends PartialType(CreateDto) {}
, theUpdateDto
doesn't have any properties in the Swagger.``However, removing the
PartialType
wrapper "fix" the issue.Reproduction
https://stackblitz.com/edit/nestjs-issue-minimum-repro-starter-2zmyjl
Expected behavior
All the
Parent
properties decorators should be copied to theChild
.Package version
2.0.2
Node.js version
18.16.1
In which operating systems have you tested?
Other
No response