The OpenAPI spec now validates correctly with tools like Gravitee's admission webhook and the openapi-spec-validator library
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/20362
**Author:** [@majiayu000](https://github.com/majiayu000)
**Created:** 1/4/2026
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `fix/openapi-validation-errors`
---
### 📝 Commits (1)
- [`6c91351`](https://github.com/open-webui/open-webui/commit/6c9135157ae4a8cf25c00d38ef026e4950cbcdae) fix: resolve OpenAPI spec validation errors
### 📊 Changes
**2 files changed** (+34 additions, -5 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/files.py` (+4 -1)
📝 `backend/open_webui/routers/openai.py` (+30 -4)
</details>
### 📄 Description
# Pull Request Checklist
- [x] **Target branch:** Verify that the pull request targets the `dev` branch.
- [x] **Description:** Provided below.
- [x] **Testing:** Manually tested OpenAPI spec generation.
- [x] **Agentic AI Code:** This PR has gone through human review and manual testing.
- [x] **Code review:** Self-reviewed.
# Changelog Entry
### Description
- Split multi-method `api_route` into separate route handlers in `openai.py` to generate unique operationIds for each HTTP method (GET/POST/PUT/DELETE)
- Add missing `file_name` path parameter to `get_file_content_by_id` in `files.py`
### Fixed
- Fixed duplicate operationId error in OpenAPI spec for `/openai/{path}` endpoint (#20359)
- Fixed missing path parameter definition for `{file_name}` in `/api/v1/files/{id}/content/{file_name}` (#20359)
---
### Additional Information
- Fixes #20359
- The OpenAPI spec now validates correctly with tools like Gravitee's admission webhook and the openapi-spec-validator library
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20362
Author: @majiayu000
Created: 1/4/2026
Status: ❌ Closed
Base:
dev← Head:fix/openapi-validation-errors📝 Commits (1)
6c91351fix: resolve OpenAPI spec validation errors📊 Changes
2 files changed (+34 additions, -5 deletions)
View changed files
📝
backend/open_webui/routers/files.py(+4 -1)📝
backend/open_webui/routers/openai.py(+30 -4)📄 Description
Pull Request Checklist
devbranch.Changelog Entry
Description
api_routeinto separate route handlers inopenai.pyto generate unique operationIds for each HTTP method (GET/POST/PUT/DELETE)file_namepath parameter toget_file_content_by_idinfiles.pyFixed
/openai/{path}endpoint (#20359){file_name}in/api/v1/files/{id}/content/{file_name}(#20359)Additional Information
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.