-
Notifications
You must be signed in to change notification settings - Fork 519
Open
Labels
status: needs triageIssues which needs to be reproduced to be verified report.Issues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.Issues describing a broken feature.
Description
Description
When converting objects with different names with properties using plainToInstance, version control using since/until does not work.
class Sample {
@Expose({ name: 'fizz', since: 0, until: 1 })
foo: any;
@Expose({ name: 'buzz', since: 2 })
bar: any;
}
const result = plainToInstance(Sample, { fizz: 'fizz', buzz: 'buzz' }, { version: 2 });
console.log(result);
dependencies:
class-transformer: 0.5.1
typescript: 4.9.5
Expected behavior
When the plainToInstance method is executed with version 2 specified, it is expected to ignore the object “fizz” and return an instance of Sample where foo is undefined.
Sample { bar: 'buzz' }
Actual behavior
Sample { foo: 'fizz', bar: 'buzz' }
Metadata
Metadata
Assignees
Labels
status: needs triageIssues which needs to be reproduced to be verified report.Issues which needs to be reproduced to be verified report.type: fixIssues describing a broken feature.Issues describing a broken feature.