Problem/Motivation

Several entity types can have bundles with the same name. It is possible to have routes that collide with the same name if they have the same bundle id.

Proposed resolution

Make the routes to contain both the entity type id and the bundle id.

Remaining tasks

In the future we can:

  1. Provide a configuration object that gets injected into the ResourceManager that allows overriding the paths.
  2. Provide a schema for the resource with the joint effort of GraphQL and override the path there to have a user defined path.

Comments

e0ipso created an issue. See original summary.

dawehner’s picture

I'm wondering whether /{entity_type_id}/{bundle} or /{entity_type_id}-{bundle} would be more semantically correct. The later one makes it clear that its still its own resource. The first one seems like there should be a dedicated node resource, which has its own, limited but still existing, usecases.

e0ipso’s picture

Very good point. If we move towards a /{entity_type_id} resource I think it should only contain the lowest common denominator for that entity type. What would that look like?

I'm worried that /node/1 (article) and /node/2 (page) end up having different fields in the result (different schema). I advocate for having *only* resources that can be explained by a (json/yaml) schema.

dawehner’s picture

Very good point. If we move towards a /{entity_type_id} resource I think it should only contain the lowest common denominator for that entity type. What would that look like?

Well for moving data from Site a to site b usecases rendering the entire data out could be still really useful. I'm not sure whether we want to support that. Otherwise I would at least expose the entity fields + all base fields of an entity type.

e0ipso’s picture

Status: Active » Closed (duplicate)