Path module is missing a REST plugin

Created on 13 December 2016, almost 9 years ago
Updated 3 September 2025, 14 days ago

Problem/Motivation

If you have an entity with an alias as /my-page there is no way to reliably determine the entity type that this item is associated with. Yes, you can get the data by adding a format to the alias like /my-page?_format=json, but what is the response? is it a node? a taxonomy term?

Likewise, there is no endpoint to translate the alias into a system path.

Proposed resolution

Create an endpoint like /dblog/{id} that allows the retrieval of a path object by id, or by path or alias (query parameter?) with the optional langcode.

I imagine the plugin will be /path/{pid} and {pid} is an optional parameter, but the user must provide either a pid, a path, or an alias, but not more than one.

Alternatively, we could create three endpoints, but it might be odd having an encoded path within a path, I feel that this would be better as a query.

Right now, this will be impossible to cache, because paths do not have cache tags until πŸ› Using the URL alias UI to change aliases doesn't do necessary invalidations: path aliases don't have cache tags Active .

Remaining tasks

  1. Write patch by adding the REST Plugin to the path module

User interface changes

None.

API changes

Adds REST endpoint for Paths.

Data model changes

None.

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

path.module

Created by

πŸ‡ΊπŸ‡ΈUnited States davidwbarratt

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024