Skip to content

Rule /core/no-trailing-slash uitbreiden (// ook uitsluiten) #349

Open

Description

@BvanRaaij

ADR /core/no-trailing-slash geeft aan dat een URI niet op een / mag eindigen:

MUST NOT contain a trailing slash. When requesting a resource including a trailing slash, this MUST result in a 404 (not found) error response and not a redirect. This forces API consumers to use the correct [URI]

Ik wil voorstellen deze uit te breiden tot:

URL Paths MUST be normalized without empty path segments and trailing slashes:

You MUST NOT specify paths with duplicate or trailing slashes, e.g. .../v1/articles//comments or .../v1/articles/. As a consequence, you MUST NOT specify or use path variables with empty string values.

When requesting a resource including a trailing slash, this MUST result in a 404 Not Found error response and not in a redirect. This forces API consumers to use the correct URI.

This rule does not apply to the root resource (append / to the service root URL).

Dus: ook geen duplicate slashes toegestaan

Activity

  1. changed the title [-]Extend rule[/-] [+]Extend rule `/core/no-trailing-slash`[/+] on Jul 16, 2026
  2. changed the title [-]Extend rule `/core/no-trailing-slash`[/-] [+]Rule `/core/no-trailing-slash` uitbreiden (`//` ook uitsluiten)[/+] on Jul 16, 2026
  3. sanderke commented on Jul 23, 2026

    @sanderke
    Member

    Bedankt voor de suggestie.

    Voorstel om de regel algemener te maken:

    - A URI MUST NOT contain a trailing slash.
    + A URI MUST NOT contain empty path segments.
    
    - When requesting a resource including a trailing slash, this MUST result in a 404 (not found) error response and not a redirect.
    + When requesting a resource including a trailing slash or consecutive slashes, this MUST result in a 404 (not found) error response and not a redirect.
    
      This forces API consumers to use the correct URI.
  4. TimvdLippe commented on Aug 11, 2026

    @TimvdLippe
    Contributor

    Lijkt mij een goede suggestie. Kun je dat in een PR gieten zodat we de preview kunnen genereren met de diff? Dan zet ik een screenshot daarvan in de slides voor het TO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions