Skip to content

Commit 988c5a7

Browse files
ImTotemclaude
andcommitted
fix(filter): use default=[] instead of default_factory for search_fields
FastAPI Depends() passes the factory sentinel as raw value instead of calling it, causing ValidationError on LinkFilter query param injection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9feee28 commit 988c5a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bcsd_api/filter/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BaseFilter(BaseModel):
1111
sort_by: str = "id"
1212
sort_order: str = Field("asc", pattern="^(asc|desc)$")
1313

14-
search_fields: list[str] = Field(default_factory=list, exclude=True)
14+
search_fields: list[str] = Field(default=[], exclude=True)
1515

1616
def filters(self) -> dict:
1717
excluded = {"page", "size", "sort_by", "sort_order", "search_fields"}

0 commit comments

Comments
 (0)