Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

Update environment variable handling for FastAPI docs

Xiaomeng Zhao7c4ff0559160
diff --git a/mineru/cli/fast_api.py b/mineru/cli/fast_api.py
index 5dc59716..ecf88681 100644
--- a/mineru/cli/fast_api.py
+++ b/mineru/cli/fast_api.py
@@ -40,7 +40,7 @@ async def limit_concurrency():
def create_app():
# By default, the OpenAPI documentation endpoints (openapi_url, docs_url, redoc_url) are disabled for security reasons.
# To enable the FastAPI docs and schema endpoints, set the environment variable ENABLE_FASTAPI_DOCS=1.
- enable_docs = os.getenv("ENABLE_FASTAPI_DOCS", "0") == "1"
+ enable_docs = str(os.getenv("ENABLE_FASTAPI_DOCS", "1")).lower() in ("1", "true", "yes")
app = FastAPI(
openapi_url="/openapi.json" if enable_docs else None,
docs_url="/docs" if enable_docs else None,
@@ -309,4 +309,4 @@ def main(ctx, host, port, reload, **kwargs):
if __name__ == "__main__":
- main()
\ No newline at end of file
+ main()