-
Notifications
You must be signed in to change notification settings - Fork 134
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 integration fails if docs are disabled #398
Comments
tsasao
added a commit
to tsasao/pyrollbar
that referenced
this issue
Apr 25, 2023
WITHOUT TEST CODES. rollbar#398
This is also happening to me. |
danielmorell
added a commit
that referenced
this issue
Jul 12, 2024
12 tasks
danielmorell
added a commit
that referenced
this issue
Jul 12, 2024
danielmorell
added a commit
that referenced
this issue
Jul 12, 2024
danielmorell
added a commit
that referenced
this issue
Aug 16, 2024
12 tasks
danielmorell
added a commit
that referenced
this issue
Sep 20, 2024
…-docs-disabled Fixed #398 FastAPI integration fails if docs are disabled.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a FastAPI application where the docs are disabled:
Which gives me the error
ERROR:rollbar.contrib.fastapi.routing:RollbarLoggingRoute must to be added to a bare router (before adding routes). See docs for more details.
I dug a bit, and the issue seems to be in this section
pyrollbar/rollbar/contrib/fastapi/utils.py
Lines 69 to 82 in 77cbffa
/openapi.json
,/docs
,/docs/oauth2-redirect
, and/redoc
), but my app only has one of those (/openapi.json
).Depending on the FastAPI setup, there might be anywhere between 0 and 4 available routes for a "bare" app. I might create a PR for this later, but my suggestion would be checking that there are no available routes other than the ones in the fields
openapi_url
,docs_url
,redoc_url
, andswagger_ui_oauth2_redirect_url
on theFastAPI
object https://github.com/tiangolo/fastapi/blob/3efb4f7edff99fdc12802a85ae9d140ec4772497/fastapi/applications.py#L107-L121The text was updated successfully, but these errors were encountered: