Skip to content

feat: add new fields to file upload response DTOs - #334

Merged
guoshiqiufeng merged 1 commit into
mainfrom
feat/fileUpload
May 20, 2026
Merged

feat: add new fields to file upload response DTOs#334
guoshiqiufeng merged 1 commit into
mainfrom
feat/fileUpload

Conversation

@guoshiqiufeng

Copy link
Copy Markdown
Owner

feat: add new fields to file upload response DTOs

Add 7 new fields to FileUploadResponse and UploadFileInfoResponse to match the complete Dify API specification:

  • previewUrl: Preview URL for the file
  • sourceUrl: Source URL of the file
  • originalUrl: Original URL of the file
  • userId: User ID who uploaded the file
  • tenantId: Tenant ID associated with the file
  • conversationId: Conversation ID (nullable, for chat context)
  • fileKey: File storage key/path

Changes:

  • feat(chat): add 7 new fields to FileUploadResponse
  • feat(dataset): add 7 new fields to UploadFileInfoResponse
  • fix(dataset): correct typo in @JsonAlias from "mine_type" to "mime_type"
  • test(chat): update FileUploadResponseTest to cover new fields
  • test(dataset): create UploadFileInfoResponseTest with comprehensive coverage
  • docs: update Chinese and English documentation for both response DTOs

All fields are nullable (optional) to maintain backward compatibility. Jackson automatically handles JSON deserialization for the new fields.

Breaking Changes:

  • Equals/hashCode behavior changes due to new fields in DTOs
  • Fixed mime_type alias (was incorrectly "mine_type")

Summary

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Resolves #333

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>,

see documentation

for more details.

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic
    change.
  • I've updated the documentation accordingly.

Add 7 new fields to FileUploadResponse and UploadFileInfoResponse to match
the complete Dify API specification:
- previewUrl: Preview URL for the file
- sourceUrl: Source URL of the file
- originalUrl: Original URL of the file
- userId: User ID who uploaded the file
- tenantId: Tenant ID associated with the file
- conversationId: Conversation ID (nullable, for chat context)
- fileKey: File storage key/path

Changes:
- feat(chat): add 7 new fields to FileUploadResponse
- feat(dataset): add 7 new fields to UploadFileInfoResponse
- fix(dataset): correct typo in @JsonAlias from "mine_type" to "mime_type"
- test(chat): update FileUploadResponseTest to cover new fields
- test(dataset): create UploadFileInfoResponseTest with comprehensive coverage
- docs: update Chinese and English documentation for both response DTOs

All fields are nullable (optional) to maintain backward compatibility.
Jackson automatically handles JSON deserialization for the new fields.

Breaking Changes:
- Equals/hashCode behavior changes due to new fields in DTOs
- Fixed mime_type alias (was incorrectly "mine_type")
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 20, 2026
@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (9e2e496) to head (f68c4c3).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #334   +/-   ##
=========================================
  Coverage     92.27%   92.27%           
  Complexity     2459     2459           
=========================================
  Files           185      185           
  Lines          6917     6917           
  Branches        795      795           
=========================================
  Hits           6383     6383           
  Misses          353      353           
  Partials        181      181           
Flag Coverage Δ
v2.3.3-SNAPSHOT 92.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
springboot2 ∅ <ø> (∅)
springboot3 ∅ <ø> (∅)

@guoshiqiufeng
guoshiqiufeng merged commit e07363c into main May 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

文件上传fileUpload响应参数缺少

1 participant