feat: support dot notation for nested objects in @Expose decorator
Currently @Expose decorator supports only flat re-naming, there were multiple requests to add support nested exposing.
Example:
class Example {
@Expose('user.fullName')
name: string = 'Test Name';
}
const raw = { user: { fullName: 'Test Name' }}
const instance = new Example();
plainToClass(Example, raw) // returns Example { name: 'Test Name' }
classToPlain(instance) // returns { user: { fullName: 'Test Name' }}
Any updates?
This feature not implemented yet?
I would need this feature in something I'm doing, and I think I will discard the class-transformer for what I'm doing right now, Maybe is better to have the option of an array, more than . notation, something like expose(["user","fullName"])
dotNotation should work for my case, but I think it's allways more safe to use an array.
This would be really useful for working with json:api objects.