答:定义公开的 Pydantic 模型,在路径装饰器写 response_model=...,或使用适当的返回类型声明。FastAPI 会在普通序列化路径上以它校验、转换和过滤输出。
题干与完整题解免费阅读第 1 / 1 页
本页 1 道,共 1 道浏览其他领域
答:定义公开的 Pydantic 模型,在路径装饰器写 response_model=...,或使用适当的返回类型声明。FastAPI 会在普通序列化路径上以它校验、转换和过滤输出。