Skip to content

[codex] Fix /api/tools/bulk 422 caused by route matching#262

Open
39499740 wants to merge 1 commit intodataelement:mainfrom
39499740:codex/fix-tools-bulk-route-261
Open

[codex] Fix /api/tools/bulk 422 caused by route matching#262
39499740 wants to merge 1 commit intodataelement:mainfrom
39499740:codex/fix-tools-bulk-route-261

Conversation

@39499740
Copy link
Copy Markdown
Contributor

@39499740 39499740 commented Apr 2, 2026

Summary

  • fix PUT /api/tools/bulk returning 422 when toggling tools in bulk from Company Settings
  • move the static /tools/bulk route definition before the dynamic /{tool_id} route so FastAPI matches correctly
  • add an API regression test to ensure /api/tools/bulk updates tool states successfully

Root Cause

PUT /api/tools/bulk was being matched by PUT /tools/{tool_id} first, so "bulk" was validated as a UUID path parameter and failed with 422.

Validation

  • cd backend && uv run --extra dev pytest -q tests/test_tools_bulk_api.py
  • result: 1 passed

Fixes #261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

批量开/关工具报错

1 participant