Skip to content

Is it possible to provide dynamic model type as parameter to @SerializableProperty()? #18

Open
@krishnauppili

Description

@krishnauppili

@serialize({})
export class SocialEntity extends Serializable{
@SerializeProperty({ map: 'entity_type' })
public entityType:string;

@SerializeProperty({
map: 'entity',
type:entityType == 'user'?UserProfile:entityType=='team'?TeamProfile:PageProfile
})
public entity:UserProfile | TeamProfile | PageProfile;
}

Something like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions