[PR #32109] fix(service_api): register rag pipeline service API routes #33552

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

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

State: closed
Merged: No


Summary

  • fix 3 RAG pipeline service API routes to use Flask converter syntax (<uuid:...>, <string:...>)
  • import rag_pipeline_workflow in controllers.service_api so route decorators are evaluated and endpoints are registered under /v1
  • serialize created_at in /v1/datasets/pipeline/file-upload response to a Unix timestamp to avoid JSON serialization errors
  • add regression tests for both route registration and file-upload response serialization

Why

Two service API bugs were present in the same module:

  1. Pipeline endpoints under /v1/datasets/<dataset_id>/pipeline/... were not registered/usable due to route syntax + missing module import.
  2. File upload endpoint returned a raw datetime (created_at) which can trigger TypeError: Object of type datetime is not JSON serializable.

Fixes #32099
Fixes #32100

Testing

  • uv run --project api --group dev ruff check api/controllers/service_api/__init__.py api/controllers/service_api/dataset/rag_pipeline/rag_pipeline_workflow.py api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_route_registration.py api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_file_upload_api.py
  • uv run --project api --group dev pytest api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_route_registration.py api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_file_upload_api.py -q
**Original Pull Request:** https://github.com/langgenius/dify/pull/32109 **State:** closed **Merged:** No --- ## Summary - fix 3 RAG pipeline service API routes to use Flask converter syntax (`<uuid:...>`, `<string:...>`) - import `rag_pipeline_workflow` in `controllers.service_api` so route decorators are evaluated and endpoints are registered under `/v1` - serialize `created_at` in `/v1/datasets/pipeline/file-upload` response to a Unix timestamp to avoid JSON serialization errors - add regression tests for both route registration and file-upload response serialization ## Why Two service API bugs were present in the same module: 1. Pipeline endpoints under `/v1/datasets/<dataset_id>/pipeline/...` were not registered/usable due to route syntax + missing module import. 2. File upload endpoint returned a raw `datetime` (`created_at`) which can trigger `TypeError: Object of type datetime is not JSON serializable`. Fixes #32099 Fixes #32100 ## Testing - `uv run --project api --group dev ruff check api/controllers/service_api/__init__.py api/controllers/service_api/dataset/rag_pipeline/rag_pipeline_workflow.py api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_route_registration.py api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_file_upload_api.py` - `uv run --project api --group dev pytest api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_route_registration.py api/tests/unit_tests/controllers/service_api/dataset/test_rag_pipeline_file_upload_api.py -q`
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#33552