You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support kebab-case parameter names via Annotated[..., Alias("...")] #937
Is your feature request related to a problem? Please describe.
FastHTML matches handler argument names exactly against request data, so a parameter named user_id cannot read user-id from query strings, form fields, cookies, or path params. Only headers get hyphen mapping (snake2hyphens), so behavior is inconsistent across sources. Users coming from FastAPI expect an alias mechanism (Query(alias=...)).
Describe the solution you'd like
An opt-in Alias marker used with Annotated. The lookup key becomes the alias for every request source, and the base type is still used for conversion. Parameters without Alias are unchanged.
Problem solved
Lets users use kebab-case names in query strings, forms, cookies, and paths without manual request access, and with consistent behavior across sources. It also fixes a related gap: Annotated[int, ...] is not unwrapped today, so int conversion is silently skipped.
Additional context
Current lookup logic is in _find_p (fasthtml/core.py, source in nbs/api/00_core.ipynb). Acceptance criteria: tests cover each source, missing-field messages, and Annotated[int, Alias] conversion; existing tests pass.
Confirmation
[ x ] I have checked the existing issues and pull requests to ensure this feature hasn't been requested before.
[ x ] I have read the project's documentation to ensure this feature doesn't already exist
The commit dfc4ea3 has implemented kebab-case parameter support. PR #938 will be revised to focus solely on supporting completely different names for request parameters.
Activity
feat: introduce Alias class for handling request parameter aliases.
feat: introduce Alias class for handling request parameter aliases.
renatodamas commentedon Oct 21, 2026
The commit dfc4ea3 has implemented kebab-case parameter support. PR #938 will be revised to focus solely on supporting completely different names for request parameters.