Wrong route ordering
pavelbabin opened this issue · comments
There is wrong ordering of routes.
For example - there is ordering in the resource I've set:
GET users/
GET users/:id
POST users/
POST users/:id/restore
PUT users/:id
DELETE users/:id
But grape-swagger is generating it like this:
GET users/
POST users/
DELETE users/:id
GET users/:id
PUT users/:id
POST users/:id/restore
The fix from #859 doesn't fix it completely. The order is still not the same as it was "declared"
mmh "wrong" isn't the right word here, cause it is only a different ordering … /
and this is always a running discussion, see for example here → #859
so if you mean to change it, please provide a PR for that and an explanation, why and what changed, thanks
@pavelbabin I'm not sure that Grape itself makes any guarantees with respect to route order - at least not in the documentation or test suite that I can see. FWIW, I agree that it would be useful to be able to rely on the declared order of routes.
Grape does mount, evaluate and match routes in the order they are declared in code. It would be nice if someone contributed some statements towards that to the docs ;)