When using the PartialType for DTO, it is not reflected in the OpenAPI documentation.
https://docs.nestjs.com/openapi/mapped-types
export class CreateUserDTO {
@IsNotEmpty()
@IsString()
name: string;
}
export class UpdateUserDTO extends PartialType(CreateUserDTO) {
}
UpdateUserDTO schema in the OpenAPI documentation is missing the name property
OpenAPI document to have name: string in UpdateUserDTO Schema. But missing the name property in the generated schema.
Nest version: 7.0.0
For Tooling issues:
- Node version: 12.18.1
- Platform: Windows
Others:
Please provide a minimum reproduction repository.
Sample Repo: https://github.com/kalaivanan-muthusamy/nestjs-swagger-issue-1074


I am expecting the properties in CreateUserDto should also exist in UpdateUserDto as optional. But the properties are not present in the schema
Import PartialType from @nestjs/swagger
I missed it completely. It is clearly mentioned in the document. Thanks for the wonderful document.
This should be the issue with cli then. As CLI is importing the PartialType from @nestjs/mapped-types instead @nestjs/swagger.
Opened the PR for the expected change
https://github.com/nestjs/schematics/pull/545
Most helpful comment
Import
PartialTypefrom@nestjs/swagger