rest-framework icon indicating copy to clipboard operation
rest-framework copied to clipboard

[16.0][FIX] Allow endpoint with slash in root path

Open flachica opened this issue 1 year ago • 6 comments

If I define a endpoint with slash in Root path this is not found and throw an 404 error

flachica avatar Jun 13 '23 15:06 flachica

Hi @lmignon, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Jun 13 '23 15:06 OCA-git-bot

@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 avatar Jun 14 '23 08:06 flachica

@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 avatar Jun 14 '23 08:06 lmignon

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.

github-actions[bot] avatar Dec 03 '23 12:12 github-actions[bot]

@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.

simahawk avatar Jan 05 '24 10:01 simahawk

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.

github-actions[bot] avatar May 12 '24 12:05 github-actions[bot]