You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example given for how Collections with metadata are serialized using ArraySerializer is incorrect:
// Collection with Meta[['foo'=>'bar']'meta'=>[
...
]];
In reality it will be:
// Collection with Meta['data'=>[['foo'=>'bar']],'meta'=>[
...
]];
Other parts of the ArraySerializer docs give it a bad wrap as well, for no good reason, as the collections do in fact get tucked inside a data attribute.
As far as I can tell, there’s only two differences between ArraySerializer and DataArraySerializer:
ArraySerializer serializes the resource at the top level rather than under a data key
ArraySerializer respects the resourceKey it was configured with; DataArraySerializer forces 'data'
The text was updated successfully, but these errors were encountered:
Note: The fractal docs samples are in PHP array notation form, not JSON. The were produced with $manager->createData($resource)->toArray(); not ->toJson().
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 4 weeks if no further activity occurs. Thank you for your contributions.
The example given for how Collections with metadata are serialized using ArraySerializer is incorrect:
In reality it will be:
Other parts of the ArraySerializer docs give it a bad wrap as well, for no good reason, as the collections do in fact get tucked inside a
data
attribute.As far as I can tell, there’s only two differences between ArraySerializer and DataArraySerializer:
data
keyresourceKey
it was configured with; DataArraySerializer forces'data'
The text was updated successfully, but these errors were encountered: