Throw an exception when building route paths unsupported by Drupal

Created on 23 July 2024, 5 months ago
Updated 24 July 2024, 5 months ago

Problem/Motivation

I recently tried to implement a route of the format /openapi/{plugin_id}.{content_type} to allow for a URL like /openapi/jsonapi.yaml. This is supported upstream in Symfony but not in Drupal โ†’ . (Similarly, you cannot have two parameters which are not separated by a slash, such as {a}{b}.

Steps to reproduce

This is a Drupalism and confusing. Tackling the underlying constraints is a huge lift, but we should at least throw an exception when compiling routes when Drupal doesn't like the path.

Proposed resolution

Throw an exception when compiling route paths that we know aren't supported by Drupal, with a pointer to helpful docs.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Routingย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024