Skip to content

Commit

Permalink
Merge branch 'master' into patch-7
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Feb 10, 2023
2 parents 5f8375c + 6e94ec2 commit 343c044
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/questions.yml
Expand Up @@ -36,7 +36,7 @@ body:
required: true
- label: I already read and followed all the tutorial in the docs and didn't find an answer.
required: true
- label: I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/samuelcolvin/pydantic).
- label: I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/pydantic/pydantic).
required: true
- label: I already checked if it is not related to FastAPI but to [Swagger UI](https://github.com/swagger-api/swagger-ui).
required: true
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -102,6 +102,12 @@ The key features are:

---

"_If anyone is looking to build a production Python API, I would highly recommend **FastAPI**. It is **beautifully designed**, **simple to use** and **highly scalable**, it has become a **key component** in our API first development strategy and is driving many automations and services such as our Virtual TAC Engineer._"

<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/" target="_blank"><small>(ref)</small></a></div>

---

## **Typer**, the FastAPI of CLIs

<a href="https://typer.tiangolo.com" target="_blank"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a>
Expand Down
6 changes: 6 additions & 0 deletions docs/en/docs/index.md
Expand Up @@ -99,6 +99,12 @@ The key features are:

---

"_If anyone is looking to build a production Python API, I would highly recommend **FastAPI**. It is **beautifully designed**, **simple to use** and **highly scalable**, it has become a **key component** in our API first development strategy and is driving many automations and services such as our Virtual TAC Engineer._"

<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/" target="_blank"><small>(ref)</small></a></div>

---

## **Typer**, the FastAPI of CLIs

<a href="https://typer.tiangolo.com" target="_blank"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/en/docs/project-generation.md
@@ -1,6 +1,6 @@
# Project Generation - Template

You can use a project generator to get started, as it includes a lot of the initial set up, security, database and first API endpoints already done for you.
You can use a project generator to get started, as it includes a lot of the initial set up, security, database and some API endpoints already done for you.

A project generator will always have a very opinionated setup that you should update and adapt for your own needs, but it might be a good starting point for your project.

Expand Down
26 changes: 23 additions & 3 deletions docs/en/docs/release-notes.md
Expand Up @@ -3,6 +3,26 @@
## Latest Changes


## 0.90.1

### Upgrades

* ⬆️ Upgrade Starlette range to allow 0.23.1. PR [#5980](https://github.com/tiangolo/fastapi/pull/5980) by [@tiangolo](https://github.com/tiangolo).

### Docs

* ✏ Tweak wording to clarify `docs/en/docs/project-generation.md`. PR [#5930](https://github.com/tiangolo/fastapi/pull/5930) by [@chandra-deb](https://github.com/chandra-deb).
* ✏ Update Pydantic GitHub URLs. PR [#5952](https://github.com/tiangolo/fastapi/pull/5952) by [@yezz123](https://github.com/yezz123).
* 📝 Add opinion from Cisco. PR [#5981](https://github.com/tiangolo/fastapi/pull/5981) by [@tiangolo](https://github.com/tiangolo).

### Translations

* 🌐 Add Russian translation for `docs/ru/docs/tutorial/cookie-params.md`. PR [#5890](https://github.com/tiangolo/fastapi/pull/5890) by [@bnzone](https://github.com/bnzone).

### Internal

* ✏ Update `zip-docs.sh` internal script, remove extra space. PR [#5931](https://github.com/tiangolo/fastapi/pull/5931) by [@JuanPerdomo00](https://github.com/JuanPerdomo00).

## 0.90.0

### Upgrades
Expand Down Expand Up @@ -1241,7 +1261,7 @@ Thanks to [Dima Boger](https://twitter.com/b0g3r) for the security report! 🙇

### Security fixes

* 📌 Upgrade pydantic pin, to handle security vulnerability [CVE-2021-29510](https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh). PR [#3213](https://github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://github.com/tiangolo).
* 📌 Upgrade pydantic pin, to handle security vulnerability [CVE-2021-29510](https://github.com/pydantic/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh). PR [#3213](https://github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://github.com/tiangolo).

## 0.65.0

Expand Down Expand Up @@ -1796,11 +1816,11 @@ Note: all the previous parameters are still there, so it's still possible to dec

## 0.55.1

* Fix handling of enums with their own schema in path parameters. To support [samuelcolvin/pydantic#1432](https://github.com/samuelcolvin/pydantic/pull/1432) in FastAPI. PR [#1463](https://github.com/tiangolo/fastapi/pull/1463).
* Fix handling of enums with their own schema in path parameters. To support [pydantic/pydantic#1432](https://github.com/pydantic/pydantic/pull/1432) in FastAPI. PR [#1463](https://github.com/tiangolo/fastapi/pull/1463).

## 0.55.0

* Allow enums to allow them to have their own schemas in OpenAPI. To support [samuelcolvin/pydantic#1432](https://github.com/samuelcolvin/pydantic/pull/1432) in FastAPI. PR [#1461](https://github.com/tiangolo/fastapi/pull/1461).
* Allow enums to allow them to have their own schemas in OpenAPI. To support [pydantic/pydantic#1432](https://github.com/pydantic/pydantic/pull/1432) in FastAPI. PR [#1461](https://github.com/tiangolo/fastapi/pull/1461).
* Add links for funding through [GitHub sponsors](https://github.com/sponsors/tiangolo). PR [#1425](https://github.com/tiangolo/fastapi/pull/1425).
* Update issue template for for questions. PR [#1344](https://github.com/tiangolo/fastapi/pull/1344) by [@retnikt](https://github.com/retnikt).
* Update warning about storing passwords in docs. PR [#1336](https://github.com/tiangolo/fastapi/pull/1336) by [@skorokithakis](https://github.com/skorokithakis).
Expand Down
49 changes: 49 additions & 0 deletions docs/ru/docs/tutorial/cookie-params.md
@@ -0,0 +1,49 @@
# Параметры Cookie

Вы можете задать параметры Cookie таким же способом, как `Query` и `Path` параметры.

## Импорт `Cookie`

Сначала импортируйте `Cookie`:

=== "Python 3.6 и выше"

```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001.py!}
```

=== "Python 3.10 и выше"

```Python hl_lines="1"
{!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
```

## Объявление параметров `Cookie`

Затем объявляйте параметры cookie, используя ту же структуру, что и с `Path` и `Query`.

Первое значение - это значение по умолчанию, вы можете передать все дополнительные параметры проверки или аннотации:

=== "Python 3.6 и выше"

```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001.py!}
```

=== "Python 3.10 и выше"

```Python hl_lines="7"
{!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
```

!!! note "Технические детали"
`Cookie` - это класс, родственный `Path` и `Query`. Он также наследуется от общего класса `Param`.

Но помните, что когда вы импортируете `Query`, `Path`, `Cookie` и другое из `fastapi`, это фактически функции, которые возвращают специальные классы.

!!! info "Дополнительная информация"
Для объявления cookies, вам нужно использовать `Cookie`, иначе параметры будут интерпретированы как параметры запроса.

## Резюме

Объявляйте cookies с помощью `Cookie`, используя тот же общий шаблон, что и `Query`, и `Path`.
1 change: 1 addition & 0 deletions docs/ru/mkdocs.yml
Expand Up @@ -64,6 +64,7 @@ nav:
- Учебник - руководство пользователя:
- tutorial/body-fields.md
- tutorial/background-tasks.md
- tutorial/cookie-params.md
- async.md
- Развёртывание:
- deployment/index.md
Expand Down
2 changes: 1 addition & 1 deletion fastapi/__init__.py
@@ -1,6 +1,6 @@
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""

__version__ = "0.90.0"
__version__ = "0.90.1"

from starlette import status as status

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -39,7 +39,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
"starlette>=0.22.0,<=0.23.0",
"starlette>=0.22.0,<0.24.0",
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
]
dynamic = ["version"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/zip-docs.sh
@@ -1,4 +1,4 @@
#! /usr/bin/env bash
#!/usr/bin/env bash

set -x
set -e
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tutorial/test_dataclasses/test_tutorial002.py
Expand Up @@ -54,7 +54,7 @@ def test_openapi_schema():
response = client.get("/openapi.json")
assert response.status_code == 200
# TODO: remove this once Pydantic 1.9 is released
# Ref: https://github.com/samuelcolvin/pydantic/pull/2557
# Ref: https://github.com/pydantic/pydantic/pull/2557
data = response.json()
alternative_data1 = deepcopy(data)
alternative_data2 = deepcopy(data)
Expand Down

0 comments on commit 343c044

Please sign in to comment.