Skip to content

Commit

Permalink
📝 Update release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 18, 2023
1 parent 546392d commit bd90bed
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions docs/en/docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Latest Changes

* 📝 Tweak tip recommending `Annotated` in docs. PR [#9270](/~https://github.com/tiangolo/fastapi/pull/9270) by [@tiangolo](/~https://github.com/tiangolo).

### Highlights

This release adds support for dependencies and parameters using `Annotated`. ✨
This release adds support for dependencies and parameters using `Annotated` and recommends its usage. ✨

This has **several benefits**, one of the main ones is that now the parameters of your functions with `Annotated` would **not be affected** at all.

Expand Down Expand Up @@ -85,6 +85,19 @@ def delete_item(user: CurrentUser, item_id: int):

...and `CurrentUser` has all the typing information as `User`, so your editor will work as expected (autocompletion and everything), and **FastAPI** will be able to understand the dependency defined in `Annotated`. 😎

Roughly **all the docs** have been rewritten to use `Annotated` as the main way to declare **parameters** and **dependencies**. All the **examples** in the docs now include a version with `Annotated` and a version without it, for each of the specific Python version (when there are small differences/improvements in more recent versions).

The key updated docs are:

* Python Types Intro:
* [Type Hints with Metadata Annotations](https://fastapi.tiangolo.com/python-types/#type-hints-with-metadata-annotations).
* Tutorial:
* [Query Parameters and String Validations - Additional validation](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#additional-validation)
* [Advantages of `Annotated`](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#advantages-of-annotated)
* [Path Parameters and Numeric Validations - Order the parameters as you need, tricks](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#order-the-parameters-as-you-need-tricks)
* [Better with `Annotated`](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#better-with-annotated)
* [Dependencies - First Steps - Share `Annotated` dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/#share-annotated-dependencies)

Special thanks to [@nzig](/~https://github.com/nzig) for the core implementation and to [@adriangb](/~https://github.com/adriangb) for the inspiration and idea with [Xpresso](/~https://github.com/adriangb/xpresso)! 🚀

### Features
Expand All @@ -93,6 +106,7 @@ Special thanks to [@nzig](/~https://github.com/nzig) for the core implementation a

### Docs

* 📝 Tweak tip recommending `Annotated` in docs. PR [#9270](/~https://github.com/tiangolo/fastapi/pull/9270) by [@tiangolo](/~https://github.com/tiangolo).
* 📝 Update order of examples, latest Python version first, and simplify version tab names. PR [#9269](/~https://github.com/tiangolo/fastapi/pull/9269) by [@tiangolo](/~https://github.com/tiangolo).
* 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests. PR [#9268](/~https://github.com/tiangolo/fastapi/pull/9268) by [@tiangolo](/~https://github.com/tiangolo).

Expand Down

0 comments on commit bd90bed

Please sign in to comment.