-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
Description
I've started implementing the sparse fieldsets in my application. At first I was surprised how easy it was to add the functionality to my app. Without included relationships is the result as expected. Problem is that the relationships aren't added if I use sparse fieldsets. These could be accomplished by adding the type name to the fieldsets array.
According to the tests this should be working:
$aFieldSets = [
// Attributes and relationships that should be shown
'employees' => ['firstName', 'lastName'],
'subsidiaries' => ['name'],
]
$sJson = $this->getJsonEncoder()
->withLinks($aLinks)
->withMeta($metaData))
->withFieldSets($aFieldSets)
->withIncludedPaths(['subsidiaries'])
->encodeData($oRecords);Only if the Fieldset is changed to this, the related data is shown.
$aFieldSets = [
// Attributes and relationships that should be shown
'employees' => ['firstName', 'lastName','subsidiaries'],
'subsidiaries' => ['name'],
]Where could be the problem?