Open
Description
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
}