class-transformer icon indicating copy to clipboard operation
class-transformer copied to clipboard

feature: Support 'and' operator between groups

Open RadekKpc opened this issue 1 year ago • 1 comments

Description

When we use groups option decorators are applied when at least one group is passed to the planToInstance. Could you please make it possible to change that logic and apply decorators when all members of the group are presented? (Or provide some generic solution for that condition)

Proposed solution

When we use:

plainToInstance(Class, plainObject, { groups: ['a'] });

Now:

@Expose({groups: ['a','b','c']})

will be applied when 'a' or 'b' or 'c' is given

Expected:

@Expose({groups: ['a','b','c'], strictGroupsBehaviour: true })

will applied when 'a' and 'b' and 'c' is given

RadekKpc avatar Jul 03 '23 11:07 RadekKpc

Probably duplicated https://github.com/typestack/class-transformer/issues/203

RadekKpc avatar Jul 03 '23 11:07 RadekKpc