Skip to content

feature: @Expose() attribute when it`s an object #638

Open
@PizzaJu

Description

@PizzaJu

Description

when A object nest B object, it is a correct way to Expose attribute in B that you should set @Expose() in B even if set in A.

class B {
  // @Expose()
  name: string
}
class A {
  @Expose()
  b: B
}

when Expose not set in B, an instance of A will return {b: {}}. This situation make people feel at a loss : )

Proposed solution

I think that Expose in A can add an option tell people that all nested attribute will all expose.

class B {
  // @Expose()
  name: string
}
class A {
  @Expose({allExpose: true})
  b: B
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions