Skip to content

Commit

Permalink
Show how to override /redoc in fastapi
Browse files Browse the repository at this point in the history
In the current version of the fastapi example our custom /redoc page is
not used. The built-in page takes precedence.
  • Loading branch information
eltoder committed Jun 14, 2024
1 parent 0bd7fa3 commit 71c088c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from openapipages import Elements, RapiDoc, ReDoc, Scalar, SwaggerUI

app = FastAPI()
# Disable the built-in /redoc page so we can make a custom one.
app = FastAPI(redoc_url=None)


@app.get("/")
Expand Down
3 changes: 2 additions & 1 deletion examples/fastapi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from openapipages import Elements, RapiDoc, ReDoc, Scalar, SwaggerUI
from typing_extensions import Dict

app = FastAPI()
# Disable the built-in /redoc page so we can make a custom one.
app = FastAPI(redoc_url=None)


@app.get("/")
Expand Down

0 comments on commit 71c088c

Please sign in to comment.