Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We need to override the resource path successfully in JSON API Extras and other extending modules.
Proposed resolution
We need to stop hard-coding <entity_type-id>/<bundle>
. Instead, we want to have a getPath()
that contains this information.
Remaining tasks
Do it.
User interface changes
None.
API changes
Introduce getPath()
in the ResourceType
.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2949635--resource-path--4.patch | 2.34 KB | e0ipso |
|
Comments
Comment #2
e0ipsoThis is very similar to what we did in #2949632: Make ResourceTypeRepository aware of the path prefix.
Comment #3
e0ipsoPostponing on #2949632: Make ResourceTypeRepository aware of the path prefix to avoid merge conflicts. The patch below applies on top of https://www.drupal.org/project/jsonapi/issues/2949632#comment-12508146.
Comment #4
e0ipsoUn-postponing. Added a patch proposal.
Comment #5
e0ipsoI'm going to merge this. Please leave any comments you want, I'll address them as follow ups.
Comment #7
gabesulliceFirst, I really like this change! One nit, I would prefer to see this with a leading
/
.