Skip to content

What is the best way to nest properties ? #1736

Open
@victorantunesb

Description

@victorantunesb
class DestinataryVOModel {

   @Expose({ name: 'name' })
   destinataryName: string
    
   @Expose({ name: 'email' })
   destinataryEmail: string

}

class Destinatary {

  @Expose({ name: 'id' })
  destinataryId: number 

  @Type(() => DestinataryVOModel)
  destinatary: DestinataryVOModel

  }
input = {
    id: 1,
    name: 'any_name',
    email: '[email protected]'
}
expectedOutput = {
    destinataryId: 1,
    destinatary: {
         destinataryName: 'any_name'
         destinataryEmail:  '[email protected]'
    }
}

but this doesn't work

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionQuestions about the usage of the library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions