Self-Define Tool Params Not Support Object Type #20746

Closed
opened 2026-02-21 20:08:46 -05:00 by yindo · 1 comment
Owner

Originally created by @kivenli on GitHub (Dec 2, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

hi Guys,
I hopes your doing well.

I build a self-define tools to calling API. I upload a swagger in schema area, but it recognite object request as string,
The detail information list below.

Could your please help to give me some work around or fixed this issue ?

Image Image

Best Regards,
Lee

✔️ Expected Behavior

Recognite object defination request as object,

Actual Behavior

Recognite object defination request as string,

Originally created by @kivenli on GitHub (Dec 2, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.9.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce hi Guys, I hopes your doing well. I build a self-define tools to calling API. I upload a swagger in schema area, but it recognite object request as string, The detail information list below. Could your please help to give me some work around or fixed this issue ? <img width="632" height="441" alt="Image" src="https://github.com/user-attachments/assets/e95461b7-3ae9-4205-88d4-f1373c7ed525" /> <img width="432" height="335" alt="Image" src="https://github.com/user-attachments/assets/ef23f336-4fba-416f-a8e4-16b3a8f64a50" /> Best Regards, Lee ### ✔️ Expected Behavior Recognite object defination request as object, ### ❌ Actual Behavior Recognite object defination request as string,
yindo added the 🐞 bug label 2026-02-21 20:08:46 -05:00
yindo closed this issue 2026-02-21 20:08:46 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 2, 2025):

This issue happens because Dify's Swagger/OpenAPI parser doesn't explicitly map object-type parameters to the correct type. In the code, if a parameter's type isn't recognized (like "object"), it defaults to "string", so object parameters show up as strings in the UI—even though the backend does support object types if parsed correctly. The relevant logic is in the parser's _get_tool_parameter_type method, which currently skips "object" types and leaves them as string by default (source).

There isn't an official workaround or fix in v1.9.2, and recent updates have not directly addressed this mapping issue. As a temporary workaround, you could try manually editing the tool's schema after import to adjust parameter types, but this may not fully resolve nested object handling.

If you need full object-type support, you may want to watch for updates or consider patching the parser to recognize and map "object" types to ToolParameterType.OBJECT (and supply the schema), since the backend and UI do have support for object parameters if parsed correctly.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 2, 2025): <!-- Answer --> This issue happens because Dify's Swagger/OpenAPI parser doesn't explicitly map object-type parameters to the correct type. In the code, if a parameter's type isn't recognized (like "object"), it defaults to "string", so object parameters show up as strings in the UI—even though the backend does support object types if parsed correctly. The relevant logic is in the parser's `_get_tool_parameter_type` method, which currently skips "object" types and leaves them as string by default ([source](https://github.com/langgenius/dify/blob/f48522e923369a28a1efaa4e4fa7325229147d0c/api/core/tools/utils/parser.py#L17-L454)). There isn't an official workaround or fix in v1.9.2, and recent updates have not directly addressed this mapping issue. As a temporary workaround, you could try manually editing the tool's schema after import to adjust parameter types, but this may not fully resolve nested object handling. If you need full object-type support, you may want to watch for updates or consider patching the parser to recognize and map "object" types to `ToolParameterType.OBJECT` (and supply the schema), since the backend and UI do have support for object parameters if parsed correctly. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ab0f7ad7-18bb-4a68-ad13-41f9fd30a91a?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20issue%20happens%20because%20Dify%27s%20Swagger/OpenAPI%20parser%20doesn%27t%20explicitly%20map%20object-type%20parameters%20to%20the%20correct%20type.%20In%20the%20code%2C%20if%20a%20parameter%27s%20type%20isn%27t%20recognized%20%28like%20%22object%22%29%2C%20it%20defaults%20to%20%22string%22%2C%20so%20object%20parameters%20show%20up%20as%20strings%20in%20the%20UI%E2%80%94even%20though%20the%20backend%20does%20support%20object%20types%20if%20parsed%20correctly.%20The%20relevant%20logic%20is%20in%20the%20parser%27s%20%60_get_tool_parameter_type%60%20method%2C%20which%20currently%20skips%20%22object%22%20types%20and%20leaves%20them%20as%20string%20by%20default%20%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/f48522e923369a28a1efaa4e4fa7325229147d0c/api/core/tools/utils/parser.py%23L17-L454%29%29.%0A%0AThere%20isn%27t%20an%20official%20workaround%20or%20fix%20in%20v1.9.2%2C%20and%20recent%20updates%20have%20not%20directly%20addressed%20this%20mapping%20issue.%20As%20a%20temporary%20workaround%2C%20you%20could%20try%20manually%20editing%20the%20tool%27s%20schema%20after%20import%20to%20adjust%20parameter%20types%2C%20but%20this%20may%20not%20fully%20resolve%20nested%20object%20handling.%0A%0AIf%20you%20need%20full%20object-type%20support%2C%20you%20may%20want%20to%20watch%20for%20updates%20or%20consider%20patching%20the%20parser%20to%20recognize%20and%20map%20%22object%22%20types%20to%20%60ToolParameterType.OBJECT%60%20%28and%20supply%20the%20schema%29%2C%20since%20the%20backend%20and%20UI%20do%20have%20support%20for%20object%20parameters%20if%20parsed%20correctly.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29034)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20746