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
Describe the bug
I have an issue when using Polymorphic Embeddables in combination with nested embedded properties. When two Polymorphs have a property with the same name their type is conflicting and ending mixed up. I think I traced the issue to this spot in
The properties Object receives the properties from both polymorhps. If multiple polymorphs have the same property name, the latter overwrites the former.
Example
Consider the shortened example from the Docs
In this case the food property of class Cat/Dog is ambiguos and depending on which polymorph is processed first, food might receive type Dogfood for Polymorph Cat or receive type Catfood for Polymorph Dog
Expected behavior
Depeding on the used polymorph, the property should receive the associated type
Versions
Dependency
Version
node
16
typescript
4.6.2
mikro-orm
5.0.4
@mikro-orm/postgresql
5.0.4
The text was updated successfully, but these errors were encountered:
Describe the bug
I have an issue when using Polymorphic Embeddables in combination with nested embedded properties. When two Polymorphs have a property with the same name their type is conflicting and ending mixed up. I think I traced the issue to this spot in
mikro-orm/packages/core/src/metadata/MetadataDiscovery.ts
Line 661 in 473795c
The
properties
Object receives the properties from bothpolymorhps
. If multiplepolymorphs
have the same property name, the latter overwrites the former.Example
Consider the shortened example from the Docs
In this case the
food
property of classCat
/Dog
is ambiguos and depending on whichpolymorph
is processed first,food
might receive typeDogfood
for PolymorphCat
or receive typeCatfood
for PolymorphDog
Expected behavior
Depeding on the used polymorph, the property should receive the associated type
Versions
The text was updated successfully, but these errors were encountered: