知识卡片
FastAPI组合框架能力
FastAPI 是构建 Web API 的 Python 框架:Uvicorn 作为 Web 服务器接收请求,Starlette 负责 Web 路由,FastAPI 在其上结合 pydantic 做数据验证并生成 API 文档。它在本书中用于实现订单接口;这些是框架层分工,不等于订单业务逻辑。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 2 章《A basic API implementation》(源文件:_epub-src/OEBPS/Text/02.htm)
- 结论依据:2.3 节介绍 FastAPI 建于 Starlette 之上并使用 pydantic;随后说明 Uvicorn 接收 HTTP 请求、传给 Starlette,FastAPI 增强路由以提供验证与文档。
- 原始内容:In addition, FastAPI uses pydantic ( https://github.com/samuelcolvin/pydantic/ ) for data validation. ... Uvicorn handles HTTP requests and passes them on to Starlette, which functions within your application to call when a request arrives in the server. FastAPI is built on top of Starlette, and it enhances Starlette’s routes with data validation and API documentation functionality.