#Serialization not working for nested Object

2 messages · Page 1 of 1 (latest)

pseudo cave
#

I've got a one to one relationship between User and Profile . In the UsersResponseDto I've done this

export class UserResponseDto {
  @Expose()
  firstName: string;

  @Expose()
  lastName: string;

  @Expose()
  username: string;

  @Expose()
  email: string;

  @Expose()
  profile: Profile;
}

Everything is working just fine with the other fields, but the nested profile field doesn't show up.

When i use the breakpoints, the shape that is returned from the service is good and the profile object is included, but in the controller, it's magically disappears.
Here is how it's used in the controller.

@Serialize(UserResponseDto)

Where @Serialize is my interceptor.And it works fine and has helped exclude things like password, etc.

Why isn't it working with a nested object?

old lintel
#

how that Profile looks like?