mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-11 10:34:13 -05:00
[GH-ISSUE #18758] issue: Multiple /models endpoints in openapi spec have similar operationId #34223
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mkresse on GitHub (Oct 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18758
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.34
Ollama Version (if applicable)
No response
Operating System
MacOS 15.7.1
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
We are using the openapi specification (provided by http://localhost:8080/openapi.json) to generate an typescript api client using openapi-generator. I would expect, the generated code to compile without errors, so it can be used as typesafe client code to access openwebui api.
Actual Behavior
However, the typescript compiler fails with this error:
After investigation of this error, it appears that since there are two different endpoints, which only differ in a trailing slash, the automatically generated "operationId" is also very similar. This results in the generation of two model classes with the same name (
GetModelsApiV1ModelsGetRequest), which leads to the typescript compiler error.The affected endpoints are:
/api/v1/modelsfrom backend/open_webui/main.py (--> operationId:get_models_api_v1_models_get) and/api/v1/models/from backend/open_webui/routers/models.py (--> operationId:get_models_api_v1_models__get)Steps to Reproduce
Executing the following commands reproduces the problem:
To fix the problem, it would suffice to manually change one of the operationIds (which can be simulated via
sed -i '' 's/"get_models_api_v1_models_get"/"get_models_api_v1_models_get_chat"/g' openapi.json).A final fix could be to manually specify the operation id in via fastapi decorator (see https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/#openapi-operationid), like:
Logs & Screenshots
2025-10-31 15:48:50.766 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 192.168.65.1:64294 - "GET /openapi.json HTTP/1.1" 200
Additional Information
No response
@tjbck commented on GitHub (Nov 2, 2025):
6681ff5cbd@mkresse commented on GitHub (Nov 3, 2025):
I didn't dare to ask - this fix is even better, as it solves the ambiguity in the API. Thanks.