Problem/Motivation
I'm utilising Routes::isJsonApiRequest($route_defaults) to check to see if a route is a jsonapi route, this does not return true for jsonapi resource routes I would like an equivalent to check to see if.
Steps to reproduce
Proposed resolution
In the patch I have attached a static method in Drupal\jsonapi_resources\Unstable\Routing::isJsonApiResourceRequest to provide route checking ability for a jsonapi_resource route.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3198310-4-add-check-for-resource-route.patch | 6.51 KB | richardgaunt |
| add-static-method-to-check-route-type.patch | 1.11 KB | richardgaunt |
Issue fork jsonapi_resources-3198310
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mglamanComment #3
mglamanComment #4
richardgaunt commentedUpdated patch to add unit test testing against different routes.
Comment #5
richardgaunt commentedComment #6
mglamanThank you for adding a test!
I'm guessing PhpStorm added this. We're not requiring >= 7.4 so we can't type properties.
Comment #7
mglamanComment #8
mglamanTyped properties are OK now :)
Comment #10
mglamanLooks good, ready to merge!
Comment #12
mglamanThanks!