I'm submitting a...
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
Current behavior
I want to try this library so I decide to map this class
`
class CreateProjectDto {
@isnotempty()
@AutoMap()
title: string;
@isnotempty()
@AutoMap()
description: string;
@isnotempty()
@AutoMap()
requestExpireDate: Date;
@isnotempty()
@AutoMap()
deadlineInDay: number;
@isnotempty()
@AutoMap()
deadlineDate: Date;
@isnotempty()
@AutoMap()
managerPhone: string;
@isnotempty()
@AutoMap()
managerName: string;
@isnotempty()
@AutoMap()
tagId: string;
@isnotempty()
@AutoMap()
companyId: string;
@isnotempty()
@AutoMap()
projectOwnerId: string;
@isnotempty()
@AutoMap()
price: number;
}
to this class
class ProjectRoDto {
@AutoMap()
id: string;
@AutoMap()
title: string;
@AutoMap()
description: string;
@AutoMap()
requestExpireDate: Date;
@AutoMap()
deadlineInDay: number;
@AutoMap()
deadlineDate: Date;
@AutoMap()
managerPhone: string;
@AutoMap()
managerName: string;
@AutoMap()
tagId: string;
@AutoMap()
companyId: string;
@AutoMap()
projectOwnerId: string;
@AutoMap()
price: number;
}
with this profile
@Profile()
export class ProjectProfile extends ProfileBase {
constructor(mapper: AutoMapper) {
super();
mapper
.createMap(CreateProjectDto, ProjectRoDto)
.forMember((d) => d.id, ignore());
}
}
but I get this error
Error: Mapping not found for source function Object() { [native code] } and destination class ProjectRoDto {
static _OPENAPI_METADATA_FACTORY() {
return { id: { required: true, type: () => String }, title: { required: true, type: () => String }, description: { required: true, type: () => String }, requestExpireDate: { required: true, type: () => Date }, deadlineInDay: { required: true, type: () => Number }, deadlineDate: { required: true, type: () => Date }, managerPhone: { required: true, type: () => String }, managerName: { required: true, type: () => String }, tagId: { required: true, type: () => String }, companyId: { required: true, type: () => String }, projectOwnerId: { required: true, type: () => String }, price: { required: true, type: () => Number } };
}
}
`
also I use nestjs module of this library("nestjsx-automapper": "3.0.10")
and nestjs version is 7.0.13
Environment