Skip to content
Discussion options

You must be logged in to vote

Thanks Guys I got the solution.
this is how I can do this.

from fastapi import FastAPI
import json

app = FastAPI()

def custom_openapi():
with open("openapi.json", "r") as openapi:
return json.load(openapi)

app.openapi = custom_openapi

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov

This comment has been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
2 participants
Converted from issue

This discussion was converted from issue #3599 on February 27, 2023 22:25.