value is not a valid dict (type=type_error.dict)找了一圈净是废话直截了当这是fastapi url返回值不是一个字典,解决方法,在定义的返回模型中添加: class Config: orm_mode = True