Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

API Route nesting not working #974

Closed
rdbartram opened this issue Jul 16, 2019 · 2 comments
Closed

API Route nesting not working #974

rdbartram opened this issue Jul 16, 2019 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rdbartram
Copy link

rdbartram commented Jul 16, 2019

I've tested this a couple of time and have been unable to work out what the root cause of the problem is.

If i create 2 api endpoints one /user/:id and one /user/:id/memberof, both of method get, the memberof block fires for both urls. If i remove the memberof endpoint, the /user/:id works again

I can't find example that I've used it before although i'm almost sure I have. This is suppose to work, am i stupid or is this a bug?

@rdbartram
Copy link
Author

rdbartram commented Jul 16, 2019

It just dawned on my it may have happened since you implemented the regex support and you are building a negative lookforward or excluding the / from the :variable syntax. I got it to work like so

user\/(?<id>[^\/]*)$
user\/(?<id>[^\/]*)\/memberof$

@leeberg leeberg assigned leeberg and adamdriscoll and unassigned leeberg Jul 23, 2019
@adamdriscoll adamdriscoll added the bug Something isn't working label Jul 30, 2019
adamdriscoll added a commit that referenced this issue Jul 30, 2019
@adamdriscoll
Copy link
Member

@rdbartram I just added a test for this. It looks like it's working for me. Are you using -EvaluateAsRegex on those routes? It works without it but not with it.

I added a PR with a test to validate this scenario: #987

If there is something I'm missing, please let me know.

@adamdriscoll adamdriscoll added this to the 2.5.3 milestone Jul 30, 2019
adamdriscoll added a commit that referenced this issue Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants