The new JSON API spec (http://jsonapi.org/format/) specifies that "Clients MUST send all JSON API data in request document with the header Content-Type: application/vnd.api+json..." and "Servers MUST send all JSON API data in response documents with the header Content-Type: application/vnd.api+json"...
However, currently in Illuminate/Http/Request.php, the isJson() method looks for "/json", and several other methods look for "application/json" in these headers. Thus, content served via the JSON API spec won't be interpretted as JSON currently via Laravel/Lumen.
You could overwrite the isJson() in your app/Http/Requests/Request.php like this:
public function isJson()
{
return \Illuminate\Support\Str::contains($this->header('CONTENT_TYPE'), ['/json', '+json']);
}
Accept: application/vnd.api+json should return false for accepts json, because it doesn't...
You can't return any kind of json response, it specifically must be application/vnd.api+json
Most helpful comment
Accept: application/vnd.api+jsonshould return false for accepts json, because it doesn't...You can't return any kind of json response, it specifically must be
application/vnd.api+json