The normalizers/other logic may rely on the attributes usually presented in a request during the normal query of JSON API resource. The $context['resource_type'] contains the type of resource for an entity that's currently in process, while $request->attributes->get('resource_type') contains the resource of a top-level entity. Also, providing the _is_jsonapi to the list of attributes will make the use of \Drupal\jsonapi\Routing\Routes::getResourceTypeNameFromParameters() possible.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2995115--interdiff--2-3.txt | 1.57 KB | e0ipso |
| #3 | 2995115--3.patch | 2.79 KB | e0ipso |
| #2 | 2995115-2.patch | 2.78 KB | br0ken |
Comments
Comment #2
br0kenComment #3
e0ipsoAWESOME!
Adding some minor changes before commit.
Comment #5
e0ipsoComment #6
e0ipso@BR0kEN now that you are on fire, maybe you can knock this off pretty easily? #2995142: Support includes the EntityToJsonapi service
In any case, thanks for being so great!