From 71c088c52ea4456bf656fdd7a133e64a542a9fea Mon Sep 17 00:00:00 2001 From: Eugene Toder Date: Wed, 12 Jun 2024 21:42:01 -0400 Subject: [PATCH] Show how to override /redoc in fastapi In the current version of the fastapi example our custom /redoc page is not used. The built-in page takes precedence. --- README.md | 3 ++- examples/fastapi/main.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c955ae7..c21fc79 100644 --- a/README.md +++ b/README.md @@ -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("/") diff --git a/examples/fastapi/main.py b/examples/fastapi/main.py index e93d34d..a4aacc2 100644 --- a/examples/fastapi/main.py +++ b/examples/fastapi/main.py @@ -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("/")