Skip to main content

expandDescription

expandDescription(): (target, propertyName) => void

Sets Relation.expandForDescription for a resource.

For example, we'll use a Student resource from Getting Started Tutorial with a related Teacher resource.

Each Student row contains only the teacher reference (for example, the teacher's id). When expandDescription is applied to the Teacher field, the Student output will include additional textual properties from the related Teacher object (for example, teacher's name, title or other descriptive fields).

Before applying the decorator:

Student Name
Alice
Bob
Charlie
Dana

After applying expandDescription to the Teacher field in Student resource:

Student NameTeacher
AliceJohn
BobMary
CharlieEmma
DanaFrank

Sets {@link PropertyMeta.expandDescription}.

Returns

(target, propertyName): void

Parameters

target

object

propertyName

string

Returns

void