silverstripe-restfulapi icon indicating copy to clipboard operation
silverstripe-restfulapi copied to clipboard

Empty has_many or many_many relations don't show up in serialized output.

Open bummzack opened this issue 9 years ago • 1 comments

A populated relation might look like this when serialized:

"myRelation": [1, 5, 6]

If that relation contains no children, the "myRelation" key is entirely missing from the serialized data, but it should be:

"myRelation": []

Might be easily fixed by removing the check on RESTfulAPI_BasicSerializer.php:L209?

bummzack avatar Jul 08 '15 11:07 bummzack

A PR for this is up. #54

bummzack avatar Jul 17 '15 08:07 bummzack