-
First Check
Commit to Help
Example Codefrom 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)DescriptionWhat I want to be able to do is have the /docs endpoint on the main app include docs, with all the associated paths, of the subapplications. So in the example above, /docs would include docs for both /app, and /subapi/sub Operating SystemmacOS Operating System DetailsNo response FastAPI Version103.1 Pydantic Version2.4.1 Python Version3.11.5 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I don't think this is possible based on the docs that declare that those are two fully independent fastapi applications there https://fastapi.tiangolo.com/advanced/sub-applications/?h=mount That said, maybe you could try and "hack" this thing by messing around with the app instances and their attributes that form the docs with method |
Beta Was this translation helpful? Give feedback.
I don't think this is possible based on the docs that declare that those are two fully independent fastapi applications there https://fastapi.tiangolo.com/advanced/sub-applications/?h=mount
That said, maybe you could try and "hack" this thing by messing around with the app instances and their attributes that form the docs with method
openapi. I wouldn't recommend though even if possible.