You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Starlette app that mounts three subapps, each under its own prefix, so that I can get three separate OpenAPI specs while still sharing some resources between the three sub-apps.
While all routes were correctly (i.e. including their subapp prefixes) shown in the Apitally dashboard on the first run, when I make an actual request, it is not counted towards one of these routes, but instead a new route without the subapp prefix is created.
When opening /subapp1/route/123, I would expect to get /subapp1/route/{uid} as path, but instead I'm getting /route/{uid}. (Which of course makes sense, since request.app will be the subapp, which has no clue it's being mounted under some prefix.)
I've worked around this locally by changing
returnroute.path
to
returnrequest.scope['root_path'] +route.path
But I'm unsure if that's adequate for all use cases.
Hi Simon, thanks so much for this great app!
I have a Starlette app that mounts three subapps, each under its own prefix, so that I can get three separate OpenAPI specs while still sharing some resources between the three sub-apps.
While all routes were correctly (i.e. including their subapp prefixes) shown in the Apitally dashboard on the first run, when I make an actual request, it is not counted towards one of these routes, but instead a new route without the subapp prefix is created.
Here's some minimal code to reproduce:
When opening
/subapp1/route/123
, I would expect to get/subapp1/route/{uid}
as path, but instead I'm getting/route/{uid}
. (Which of course makes sense, sincerequest.app
will be the subapp, which has no clue it's being mounted under some prefix.)I've worked around this locally by changing
to
But I'm unsure if that's adequate for all use cases.
PS: While trying around I also noticed that even without subapps, path detection breaks down when using
Mount
like in this example from the Starlette docsThe text was updated successfully, but these errors were encountered: