Describe the bug
Even with docs_url set to None, the docs are still served.
Per the FastAPI documentation, the app should no longer serve docs with this option set.
You can disable it by setting docs_url=None.
https://fastapi.tiangolo.com/tutorial/metadata/#docs-urls
def docs_url_kwargs() -> dict:
return {
"openapi_url": None,
"docs_url": None,
"redoc_url": None,
}
application = FastAPI(
title='Example FastApi',
description='Nice',
**docs_url_kwargs(),
)
application = VersionedFastAPI(
application,
version_format="{major}",
prefix_format="/v{major}/api/",
description='version',
enable_latest=True,
**docs_url_kwargs(),
)
To Reproduce
Set docs_url=None when instantiating the FastAPI app and VersionedFastAPI but still see the docs served at /docs.
Expected behavior
Expecting docs to no longer be served (for production use case).
Additional details
Issue may be here:
|
@parent_app.get( |
|
f"{prefix}/openapi.json", name=semver, tags=["Versions"] |
|
) |
|
@parent_app.get(f"{prefix}/docs", name=semver, tags=["Documentations"]) |
|
def noop() -> None: |
|
... |
Describe the bug
Even with
docs_urlset toNone, the docs are still served.Per the FastAPI documentation, the app should no longer serve docs with this option set.
To Reproduce
Set
docs_url=Nonewhen instantiating the FastAPI app andVersionedFastAPIbut still see the docs served at/docs.Expected behavior
Expecting docs to no longer be served (for production use case).
Additional details
Issue may be here:
fastapi-versioning/fastapi_versioning/versioning.py
Lines 68 to 73 in 18d480f