feature: expose defaultMetadataStorage #815
Labels
flag: needs discussion
Issues which needs discussion before implementation.
type: feature
Issues related to new features.
Description
As for now there is no option to combine multiple classes with
class-transformer
decorators using mixins pattern because metadata is stored internally inside package.There is no way to apply metadata from one class to another. Similar approach is possible for
class-validator
since it exposes metadata (code example). I tested code snippet forclass-validator
and copingclass-transformer
metadata using exposeddefaultMetadataStorage
singleton (using modified version of this package). Both things work.As is now
year
andmonth
won't be parsed. After adding additional logic toapplyMixins
withfindTransformMetadatas
andaddTransformMetadata
fromMetadataStorage
it will be parsed.Proposed solution
Expose
defaultMetadataStorage
singleton. It would allow for manual coping of metadata to derived class.add export in
index.ts
:I am happy to open PR with this change.
The text was updated successfully, but these errors were encountered: