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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

e0ipso created an issue. See original summary.

e0ipso’s picture

e0ipso’s picture

Title: Make the resource type aware of the resource path » [PP-1] Make the resource type aware of the resource path
Status: Active » Postponed (maintainer needs more info)
e0ipso’s picture

Title: [PP-1] Make the resource type aware of the resource path » Make the resource type aware of the resource path
Status: Postponed (maintainer needs more info) » Needs review
FileSize
2.34 KB

Un-postponing. Added a patch proposal.

e0ipso’s picture

Status: Needs review » Fixed

I'm going to merge this. Please leave any comments you want, I'll address them as follow ups.

  • e0ipso committed 4b5b103 on 8.x-1.x
    Issue #2949635 by e0ipso: Make the resource type aware of the resource...
gabesullice’s picture

+++ b/src/ResourceType/ResourceType.php
@@ -243,4 +243,14 @@ class ResourceType {
+    return sprintf('%s/%s', $this->getEntityTypeId(), $this->getBundle());

First, I really like this change! One nit, I would prefer to see this with a leading /.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.