Duplicate routes problem
Hi, I have a problem where the APIs I'm dealing with contain multiple paths which overlaps. For example, I have
| Method | path | Swifter path expression |
|---|---|---|
| POST | /registration/token |
/registration/token |
| POST | /registration/abcd1234 |
/registration/:token |
So as you can see, Swifter is not able to tell the difference between a path element of 'token' and a path element that's a token.
Currently (and this matches my humble understanding of the source) Swifter looks for path variables before looking for hard coded path elements. So it's always matching on the /registration/:token path.
What I'd like to see as an option would be some way to address the order in which routes are processed so that I can dictate which of these two is tested first.
Currently I'm looking at a work around where I'm going to tell the /registration/:token route to look at the token and if it matches the word "token" then respond as if for the other path. That's about the only way around this I can think of.
I'm experiencing this also. BUt it looks like Swifter has been abandoned for a while now 😢