swifter icon indicating copy to clipboard operation
swifter copied to clipboard

Duplicate routes problem

Open drekka opened this issue 4 years ago • 1 comments

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.

drekka avatar Jul 08 '21 08:07 drekka

I'm experiencing this also. BUt it looks like Swifter has been abandoned for a while now 😢

oliverfoggin avatar Jan 27 '23 14:01 oliverfoggin