rest-framework
rest-framework copied to clipboard
[16.0][FIX] Allow endpoint with slash in root path
If I define a endpoint with slash in Root path
this is not found and throw an 404 error
Hi @lmignon, some modules you are maintaining are being modified, check this out!
@lmignon First of all, thank you very much for your time. Regarding the PR issue, I don't know if I'm understanding you. With my proposal I try that the "Root path" can contain the example values: "/app", "/app/v1" and "/app/v2".
Currently it would only be possible to define "/app". With the proposed change the rest of the values would be allowed.
@flachica OK I understand now your point. The problem is wider. How can we deal with subpath into the root path at the same time of subpath in route? A route could also be declared as 'sales/items/'. I've to thing a little bit further to implement the right logic and support subpath for apps and routes.
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
@flachica OK I understand now your point. The problem is wider. How can we deal with subpath into the root path at the same time of subpath in route? A route could also be declared as 'sales/items/'. I've to thing a little bit further to implement the right logic and support subpath for apps and routes.
@lmignon can you elaborate a bit on the issues you foresee?
In theory this should work out of the box. It's even documented here https://fastapi.tiangolo.com/reference/fastapi/ app = FastAPI(root_path="/api/v1")
.
I haven't tried yet tho.
Also, depending on the use case you can use prefix
in the routers to nest routes.
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.