Skip to content

Order routes by specificity #8

@WilliamRagstad

Description

@WilliamRagstad

Currently, routes get the same order in execution as in the source code or are completely random.
This is not a desired behavior, as one may define a "catch-all" route that takes precedence over a direct one. See example below:

GET /path/(anything: String)/here -> ...
GET /path/to/here -> ...

In the above example, we see that the first route takes a generic URL parameter anything: String, which will capture the segment to if requesting /path/to/here.

Solution

Order the routes by path specificity using a novel algorithm to ensure optimal resource coverage. Display a warning when one or more route paths collide or become ambiguous.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions