Skip to content

Commit

Permalink
fix(core): do not override child class properties (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Oct 27, 2020
1 parent 3371415 commit 6d91f1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/metadata/MetadataDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,11 @@ export class MetadataDiscovery {
}

let order = this.defineBaseEntityProperties(base);
const old = Object.values(meta.properties);
const old = Object.values(meta.properties).map(x => x.name);
meta.properties = { ...base.properties, ...meta.properties };

if (!meta.discriminatorValue) {
Object.values(base.properties).filter(prop => !old.includes(prop)).forEach(prop => {
Object.values(base.properties).filter(prop => !old.includes(prop.name)).forEach(prop => {
meta.properties[prop.name] = { ...prop };
meta.propertyOrder.set(prop.name, (order += 0.01));
});
Expand Down

0 comments on commit 6d91f1f

Please sign in to comment.