-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Labels
Description
@router.get("/foobar", response_model=FooBarModel, status_code=200)
async def foobar(
addition: str = Query(None, regex="\w+", description="some regex")
):
passWould be nice if you could pass compiled regex objects to regex= parameter of Query, e.g: regex=re.compile(r"\w+").
Possibly also for Path, Cookie, Form, File.
re.compile("\w+").pattern == "\\w+"
TrueWhy? So I don't have to write regex=MyRegex.pattern (being pedantic :-P)
Reactions are currently unavailable