You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Hey, I'm trying to generate the full openapi.json file for a specific API version without running the server, programmatically, as I need to generate the html documentation from it. Is there a way to do that? using the app.openapi() would hide the endpoints behind the versions.
But I need the openapi schema for a specific API version.
Describe the solution you'd like
A method that would allow the generation of a specific versioned openapi schema, something like app.openapi('v1') or anything would work really.
Additional context
from fastapi.openapi.utils import get_openapi
from app import app
import json
with open("openapi.json", "w") as file:
json.dump(app.openapi(), file)
with open("openapi-get.json", "w") as file:
openapi_schema = get_openapi(
title="Custom title",
version="2.5.0",
description="This is a very custom OpenAPI schema",
routes=app.routes,
)
The generated openapi schema includes the v0 and v1 endpoints, however need a method to generate the schema with the endpoints for a specific version.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Hey, I'm trying to generate the full openapi.json file for a specific API version without running the server, programmatically, as I need to generate the html documentation from it. Is there a way to do that? using the app.openapi() would hide the endpoints behind the versions.
But I need the openapi schema for a specific API version.
Describe the solution you'd like
A method that would allow the generation of a specific versioned openapi schema, something like app.openapi('v1') or anything would work really.
Additional context
The generated openapi schema includes the v0 and v1 endpoints, however need a method to generate the schema with the endpoints for a specific version.
The text was updated successfully, but these errors were encountered: