src/Http/Middleware/ParsesServerRequests.php
protected function decodeDocument(ServerRequestInterface $serverRequest)
    {
        if (!http_contains_body($serverRequest)) {
            return null;
        }

        return new Document(json_decode((string) $serverRequest->getBody()));
    }
protected function decodeDocument(ServerRequestInterface $serverRequest)
    {
        if (!http_contains_body($serverRequest)) {
            return null;
        }

        return new Document(json_decode((string) $serverRequest->getBody()));
    }
protected function decodeDocument ( ServerRequestInterface $ serverRequest ) { if ( ! http_contains_body ( $ serverRequest ) ) { return null ; } return new Document ( json_decode ( ( string ) $ serverRequest -> getBody ( ) ) ) ; }
Extract the JSON API document from the request.

@param ServerRequestInterface $serverRequest
@return Document|null
@throws InvalidJsonException
Extract the JSON API document from the request .