[PR #32098] fix(api): serialize pipeline file-upload created_at #33550

Closed
opened 2026-02-21 20:53:29 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32098

State: closed
Merged: Yes


Fixes #32100

Summary

  • Fix POST /v1/datasets/pipeline/file-upload 500s by serializing created_at to an ISO-8601 string.
  • Add a small serializer helper + unit tests to verify the JSON-safe output.

Screenshots

Before After
N/A N/A

Verification

# Upload
curl -i -X POST -H "Authorization: Bearer $DIFY_API_KEY" \
  -F "file=@/path/to/file.pdf" \
  "$DIFY_BASE_URL/v1/datasets/pipeline/file-upload"
# -> 201 and JSON where created_at is a string

# No file
curl -i -X POST -H "Authorization: Bearer $DIFY_API_KEY" \
  "$DIFY_BASE_URL/v1/datasets/pipeline/file-upload"
# -> 400 {"code":"no_file_uploaded",...}

Tests

  • make test TARGET_TESTS=api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_file_upload_serialization.py

Checklist

  • This change requires a documentation update, included: https://github.com/langgenius/dify-docs
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • 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.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

Note: As an external contributor I can’t self-assign to issues; please assign if needed.

**Original Pull Request:** https://github.com/langgenius/dify/pull/32098 **State:** closed **Merged:** Yes --- Fixes #32100 ## Summary - Fix `POST /v1/datasets/pipeline/file-upload` 500s by serializing `created_at` to an ISO-8601 string. - Add a small serializer helper + unit tests to verify the JSON-safe output. ## Screenshots | Before | After | |--------|-------| | N/A | N/A | ## Verification ```bash # Upload curl -i -X POST -H "Authorization: Bearer $DIFY_API_KEY" \ -F "file=@/path/to/file.pdf" \ "$DIFY_BASE_URL/v1/datasets/pipeline/file-upload" # -> 201 and JSON where created_at is a string # No file curl -i -X POST -H "Authorization: Bearer $DIFY_API_KEY" \ "$DIFY_BASE_URL/v1/datasets/pipeline/file-upload" # -> 400 {"code":"no_file_uploaded",...} ``` ## Tests - `make test TARGET_TESTS=api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_file_upload_serialization.py` ## Checklist - [ ] This change requires a documentation update, included: https://github.com/langgenius/dify-docs - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] 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. - [ ] I ran `make lint` and `make type-check` (backend) and `cd web && npx lint-staged` (frontend) to appease the lint gods > Note: As an external contributor I can’t self-assign to issues; please assign if needed.
yindo added the pull-request label 2026-02-21 20:53:29 -05:00
yindo closed this issue 2026-02-21 20:53:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33550