[PR #28949] refactor: port reqparse to Pydantic model #32247

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

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

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

part of #27513

File Description
api/pyrefly.toml Adds new type checker configuration file
api/services/account_service.py Updates method signatures to accept optional types
api/extensions/ext_redis.py Improves type hints for the redis_fallback decorator
api/events/event_handlers/update_provider_when_message_created.py Adds type ignore comment for type checker
api/controllers/files/upload.py Converts plugin file upload endpoint to use Pydantic model
api/controllers/files/tool_files.py Converts tool file endpoints to use Pydantic models
api/controllers/files/image_preview.py Converts image preview endpoints to use Pydantic models
api/controllers/console/version.py Converts version check endpoint to use Pydantic model
api/controllers/console/setup.py Converts setup endpoint with field validators for email, name, and password
api/controllers/console/remote_files.py Converts remote file upload endpoint to use Pydantic model
api/controllers/console/init_validate.py Converts init validation endpoint to use Pydantic model
api/controllers/console/explore/recommended_app.py Converts recommended apps endpoint to use Pydantic model
api/controllers/console/billing/compliance.py Converts compliance download endpoint to use Pydantic model
api/controllers/console/billing/billing.py Converts subscription and partner tenants endpoints to use Pydantic models with validators
api/controllers/console/auth/oauth_server.py Converts OAuth server endpoints to use Pydantic models
api/controllers/console/auth/login.py Converts login, email reset, and email code login endpoints to use Pydantic models
api/controllers/console/auth/forgot_password.py Converts forgot password endpoints to use Pydantic models
api/controllers/console/auth/email_register.py Converts email registration endpoints to use Pydantic models
api/controllers/console/auth/data_source_bearer_auth.py Converts data source bearer auth endpoint to use Pydantic model
api/controllers/console/auth/activate.py Converts activation endpoints to use Pydantic models
api/controllers/console/app/workflow_draft_variable.py Converts workflow draft variable endpoints to use Pydantic models
api/controllers/console/app/site.py Converts app site endpoint to use Pydantic model
api/controllers/console/app/ops_trace.py Converts ops trace endpoints to use Pydantic models
api/controllers/console/app/mcp_server.py Converts MCP server endpoints to use Pydantic models
api/controllers/console/app/audio.py Converts audio/TTS endpoints to use Pydantic models
api/controllers/console/app/app_import.py Converts app import endpoint to use Pydantic model
api/controllers/console/app/annotation.py Converts annotation endpoints to use Pydantic models
api/controllers/console/app/agent.py Converts agent log endpoint to use Pydantic model with UUID validation
api/controllers/console/admin.py Converts admin explore app endpoint to use Pydantic model

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • 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 dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/28949 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## 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. --> part of #27513 | File | Description | | ---- | ----------- | | api/pyrefly.toml | Adds new type checker configuration file | | api/services/account_service.py | Updates method signatures to accept optional types | | api/extensions/ext_redis.py | Improves type hints for the redis_fallback decorator | | api/events/event_handlers/update_provider_when_message_created.py | Adds type ignore comment for type checker | | api/controllers/files/upload.py | Converts plugin file upload endpoint to use Pydantic model | | api/controllers/files/tool_files.py | Converts tool file endpoints to use Pydantic models | | api/controllers/files/image_preview.py | Converts image preview endpoints to use Pydantic models | | api/controllers/console/version.py | Converts version check endpoint to use Pydantic model | | api/controllers/console/setup.py | Converts setup endpoint with field validators for email, name, and password | | api/controllers/console/remote_files.py | Converts remote file upload endpoint to use Pydantic model | | api/controllers/console/init_validate.py | Converts init validation endpoint to use Pydantic model | | api/controllers/console/explore/recommended_app.py | Converts recommended apps endpoint to use Pydantic model | | api/controllers/console/billing/compliance.py | Converts compliance download endpoint to use Pydantic model | | api/controllers/console/billing/billing.py | Converts subscription and partner tenants endpoints to use Pydantic models with validators | | api/controllers/console/auth/oauth_server.py | Converts OAuth server endpoints to use Pydantic models | | api/controllers/console/auth/login.py | Converts login, email reset, and email code login endpoints to use Pydantic models | | api/controllers/console/auth/forgot_password.py | Converts forgot password endpoints to use Pydantic models | | api/controllers/console/auth/email_register.py | Converts email registration endpoints to use Pydantic models | | api/controllers/console/auth/data_source_bearer_auth.py | Converts data source bearer auth endpoint to use Pydantic model | | api/controllers/console/auth/activate.py | Converts activation endpoints to use Pydantic models | | api/controllers/console/app/workflow_draft_variable.py | Converts workflow draft variable endpoints to use Pydantic models | | api/controllers/console/app/site.py | Converts app site endpoint to use Pydantic model | | api/controllers/console/app/ops_trace.py | Converts ops trace endpoints to use Pydantic models | | api/controllers/console/app/mcp_server.py | Converts MCP server endpoints to use Pydantic models | | api/controllers/console/app/audio.py | Converts audio/TTS endpoints to use Pydantic models | | api/controllers/console/app/app_import.py | Converts app import endpoint to use Pydantic model | | api/controllers/console/app/annotation.py | Converts annotation endpoints to use Pydantic models | | api/controllers/console/app/agent.py | Converts agent log endpoint to use Pydantic model with UUID validation | | api/controllers/console/admin.py | Converts admin explore app endpoint to use Pydantic model | ## Screenshots | Before | After | |--------|-------| | ... | ... | ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](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. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:51:02 -05:00
yindo closed this issue 2026-02-21 20:51:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32247