flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.39k stars 834 forks source link

feat: allow adding endpoints before/after others #4115

Closed SychO9 closed 5 days ago

SychO9 commented 1 week ago

Similar to https://github.com/flarum/framework/pull/4106

Adds:

It is currently impossible to add certain endpoints without breaking existing ones. For example, if you have the following endpoints:

You would not be able to add custom endpoints with the following paths:

because the pattern which catches the ID for the existing endpoint would also catch all. But if the custom endpoint was added before the existing, the problem would be solved.

Of course another way to solve this would be to enforce that the id parameter is an integer:

but while that might be applicable for this example, other routes such as the GET one allow using slugs.