- Upgrade required Starlette to
0.12.9
, the new range is>=0.12.9,<=0.12.9
.- Add
State
to FastAPI apps atapp.state
. - PR #593.
- Add
- Improve handling of custom classes for
Request
s andAPIRoute
s.- This helps to more easily solve use cases like:
- Reading a body before and/or after a request (equivalent to a middleware).
- Run middleware-like code only for a subset of path operations.
- Process a request before passing it to a path operation function. E.g. decompressing, deserializing, etc.
- Processing a response after being generated by path operation functions but before returning it. E.g. adding custom headers, logging, adding extra metadata.
- New docs section: Custom Request and APIRoute class.
- PR #589 by @dmontagu.
- This helps to more easily solve use cases like:
- Fix preserving custom route class in routers when including other sub-routers. PR #538 by @dmontagu.