Open
Description
Description
We use default strategy excludeAll and created the following class:
export class Data { @Expose() @IsOptional() public metadata?: Record<string, unknown>; }
But after transformation we got metadata field is empty object. All metadata field keys are removed in getKeys method.
It will be great if there are all fields from metadata property after transformation.
We found workaround but we think it is not good enough.
export class DownloadData { @Expose() @IsOptional() @Transform((value) => value.obj?.metadata) public metadata?: Record<string, unknown>; }
Proposed solution
For example, add to @Expose()
a property { strategy: 'exposeAll' }
. (@Expose('exposeAll' )
).
Thanks in advance.