Swagger/OpenAPI Docs Fail to Load with google-adk >= 1.19.0 (Internal Server Error on /openapi.json)
Description of the Bug
When using google-adk version 1.19.0 or higher, accessing the Swagger documentation page (typically at /docs on the adk web server) fails to display the API definition.
Instead of the normal documentation, the following error is shown:
Failed to load API definition.
Errors Hide Fetch error Internal Server Error /openapi.json
This issue strongly suggests a failure in the OpenAPI schema generation process, which is often related to compatibility between FastAPI and Pydantic versions. Downgrading FastAPI to version 0.115.0 resolves the issue, confirming a version conflict is the probable cause.
To Reproduce
- Install
google-adk(version $\ge$ 1.19.0). - Run the
adk webcommand to start the local server.adk web - Open the Swagger documentation page in a browser at:
http://127.0.0.1:8000/docs
- Observe the error displayed on the page as described above.
Expected Behavior
The Swagger documentation page (/docs) should load normally and display the generated OpenAPI schema after running adk web, providing the interactive documentation for the API.
Environment (Suggested Addition)
google-adkVersion: $\ge$ 1.19.0- Operating System: [e.g., Ubuntu 22.04, macOS Ventura]
- Python Version: [e.g., 3.10.12]
- Temporary Fix (Working Configuration): Downgrading FastAPI to 0.115.0 resolves the issue.
Temporary Solution
Downgrade the ADK version to 1.16.0 .
Same issue, hope it gets fixed
Update FastAPI to:
fastapi[standard]==0.118.3