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
constmyMap=newMap<string,Landscape|Portrait>();myMap.set('landscape',newLandscape());myMap.set('portrait',newPortrait());exportclassCreateMyResource{
@Transform(({ value })=>{constobj=myMap.get(value.type);returnplainToInstance(obj,value)})topPhoto: Map<string,Landscape|Portrait>;}
I was trying to use the discriminator in @type as per documentation:
But my use case involves to use it in a Map construct like this:
When testing I found out that the discriminator doesn't work anymore and I cannot find out an workaround...
Can you please help me understand how to use it in order to have sub-types based on a property in a Map construct and not the base class?
The text was updated successfully, but these errors were encountered: