[PR #16342] [CLOSED] fix: include items property in OpenAPI array parameters for OpenAI function calling #47153

Closed
opened 2026-04-29 22:14:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/16342
Author: @Rain6435
Created: 8/7/2025
Status: Closed

Base: mainHead: fix-openapi-array-parameters


📝 Commits (2)

  • bdfcf54 fix: prevent backtick removal on Shift+Enter in chat input
  • e2b5b9a fix: include items property in OpenAPI array parameters for OpenAI function calling

📊 Changes

2 files changed (+33 additions, -2 deletions)

View changed files

📝 backend/open_webui/utils/tools.py (+7 -1)
📝 src/lib/components/common/RichTextInput.svelte (+26 -1)

📄 Description

Summary

Fixes OpenAPI array parameter conversion for OpenAI function calling by ensuring the 'items' property is
included in generated function schemas.

Problem

  • OpenAPI specs with array query parameters were generating invalid OpenAI function schemas
  • Missing 'items' property caused OpenAI to return 400 Bad Request: 'array schema missing items'
  • Issue affected tool servers using array parameters like tags filtering

Solution

  • Modified convert_openapi_to_tool_payload() in backend/open_webui/utils/tools.py
  • Added logic to copy 'items' property for array-type parameters
  • Ensures generated schemas are valid for OpenAI function calling

Test Plan

  • Tested with exact example from issue #14115
  • Verified generated schema now includes required 'items' property
  • Syntax validation passed

Fixes #14115


🔄 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/16342 **Author:** [@Rain6435](https://github.com/Rain6435) **Created:** 8/7/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-openapi-array-parameters` --- ### 📝 Commits (2) - [`bdfcf54`](https://github.com/open-webui/open-webui/commit/bdfcf54857780bd6566ed8359a81c75920a56c5f) fix: prevent backtick removal on Shift+Enter in chat input - [`e2b5b9a`](https://github.com/open-webui/open-webui/commit/e2b5b9af3dd6c90e26d21a31d7b645ac28c0bfa6) fix: include items property in OpenAPI array parameters for OpenAI function calling ### 📊 Changes **2 files changed** (+33 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/tools.py` (+7 -1) 📝 `src/lib/components/common/RichTextInput.svelte` (+26 -1) </details> ### 📄 Description ## Summary Fixes OpenAPI array parameter conversion for OpenAI function calling by ensuring the 'items' property is included in generated function schemas. ## Problem - OpenAPI specs with array query parameters were generating invalid OpenAI function schemas - Missing 'items' property caused OpenAI to return 400 Bad Request: 'array schema missing items' - Issue affected tool servers using array parameters like tags filtering ## Solution - Modified `convert_openapi_to_tool_payload()` in `backend/open_webui/utils/tools.py` - Added logic to copy 'items' property for array-type parameters - Ensures generated schemas are valid for OpenAI function calling ## Test Plan - [x] Tested with exact example from issue #14115 - [x] Verified generated schema now includes required 'items' property - [x] Syntax validation passed Fixes #14115 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 22:14:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#47153