[PR #31097] refactor: migrate tag list API query parameters to Pydantic #33089

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

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

State: closed
Merged: Yes


Summary

Migrate the tag list API endpoint from using request.args.get() to Pydantic BaseModel validation.

Why

  • Issue #31077 requests migrating all request.args.get(default=None, type=str) patterns to Pydantic BaseModel
  • Improves type safety and validation
  • Follows the pattern established in #30870
  • Makes code more maintainable and enables automatic API documentation

Changes

  • Added TagListQueryParam BaseModel to define query parameters
  • Replaced request.args.get() calls with model_validate()
  • Maintains backward compatibility with existing API contracts

Test plan

  • make type-check passes (0 errors)
  • make lint passes
  • All unit tests pass (4958 passed)

Part of #31077

**Original Pull Request:** https://github.com/langgenius/dify/pull/31097 **State:** closed **Merged:** Yes --- ## Summary Migrate the tag list API endpoint from using `request.args.get()` to Pydantic BaseModel validation. ## Why - Issue #31077 requests migrating all `request.args.get(default=None, type=str)` patterns to Pydantic BaseModel - Improves type safety and validation - Follows the pattern established in #30870 - Makes code more maintainable and enables automatic API documentation ## Changes - Added `TagListQueryParam` BaseModel to define query parameters - Replaced `request.args.get()` calls with `model_validate()` - Maintains backward compatibility with existing API contracts ## Test plan - [x] `make type-check` passes (0 errors) - [x] `make lint` passes - [x] All unit tests pass (4958 passed) Part of #31077
yindo added the pull-request label 2026-02-21 20:52:38 -05:00
yindo closed this issue 2026-02-21 20:52:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33089