[PR #382] [MERGED] fix: establish strong dependency between transfer_method and file parameters #465

Closed
opened 2026-02-16 06:15:35 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-docs/pull/382
Author: @lyzno1
Created: 8/5/2025
Status: Merged
Merged: 8/5/2025
Merged by: @crazywoola

Base: mainHead: fix/issue-344-file-transfer-dependency


📝 Commits (3)

  • 3a7c36a fix: establish strong dependency between transfer_method and file parameters
  • bacfe4d fix(zh-hans): establish strong dependency between transfer_method and file parameters
  • f0e7176 fix(ja-jp): establish strong dependency between transfer_method and file parameters

📊 Changes

12 files changed (+251 additions, -54 deletions)

View changed files

📝 en/openapi_chat.json (+21 -6)
📝 en/openapi_chatflow.json (+20 -6)
📝 en/openapi_completion.json (+21 -6)
📝 en/openapi_workflow.json (+21 -4)
📝 ja-jp/openapi_chat.json (+21 -4)
📝 ja-jp/openapi_chatflow.json (+21 -4)
📝 ja-jp/openapi_completion.json (+21 -4)
📝 ja-jp/openapi_workflow.json (+21 -4)
📝 zh-hans/openapi_chat.json (+21 -4)
📝 zh-hans/openapi_chatflow.json (+21 -4)
📝 zh-hans/openapi_completion.json (+21 -4)
📝 zh-hans/openapi_workflow.json (+21 -4)

📄 Description

Summary

  • Replace loose oneOf validation with strict conditional dependencies using anyOf
  • transfer_method: "remote_url" now requires url and prohibits upload_file_id
  • transfer_method: "local_file" now requires upload_file_id and prohibits url
  • Applied consistent fix pattern across all OpenAPI files in all languages (en, zh-hans, ja-jp)
  • Prevents invalid combinations like remote_url + upload_file_id

Changes Made

English Version (en/)

  • openapi_chat.json - InputFileObject
  • openapi_chatflow.json - InputFileObjectAdvanced
  • openapi_completion.json - InputFileObject
  • openapi_workflow.json - InputFileObjectWorkflow

Chinese Version (zh-hans/)

  • openapi_chat.json - BasicInputFileObjectCn
  • openapi_chatflow.json - InputFileObjectCn
  • openapi_completion.json - InputFileObject
  • openapi_workflow.json - InputFileObjectWorkflowCn

Japanese Version (ja-jp/)

  • openapi_chat.json - BasicInputFileObjectJa
  • openapi_chatflow.json - InputFileObjectJp
  • openapi_completion.json - InputFileObjectJp
  • openapi_workflow.json - InputFileObjectWorkflowJp

Technical Details

Replaced the original loose validation:

"oneOf": [
  {"required": ["url"]},
  {"required": ["upload_file_id"]}
]

With strict conditional dependencies:

"anyOf": [
  {
    "properties": { 
      "transfer_method": { "enum": ["remote_url"] },
      "url": { "type": "string", "format": "url" }
    },
    "required": ["url"],
    "not": { "required": ["upload_file_id"] }
  },
  {
    "properties": { 
      "transfer_method": { "enum": ["local_file"] },
      "upload_file_id": { "type": "string" }
    },
    "required": ["upload_file_id"],
    "not": { "required": ["url"] }
  }
]

Test Plan

  • Verified schema structure consistency across all 12 OpenAPI files
  • Confirmed translation accuracy in Chinese and Japanese versions
  • Validated that the fix prevents invalid parameter combinations
  • Ensured OpenAPI 3.0.1 compatibility

Fixes #344


🔄 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/langgenius/dify-docs/pull/382 **Author:** [@lyzno1](https://github.com/lyzno1) **Created:** 8/5/2025 **Status:** ✅ Merged **Merged:** 8/5/2025 **Merged by:** [@crazywoola](https://github.com/crazywoola) **Base:** `main` ← **Head:** `fix/issue-344-file-transfer-dependency` --- ### 📝 Commits (3) - [`3a7c36a`](https://github.com/langgenius/dify-docs/commit/3a7c36a5273167df17844f91ae13cad41b1d689c) fix: establish strong dependency between transfer_method and file parameters - [`bacfe4d`](https://github.com/langgenius/dify-docs/commit/bacfe4d5f83302a22a620e15c0d37787c11071a4) fix(zh-hans): establish strong dependency between transfer_method and file parameters - [`f0e7176`](https://github.com/langgenius/dify-docs/commit/f0e71769a4e7bdeb5a7e6181671ac3f36d215e4d) fix(ja-jp): establish strong dependency between transfer_method and file parameters ### 📊 Changes **12 files changed** (+251 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `en/openapi_chat.json` (+21 -6) 📝 `en/openapi_chatflow.json` (+20 -6) 📝 `en/openapi_completion.json` (+21 -6) 📝 `en/openapi_workflow.json` (+21 -4) 📝 `ja-jp/openapi_chat.json` (+21 -4) 📝 `ja-jp/openapi_chatflow.json` (+21 -4) 📝 `ja-jp/openapi_completion.json` (+21 -4) 📝 `ja-jp/openapi_workflow.json` (+21 -4) 📝 `zh-hans/openapi_chat.json` (+21 -4) 📝 `zh-hans/openapi_chatflow.json` (+21 -4) 📝 `zh-hans/openapi_completion.json` (+21 -4) 📝 `zh-hans/openapi_workflow.json` (+21 -4) </details> ### 📄 Description ## Summary - Replace loose `oneOf` validation with strict conditional dependencies using `anyOf` - `transfer_method: "remote_url"` now requires `url` and prohibits `upload_file_id` - `transfer_method: "local_file"` now requires `upload_file_id` and prohibits `url` - Applied consistent fix pattern across all OpenAPI files in all languages (en, zh-hans, ja-jp) - Prevents invalid combinations like `remote_url + upload_file_id` ## Changes Made ### English Version (en/) - `openapi_chat.json` - InputFileObject - `openapi_chatflow.json` - InputFileObjectAdvanced - `openapi_completion.json` - InputFileObject - `openapi_workflow.json` - InputFileObjectWorkflow ### Chinese Version (zh-hans/) - `openapi_chat.json` - BasicInputFileObjectCn - `openapi_chatflow.json` - InputFileObjectCn - `openapi_completion.json` - InputFileObject - `openapi_workflow.json` - InputFileObjectWorkflowCn ### Japanese Version (ja-jp/) - `openapi_chat.json` - BasicInputFileObjectJa - `openapi_chatflow.json` - InputFileObjectJp - `openapi_completion.json` - InputFileObjectJp - `openapi_workflow.json` - InputFileObjectWorkflowJp ## Technical Details Replaced the original loose validation: ```json "oneOf": [ {"required": ["url"]}, {"required": ["upload_file_id"]} ] ``` With strict conditional dependencies: ```json "anyOf": [ { "properties": { "transfer_method": { "enum": ["remote_url"] }, "url": { "type": "string", "format": "url" } }, "required": ["url"], "not": { "required": ["upload_file_id"] } }, { "properties": { "transfer_method": { "enum": ["local_file"] }, "upload_file_id": { "type": "string" } }, "required": ["upload_file_id"], "not": { "required": ["url"] } } ] ``` ## Test Plan - [x] Verified schema structure consistency across all 12 OpenAPI files - [x] Confirmed translation accuracy in Chinese and Japanese versions - [x] Validated that the fix prevents invalid parameter combinations - [x] Ensured OpenAPI 3.0.1 compatibility Fixes #344 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 06:15:35 -05:00
yindo closed this issue 2026-02-16 06:15:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs#465