src/Response.php
public function jsonSerialize() {
        $asset = (string)$this->contentAsset();

        if ($asset) {
            // A specific asset was specified.
            if (strpos($asset, '.') !== false) {
                list($group, $key) = explode('.', $asset, 2);
                switch ($group) {
                    case 'meta':
                        return val($key, $this->meta);
                    case 'data':
                        return val($key, $this->data);
                    default:
                        return null;
                }
            } else {
                switch ($asset) {
                    case 'data':
                        return $this->data;
                    case 'meta':
                        return $this->meta;
                    default:
                        return null;
                }
            }
        }
        return $this->data;
    }
public function jsonSerialize() {
        $asset = (string)$this->contentAsset();

        if ($asset) {
            // A specific asset was specified.
            if (strpos($asset, '.') !== false) {
                list($group, $key) = explode('.', $asset, 2);
                switch ($group) {
                    case 'meta':
                        return val($key, $this->meta);
                    case 'data':
                        return val($key, $this->data);
                    default:
                        return null;
                }
            } else {
                switch ($asset) {
                    case 'data':
                        return $this->data;
                    case 'meta':
                        return $this->meta;
                    default:
                        return null;
                }
            }
        }
        return $this->data;
    }
Specify data which should be serialized to JSON.

@link http://php.net/manual/en/jsonserializable.jsonserialize.php
@return mixed data which can be serialized by <b>json_encode</b>,
which is a value of any type other than a resource.