fix: Change builtInMetadata return type from String to SimpleResponse#148
Merged
Conversation
## 问题描述 Chatflow的"workflow_started"、"node_started"等workflow事件实体类缺少conversation_id字段。 直接调用dify的HTTP接口能够返回conversation_id,但SDK中只有BaseMessageEvent的子类包含该字段, 而BaseWorkflowEvent的子类缺失,导致前几个SSE事件无法获取conversation_id。 ## 修复内容 - 在BaseWorkflowEvent基类中添加conversation_id字段,使其与BaseMessageEvent保持一致 - 所有继承BaseWorkflowEvent的事件类(WorkflowStartedEvent, NodeStartedEvent, NodeFinishedEvent等) 现在都可以获取conversation_id ## 验证 - 已验证Dify HTTP API在chatflow模式下返回的workflow事件确实包含conversation_id字段 - 代码成功编译通过(mvn clean compile) - 与BaseMessageEvent保持一致的设计 Fixes #145 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Fixes #146 The builtInMetadata API endpoint returns a JSON object ({"result": "success"}) instead of a plain string. This was causing a MismatchedInputException: "Cannot deserialize value of type java.lang.String from Object value". Changed the return type from String to SimpleResponse in both the interface and implementation to properly handle the API response. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #146
The builtInMetadata API endpoint was returning a Jackson deserialization error because the method was trying to deserialize a JSON object into a String type.
Problem
The error was:
This occurred at DefaultDifyDatasetsClient.builtInMetadata() line 439
Root Cause
The actual API response returns a JSON object like {"result": "success"}, but the stricode was exng. According to the Dify API documentation, thepecting a plain endpoint should return aDifyDatas SimpleResponse objectetsClient interface
Changes
Testing
🤖 Generated with Claude Code
Note
Fixes deserialization by aligning the datasets API with its actual response and extends workflow event payloads.
builtInMetadatareturn type fromStringtoSimpleResponseinDifyDatasetsClientand updateDefaultDifyDatasetsClientto useSimpleResponse.classinexecutePostconversation_idfield (conversationId) toBaseWorkflowEventWritten by Cursor Bugbot for commit d92367b. This will update automatically on new commits. Configure here.