Sub-Application routes are not shown in root routes
See original GitHub issueFirst Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn’t find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google “How to X in FastAPI” and didn’t find any information.
- I already read and followed all the tutorial in the docs and didn’t find an answer.
- I already checked if it is not related to FastAPI but to Pydantic.
- I already checked if it is not related to FastAPI but to Swagger UI.
- I already checked if it is not related to FastAPI but to ReDoc.
Commit to Help
- I commit to help with one of those options 👆
Example Code
# From the docs : https://fastapi.tiangolo.com/advanced/sub-applications/
from fastapi import FastAPI
app = FastAPI()
@app.get("/app")
def read_main():
return {"message": "Hello World from main app"}
subapi = FastAPI()
@subapi.get("/sub")
def read_sub():
return {"message": "Hello World from sub API"}
app.mount("/subapi", subapi)
Description
The sub Apis routes are not shown in the root docs.
I’m adding dynamically multiple sub Apis in my root app and it’s hard to keep track of which is mounted and on which names.
Is there a way to show at least the name of the sub API route in the root app?
Example Docs at the root :
/app # (exists) Description of /app route in root
/subapi # (Do not exists) Description of /subapi (at least to know another app is mounted)
Nother Exemple of Docs at the root :
/app # Description of /app route in root
# SubApi Tag to know there is another app
/docs # Know that there is docs inside subapp
/sub # Know that there is sub route inside sub app
Operating System
Linux
Operating System Details
Archlinux Kernel 5.13.10
FastAPI Version
0.66.0
Python Version
3.9.6
Additional Context
Thanks for this beautiful library !
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
IIS and C# making use of root route in a sub application
In my opinion, you could write a asp.net application e.g webform or MVC or else at the root of the example.com website in...
Read more >FAQ - qiankun - UmiJS
The js itself of the sub-application has syntax compatibility issues in the current runtime environment. How to load micro apps on a routing...
Read more >5 Advanced Features of FastAPI You Should Try
Therefore, all the routes from all the APIRouters will be listed in the main application documentation. These APIRouters can have separate prefixes to...
Read more >View alternate routes - Waze Help - Google Support
When searching for a route, Waze will often provide multiple options. To see alternate routes: Tap on the ETA bar at the bottom...
Read more >Combining Multiple Angular Applications into a Single One
app1: The source code for your first custom sub application; app1/app: The ... Note here I did not set up a catch all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would also like to have an overview of all the mounted routes on the root docs. Is this something FastAPI is willing to accept a PR for?
I’ve been using subapps to manage different API versions and these versions are listed by a “information” endpoint.
It will return something like this