You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(!options.type){constdesignTypeMeta=Reflect.getMetadata('design:type',target,propertyKey);// only store design:type metadata if it's not Array or Objectif(designTypeMeta&&designTypeMeta!==Array&&designTypeMeta!==Object){options.type=()=>designTypeMeta;}}
This from the source code of
@automapper/classes
packages/classes/src/lib/automap.ts
Why this ignore the type of Object and Array?
This causing the types with union types to be ignored because the
design:type
metadata of them areObject
if I have this property in entity:
this will be the metadata of it "from JS build code of my app"
I tried to remove that check from
@automapper/classes
and that property mapped correctly with@AutoMap
I think I am missing the reason why this check added in the first place so Idk if this safe to do.
It will work fine also if I added any constructor to the
@AutoMap()
no matter what was the typeOR
OR
All this solution I tried mapped the property correctly.
So idk what this constructor means to do?
I am enabling
strict
andstrictNullChecks
in tsconfigI am willing to create any PR fix in this issue as the discussion will lead to.
Thanks.
The text was updated successfully, but these errors were encountered: