You are here

public function JsonapiParse::parse in JSON:API Include 8

Parse json api.

Parameters

string|object $response: The response data from jsonapi.

Return value

mixed Parse jsonapi data.

Overrides JsonapiParseInterface::parse

File

src/JsonapiParse.php, line 31

Class

JsonapiParse
Class JsonapiParse.

Namespace

Drupal\jsonapi_include

Code

public function parse($response) {
  $content = $this
    ->parseJsonContent($response);
  return is_string($content) ? $content : Json::encode($content);
}