Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastapi: root_path cannot contain a / #446

Open
sbidoul opened this issue Aug 21, 2024 · 1 comment
Open

fastapi: root_path cannot contain a / #446

sbidoul opened this issue Aug 21, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sbidoul
Copy link
Member

sbidoul commented Aug 21, 2024

I'd like to be able to use a root path such as /myapi/v1

This does not work because the fastapi dispatcher takes the first component of the url as the root path to search the endpoint

root_path = "/" + environ["PATH_INFO"].split("/")[1]

@sbidoul sbidoul added the enhancement New feature or request label Aug 21, 2024
@oerp-odoo
Copy link

Yeah I was confused why my endpoint was not working as this is not documented in odoo fastapi (or maybe I did not see it?).

/api/demo gives internal server error, and /api_demo works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants