网站首页
编程语言
数据库
系统相关
其他分享
编程问答
litestar
2024-07-27
如何在 Litestar GET 路由中使用 Pydantic 模型作为查询参数
我正在尝试使用Litestar创建一条GET路由,该路由利用Pydantic模型作为查询参数。但是,序列化无法按预期工作。这是重现我的问题的最小示例:frompydanticimportBaseModelfromlitestarimportLitestar,get,ControllerclassInput(BaseModel):foo:str