Skip to content

Commit

Permalink
fix bug with isExcluded filter on inherited classes (epiphone#78)
Browse files Browse the repository at this point in the history
Co-authored-by: Grigory Kholstinnikov <[email protected]>
  • Loading branch information
scarych and holstinnikov authored May 29, 2022
1 parent b3bb4c6 commit a930cb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ export function validationMetadataArrayToSchemas(
const target = ownMetas[0].target as Function
const metas = ownMetas
.concat(getInheritedMetadatas(target, metadatas))
.filter((propMeta) => !isExcluded(propMeta, options))
.filter(
(propMeta) =>
!(
isExcluded(propMeta, options) ||
isExcluded({ ...propMeta, target }, options)
)
)

const properties: { [name: string]: SchemaObject } = {}

Expand Down

0 comments on commit a930cb9

Please sign in to comment.