From 8c36572d23893a39732290a1ad74df60cb16fd61 Mon Sep 17 00:00:00 2001
From: Felipe Silva <66804965+FelipeSilva93@users.noreply.github.com>
Date: Tue, 5 Oct 2021 09:19:03 -0300
Subject: [PATCH 01/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20transla?=
=?UTF-8?q?tion=20for=20`docs/tutorial/path-params.md`=20(#3664)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Mário Victor Ribeiro Silva
Co-authored-by: Izabela Guerreiro
Co-authored-by: Marcelo Trylesinski
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
Co-authored-by: Felipe
Co-authored-by: Sebastián Ramírez
---
docs/pt/docs/tutorial/path-params.md | 246 +++++++++++++++++++++++++++
docs/pt/mkdocs.yml | 1 +
2 files changed, 247 insertions(+)
create mode 100644 docs/pt/docs/tutorial/path-params.md
diff --git a/docs/pt/docs/tutorial/path-params.md b/docs/pt/docs/tutorial/path-params.md
new file mode 100644
index 000000000..20913a564
--- /dev/null
+++ b/docs/pt/docs/tutorial/path-params.md
@@ -0,0 +1,246 @@
+# Parâmetros da rota da URL
+
+Você pode declarar os "parâmetros" ou "variáveis" com a mesma sintaxe utilizada pelo formato de strings do Python:
+
+```Python hl_lines="6-7"
+{!../../../docs_src/path_params/tutorial001.py!}
+```
+
+O valor do parâmetro que foi passado à `item_id` será passado para a sua função como o argumento `item_id`.
+
+Então, se você rodar este exemplo e for até http://127.0.0.1:8000/items/foo, você verá a seguinte resposta:
+
+```JSON
+{"item_id":"foo"}
+```
+
+## Parâmetros da rota com tipos
+
+Você pode declarar o tipo de um parâmetro na função usando as anotações padrões do Python:
+
+```Python hl_lines="7"
+{!../../../docs_src/path_params/tutorial002.py!}
+```
+
+Nesse caso, `item_id` está sendo declarado como um `int`.
+
+!!! Check Verifique
+ Isso vai dar à você suporte do seu editor dentro das funções, com verificações de erros, autocompletar, etc.
+
+## Conversão de dados
+
+Se você rodar esse exemplo e abrir o seu navegador em http://127.0.0.1:8000/items/3, você verá a seguinte resposta:
+
+```JSON
+{"item_id":3}
+```
+
+!!! Verifique
+ Observe que o valor recebido pela função (e também retornado por ela) é `3`, como um Python `int`, não como uma string `"3"`.
+
+ Então, com essa declaração de tipo, o **FastAPI** dá pra você um "parsing" automático no request .
+
+## Validação de dados
+
+Mas se você abrir o seu navegador em http://127.0.0.1:8000/items/foo, você verá um belo erro HTTP:
+
+```JSON
+{
+ "detail": [
+ {
+ "loc": [
+ "path",
+ "item_id"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ]
+}
+```
+
+devido ao parâmetro da rota `item_id` ter um valor `"foo"`, que não é um `int`.
+
+O mesmo erro apareceria se você tivesse fornecido um `float` ao invés de um `int`, como em: http://127.0.0.1:8000/items/4.2
+
+!!! Verifique
+ Então, com a mesma declaração de tipo do Python, o **FastAPI** dá pra você validação de dados.
+
+ Observe que o erro também mostra claramente o ponto exato onde a validação não passou.
+
+ Isso é incrivelmente útil enquanto se desenvolve e debuga o código que interage com a sua API.
+
+## Documentação
+
+Quando você abrir o seu navegador em http://127.0.0.1:8000/docs, você verá de forma automática e interativa a documtação da API como:
+
+
+
+!!! check
+ Novamente, apenas com a mesma declaração de tipo do Python, o **FastAPI** te dá de forma automática e interativa a documentação (integrada com o Swagger UI).
+
+ Veja que o parâmetro de rota está declarado como sendo um inteiro (int).
+
+## Beneficios baseados em padrões, documentação alternativa
+
+Devido ao schema gerado ser o padrão do OpenAPI, existem muitas ferramentas compatíveis.
+
+Por esse motivo, o próprio **FastAPI** fornece uma API alternativa para documentação (utilizando ReDoc), que você pode acessar em http://127.0.0.1:8000/redoc:
+
+
+
+Da mesma forma, existem muitas ferramentas compatíveis. Incluindo ferramentas de geração de código para muitas linguagens.
+
+## Pydantic
+
+Toda a validação de dados é feita por baixo dos panos pelo Pydantic, então você tem todos os benefícios disso. E assim você sabe que está em boas mãos.
+
+Você pode usar as mesmas declarações de tipo com `str`, `float`, `bool` e muitos outros tipos complexos de dados.
+
+Vamos explorar muitos destes tipos nos próximos capítulos do tutorial.
+
+## A ordem importa
+
+Quando você cria operações de rota, você pode se deparar com situações onde você pode ter uma rota fixa.
+
+Algo como `/users/me` por exemplo, digamos que essa rota seja utilizada para pegar dados sobre o usuário atual.
+
+E então você pode ter também uma rota `/users/{user_id}` para pegar dados sobre um usuário específico associado a um ID de usuário.
+
+Porque as operações de rota são avaliadas em ordem, você precisa ter certeza que a rota para `/users/me` está sendo declarado antes da rota `/users/{user_id}`:
+
+```Python hl_lines="6 11"
+{!../../../docs_src/path_params/tutorial003.py!}
+```
+
+Caso contrário, a rota para `/users/{user_id}` coincidiria também para `/users/me`, "pensando" que estaria recebendo o parâmetro `user_id` com o valor de `"me"`.
+
+## Valores predefinidos
+
+Se você tem uma operação de rota que recebe um parâmetro da rota, mas que você queira que esses valores possíveis do parâmetro da rota sejam predefinidos, você pode usar `Enum` padrão do Python.
+
+### Criando uma classe `Enum`
+
+Importe `Enum` e crie uma sub-classe que herde de `str` e de `Enum`.
+
+Por herdar de `str` a documentação da API vai ser capaz de saber que os valores devem ser do tipo `string` e assim ser capaz de mostrar eles corretamente.
+
+Assim, crie atributos de classe com valores fixos, que serão os valores válidos disponíveis.
+
+```Python hl_lines="1 6-9"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+!!! informação
+ Enumerations (ou enums) estão disponíveis no Python desde a versão 3.4.
+
+!!! dica
+ Se você está se perguntando, "AlexNet", "ResNet", e "LeNet" são apenas nomes de modelos de Machine Learning (aprendizado de máquina).
+
+### Declare um *parâmetro de rota*
+
+Logo, crie um *parâmetro de rota* com anotações de tipo usando a classe enum que você criou (`ModelName`):
+
+```Python hl_lines="16"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+### Revise a documentação
+
+Visto que os valores disponíveis para o parâmetro da rota estão predefinidos, a documentação interativa pode mostrar esses valores de uma forma bem legal:
+
+
+
+### Trabalhando com os *enumeration* do Python
+
+O valor do *parâmetro da rota* será um *membro de enumeration*.
+
+#### Compare *membros de enumeration*
+
+Você pode comparar eles com o *membro de enumeration* no enum `ModelName` que você criou:
+
+```Python hl_lines="17"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+#### Obtenha o *valor de enumerate*
+
+Você pode ter o valor exato de enumerate (um `str` nesse caso) usando `model_name.value`, ou em geral, `your_enum_member.value`:
+
+```Python hl_lines="20"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+!!! conselho
+ Você também poderia acessar o valor `"lenet"` com `ModelName.lenet.value`
+
+#### Retorne *membros de enumeration*
+
+Você pode retornar *membros de enum* da sua *rota de operação*, em um corpo JSON aninhado (por exemplo um `dict`).
+
+Eles serão convertidos para o seus valores correspondentes (strings nesse caso) antes de serem retornados ao cliente:
+
+```Python hl_lines="18 21 23"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+No seu cliente você vai obter uma resposta JSON como:
+
+```JSON
+{
+ "model_name": "alexnet",
+ "message": "Deep Learning FTW!"
+}
+```
+
+## Parâmetros de rota que contém caminhos
+
+Digamos que você tenha uma *operação de rota* com uma rota `/files/{file_path}`.
+
+Mas você precisa que o próprio `file_path` contenha uma *rota*, como `home/johndoe/myfile.txt`.
+
+Então, a URL para este arquivo deveria ser algo como: `/files/home/johndoe/myfile.txt`.
+
+### Suporte do OpenAPI
+
+O OpenAPI não suporta uma maneira de declarar um *parâmetro de rota* que contenha uma *rota* dentro, dado que isso poderia levar a cenários que são difíceis de testar e definir.
+
+No entanto, você pode fazer isso no **FastAPI**, usando uma das ferramentas internas do Starlette.
+
+A documentação continuaria funcionando, ainda que não adicionaria nenhuma informação dizendo que o parâmetro deveria conter uma rota.
+
+### Conversor de rota
+
+Usando uma opção direta do Starlette você pode declarar um *parâmetro de rota* contendo uma *rota* usando uma URL como:
+
+```
+/files/{file_path:path}
+```
+
+Nesse caso, o nome do parâmetro é `file_path`, e a última parte, `:path`, diz que o parâmetro deveria coincidir com qualquer *rota*.
+
+Então, você poderia usar ele com:
+
+```Python hl_lines="6"
+{!../../../docs_src/path_params/tutorial004.py!}
+```
+
+!!! dica
+ Você poderia precisar que o parâmetro contivesse `/home/johndoe/myfile.txt`, com uma barra no inicio (`/`).
+
+ Neste caso, a URL deveria ser: `/files//home/johndoe/myfile.txt`, com barra dupla (`//`) entre `files` e `home`.
+
+
+## Recapitulando
+
+Com o **FastAPI**, usando as declarações de tipo do Python, você obtém:
+
+* Suporte no editor: verificação de erros, e opção de autocompletar, etc.
+* Parsing de dados
+* "Parsing" de dados
+* Validação de dados
+* Anotação da API e documentação automática
+
+Você apenas tem que declará-los uma vez.
+
+Essa é provavelmente a vantagem mais visível do **FastAPI** se comparado com frameworks alternativos (além do desempenho puro).
diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml
index 63c524d84..567d21cc0 100644
--- a/docs/pt/mkdocs.yml
+++ b/docs/pt/mkdocs.yml
@@ -59,6 +59,7 @@ nav:
- Tutorial - Guia de Usuário:
- tutorial/index.md
- tutorial/first-steps.md
+ - tutorial/path-params.md
- tutorial/body-fields.md
- Segurança:
- tutorial/security/index.md
From d8b0a9dc6e08d55623d4f84a0ed268e5b3ad05c9 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 5 Oct 2021 12:19:45 +0000
Subject: [PATCH 02/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index a2bace259..849303bbf 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Portuguese translation for `docs/tutorial/path-params.md`. PR [#3664](https://github.com/tiangolo/fastapi/pull/3664) by [@FelipeSilva93](https://github.com/FelipeSilva93).
* 🌐 Add Portuguese translation for `docs/deployment/https.md`. PR [#3754](https://github.com/tiangolo/fastapi/pull/3754) by [@lsglucas](https://github.com/lsglucas).
* ✨ Update GitHub Action: notify-translations, to avoid a race conditon. PR [#3989](https://github.com/tiangolo/fastapi/pull/3989) by [@tiangolo](https://github.com/tiangolo).
* ⬆️ Upgrade development `autoflake`, supporting multi-line imports. PR [#3988](https://github.com/tiangolo/fastapi/pull/3988) by [@tiangolo](https://github.com/tiangolo).
From 00ac07f65c4dd8fa9fa3a78ed6b81d9aa190e521 Mon Sep 17 00:00:00 2001
From: Ruidy
Date: Tue, 5 Oct 2021 14:27:24 +0200
Subject: [PATCH 03/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20French=20translation?=
=?UTF-8?q?=20for=20`deployment/docker.md`=20(#3694)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sam Courtemanche
Co-authored-by: Sebastián Ramírez
---
docs/fr/docs/deployment/docker.md | 182 ++++++++++++++++++++++++++++++
docs/fr/mkdocs.yml | 2 +
2 files changed, 184 insertions(+)
create mode 100644 docs/fr/docs/deployment/docker.md
diff --git a/docs/fr/docs/deployment/docker.md b/docs/fr/docs/deployment/docker.md
new file mode 100644
index 000000000..e4b59afbf
--- /dev/null
+++ b/docs/fr/docs/deployment/docker.md
@@ -0,0 +1,182 @@
+# Déployer avec Docker
+
+Dans cette section, vous verrez des instructions et des liens vers des guides pour savoir comment :
+
+* Faire de votre application **FastAPI** une image/conteneur Docker avec une performance maximale. En environ **5 min**.
+* (Optionnellement) comprendre ce que vous, en tant que développeur, devez savoir sur HTTPS.
+* Configurer un cluster en mode Docker Swarm avec HTTPS automatique, même sur un simple serveur à 5 dollars US/mois. En environ **20 min**.
+* Générer et déployer une application **FastAPI** complète, en utilisant votre cluster Docker Swarm, avec HTTPS, etc. En environ **10 min**.
+
+Vous pouvez utiliser **Docker** pour le déploiement. Il présente plusieurs avantages comme la sécurité, la réplicabilité, la simplicité de développement, etc.
+
+Si vous utilisez Docker, vous pouvez utiliser l'image Docker officielle :
+
+## tiangolo/uvicorn-gunicorn-fastapi
+
+Cette image est dotée d'un mécanisme d'"auto-tuning", de sorte qu'il vous suffit d'ajouter votre code pour obtenir automatiquement des performances très élevées. Et sans faire de sacrifices.
+
+Mais vous pouvez toujours changer et mettre à jour toutes les configurations avec des variables d'environnement ou des fichiers de configuration.
+
+!!! tip "Astuce"
+ Pour voir toutes les configurations et options, rendez-vous sur la page de l'image Docker : tiangolo/uvicorn-gunicorn-fastapi.
+
+## Créer un `Dockerfile`
+
+* Allez dans le répertoire de votre projet.
+* Créez un `Dockerfile` avec :
+
+```Dockerfile
+FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
+
+COPY ./app /app
+```
+
+### Applications plus larges
+
+Si vous avez suivi la section sur la création d' [Applications avec plusieurs fichiers](../tutorial/bigger-applications.md){.internal-link target=_blank}, votre `Dockerfile` pourrait ressembler à ceci :
+
+```Dockerfile
+FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
+
+COPY ./app /app/app
+```
+
+### Raspberry Pi et autres architectures
+
+Si vous utilisez Docker sur un Raspberry Pi (qui a un processeur ARM) ou toute autre architecture, vous pouvez créer un `Dockerfile` à partir de zéro, basé sur une image de base Python (qui est multi-architecture) et utiliser Uvicorn seul.
+
+Dans ce cas, votre `Dockerfile` pourrait ressembler à ceci :
+
+```Dockerfile
+FROM python:3.7
+
+RUN pip install fastapi uvicorn
+
+EXPOSE 80
+
+COPY ./app /app
+
+CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
+```
+
+## Créer le code **FastAPI**.
+
+* Créer un répertoire `app` et y entrer.
+* Créez un fichier `main.py` avec :
+
+```Python
+from typing import Optional
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Optional[str] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+* Vous devriez maintenant avoir une structure de répertoire telle que :
+
+```
+.
+├── app
+│ └── main.py
+└── Dockerfile
+```
+
+## Construire l'image Docker
+
+* Allez dans le répertoire du projet (dans lequel se trouve votre `Dockerfile`, contenant votre répertoire `app`).
+* Construisez votre image FastAPI :
+
+
+
+Vous disposez maintenant d'un serveur FastAPI optimisé dans un conteneur Docker. Configuré automatiquement pour votre
+serveur actuel (et le nombre de cœurs du CPU).
+
+## Vérifier
+
+Vous devriez pouvoir accéder à votre application via l'URL de votre conteneur Docker, par exemple : http://192.168.99.100/items/5?q=somequery ou http://127.0.0.1/items/5?q=somequery (ou équivalent, en utilisant votre hôte Docker).
+
+Vous verrez quelque chose comme :
+
+```JSON
+{"item_id": 5, "q": "somequery"}
+```
+
+## Documentation interactive de l'API
+
+Vous pouvez maintenant visiter http://192.168.99.100/docs ou http://127.0.0.1/docs (ou équivalent, en utilisant votre hôte Docker).
+
+Vous verrez la documentation interactive automatique de l'API (fournie par Swagger UI) :
+
+
+
+## Documentation de l'API alternative
+
+Et vous pouvez également aller sur http://192.168.99.100/redoc ou http://127.0.0.1/redoc (ou équivalent, en utilisant votre hôte Docker).
+
+Vous verrez la documentation automatique alternative (fournie par ReDoc) :
+
+
+
+## Traefik
+
+Traefik est un reverse proxy/load balancer
+haute performance. Il peut faire office de "Proxy de terminaison TLS" (entre autres fonctionnalités).
+
+Il est intégré à Let's Encrypt. Ainsi, il peut gérer toutes les parties HTTPS, y compris l'acquisition et le renouvellement des certificats.
+
+Il est également intégré à Docker. Ainsi, vous pouvez déclarer vos domaines dans les configurations de chaque application et faire en sorte qu'elles lisent ces configurations, génèrent les certificats HTTPS et servent via HTTPS à votre application automatiquement, sans nécessiter aucune modification de leurs configurations.
+
+---
+
+Avec ces informations et ces outils, passez à la section suivante pour tout combiner.
+
+## Cluster en mode Docker Swarm avec Traefik et HTTPS
+
+Vous pouvez avoir un cluster en mode Docker Swarm configuré en quelques minutes (environ 20 min) avec un processus Traefik principal gérant HTTPS (y compris l'acquisition et le renouvellement des certificats).
+
+En utilisant le mode Docker Swarm, vous pouvez commencer par un "cluster" d'une seule machine (il peut même s'agir
+d'un serveur à 5 USD/mois) et ensuite vous pouvez vous développer autant que vous le souhaitez en ajoutant d'autres serveurs.
+
+Pour configurer un cluster en mode Docker Swarm avec Traefik et la gestion de HTTPS, suivez ce guide :
+
+### Docker Swarm Mode et Traefik pour un cluster HTTPS
+
+### Déployer une application FastAPI
+
+La façon la plus simple de tout mettre en place, serait d'utiliser les [**Générateurs de projet FastAPI**](../project-generation.md){.internal-link target=_blank}.
+
+Le génerateur de projet adéquat est conçu pour être intégré à ce cluster Docker Swarm avec Traefik et HTTPS décrit ci-dessus.
+
+Vous pouvez générer un projet en 2 min environ.
+
+Le projet généré a des instructions pour le déployer et le faire prend 2 min de plus.
diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml
index 4891a29ca..c1fb0f23d 100644
--- a/docs/fr/mkdocs.yml
+++ b/docs/fr/mkdocs.yml
@@ -60,6 +60,8 @@ nav:
- Tutoriel - Guide utilisateur:
- tutorial/background-tasks.md
- async.md
+- Déploiement:
+ - deployment/docker.md
- project-generation.md
- alternatives.md
- external-links.md
From 68c43eb12677edf8b2863216f710d6f1d44031f7 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 5 Oct 2021 12:28:05 +0000
Subject: [PATCH 04/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 849303bbf..9564600a3 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add French translation for `deployment/docker.md`. PR [#3694](https://github.com/tiangolo/fastapi/pull/3694) by [@rjNemo](https://github.com/rjNemo).
* 🌐 Add Portuguese translation for `docs/tutorial/path-params.md`. PR [#3664](https://github.com/tiangolo/fastapi/pull/3664) by [@FelipeSilva93](https://github.com/FelipeSilva93).
* 🌐 Add Portuguese translation for `docs/deployment/https.md`. PR [#3754](https://github.com/tiangolo/fastapi/pull/3754) by [@lsglucas](https://github.com/lsglucas).
* ✨ Update GitHub Action: notify-translations, to avoid a race conditon. PR [#3989](https://github.com/tiangolo/fastapi/pull/3989) by [@tiangolo](https://github.com/tiangolo).
From 0eb27ab4d033ef409aa359cfba8c8552e05b9eb6 Mon Sep 17 00:00:00 2001
From: Sam Courtemanche
Date: Tue, 5 Oct 2021 14:30:41 +0200
Subject: [PATCH 05/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20French=20translation?=
=?UTF-8?q?=20for=20`docs/tutorial/body.md`=20(#3671)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián Ramírez
---
docs/fr/docs/tutorial/body.md | 165 ++++++++++++++++++++++++++++++++++
docs/fr/mkdocs.yml | 1 +
2 files changed, 166 insertions(+)
create mode 100644 docs/fr/docs/tutorial/body.md
diff --git a/docs/fr/docs/tutorial/body.md b/docs/fr/docs/tutorial/body.md
new file mode 100644
index 000000000..c0953f49f
--- /dev/null
+++ b/docs/fr/docs/tutorial/body.md
@@ -0,0 +1,165 @@
+# Corps de la requête
+
+Quand vous avez besoin d'envoyer de la donnée depuis un client (comme un navigateur) vers votre API, vous l'envoyez en tant que **corps de requête**.
+
+Le corps d'une **requête** est de la donnée envoyée par le client à votre API. Le corps d'une **réponse** est la donnée envoyée par votre API au client.
+
+Votre API aura presque toujours à envoyer un corps de **réponse**. Mais un client n'a pas toujours à envoyer un corps de **requête**.
+
+Pour déclarer un corps de **requête**, on utilise les modèles de Pydantic en profitant de tous leurs avantages et fonctionnalités.
+
+!!! info
+ Pour envoyer de la donnée, vous devriez utiliser : `POST` (le plus populaire), `PUT`, `DELETE` ou `PATCH`.
+
+ Envoyer un corps dans une requête `GET` a un comportement non défini dans les spécifications, cela est néanmoins supporté par **FastAPI**, seulement pour des cas d'utilisation très complexes/extrêmes.
+
+ Ceci étant découragé, la documentation interactive générée par Swagger UI ne montrera pas de documentation pour le corps d'une requête `GET`, et les proxys intermédiaires risquent de ne pas le supporter.
+
+## Importez le `BaseModel` de Pydantic
+
+Commencez par importer la classe `BaseModel` du module `pydantic` :
+
+```Python hl_lines="4"
+{!../../../docs_src/body/tutorial001.py!}
+```
+
+## Créez votre modèle de données
+
+Déclarez ensuite votre modèle de données en tant que classe qui hérite de `BaseModel`.
+
+Utilisez les types Python standard pour tous les attributs :
+
+```Python hl_lines="7-11"
+{!../../../docs_src/body/tutorial001.py!}
+```
+
+Tout comme pour la déclaration de paramètres de requête, quand un attribut de modèle a une valeur par défaut, il n'est pas nécessaire. Sinon, cet attribut doit être renseigné dans le corps de la requête. Pour rendre ce champ optionnel simplement, utilisez `None` comme valeur par défaut.
+
+Par exemple, le modèle ci-dessus déclare un "objet" JSON (ou `dict` Python) tel que :
+
+```JSON
+{
+ "name": "Foo",
+ "description": "An optional description",
+ "price": 45.2,
+ "tax": 3.5
+}
+```
+
+...`description` et `tax` étant des attributs optionnels (avec `None` comme valeur par défaut), cet "objet" JSON serait aussi valide :
+
+```JSON
+{
+ "name": "Foo",
+ "price": 45.2
+}
+```
+
+## Déclarez-le comme paramètre
+
+Pour l'ajouter à votre *opération de chemin*, déclarez-le comme vous déclareriez des paramètres de chemin ou de requête :
+
+```Python hl_lines="18"
+{!../../../docs_src/body/tutorial001.py!}
+```
+
+...et déclarez que son type est le modèle que vous avez créé : `Item`.
+
+## Résultats
+
+En utilisant uniquement les déclarations de type Python, **FastAPI** réussit à :
+
+* Lire le contenu de la requête en tant que JSON.
+* Convertir les types correspondants (si nécessaire).
+* Valider la donnée.
+ * Si la donnée est invalide, une erreur propre et claire sera renvoyée, indiquant exactement où était la donnée incorrecte.
+* Passer la donnée reçue dans le paramètre `item`.
+ * Ce paramètre ayant été déclaré dans la fonction comme étant de type `Item`, vous aurez aussi tout le support offert par l'éditeur (auto-complétion, etc.) pour tous les attributs de ce paramètre et les types de ces attributs.
+* Générer des définitions JSON Schema pour votre modèle, qui peuvent être utilisées où vous en avez besoin dans votre projet ensuite.
+* Ces schémas participeront à la constitution du schéma généré OpenAPI, et seront donc utilisés par les documentations automatiquement générées.
+
+## Documentation automatique
+
+Les schémas JSON de vos modèles seront intégrés au schéma OpenAPI global de votre application, et seront donc affichés dans la documentation interactive de l'API :
+
+
+
+Et seront aussi utilisés dans chaque *opération de chemin* de la documentation utilisant ces modèles :
+
+
+
+## Support de l'éditeur
+
+Dans votre éditeur, vous aurez des annotations de types et de l'auto-complétion partout dans votre fonction (ce qui n'aurait pas été le cas si vous aviez utilisé un classique `dict` plutôt qu'un modèle Pydantic) :
+
+
+
+Et vous obtenez aussi de la vérification d'erreur pour les opérations incorrectes de types :
+
+
+
+Ce n'est pas un hasard, ce framework entier a été bati avec ce design comme objectif.
+
+Et cela a été rigoureusement testé durant la phase de design, avant toute implémentation, pour s'assurer que cela fonctionnerait avec tous les éditeurs.
+
+Des changements sur Pydantic ont même été faits pour supporter cela.
+
+Les captures d'écrans précédentes ont été prises sur Visual Studio Code.
+
+Mais vous auriez le même support de l'éditeur avec PyCharm et la majorité des autres éditeurs de code Python.
+
+
+
+!!! tip "Astuce"
+ Si vous utilisez PyCharm comme éditeur, vous pouvez utiliser le Plugin PyCharm.
+
+ Ce qui améliore le support pour les modèles Pydantic avec :
+
+ * de l'auto-complétion
+ * des vérifications de type
+ * du "refactoring" (ou remaniement de code)
+ * de la recherche
+ * de l'inspection
+
+## Utilisez le modèle
+
+Dans la fonction, vous pouvez accéder à tous les attributs de l'objet du modèle directement :
+
+```Python hl_lines="21"
+{!../../../docs_src/body/tutorial002.py!}
+```
+
+## Corps de la requête + paramètres de chemin
+
+Vous pouvez déclarer des paramètres de chemin et un corps de requête pour la même *opération de chemin*.
+
+**FastAPI** est capable de reconnaître que les paramètres de la fonction qui correspondent aux paramètres de chemin doivent être **récupérés depuis le chemin**, et que les paramètres de fonctions déclarés comme modèles Pydantic devraient être **récupérés depuis le corps de la requête**.
+
+```Python hl_lines="17-18"
+{!../../../docs_src/body/tutorial003.py!}
+```
+
+## Corps de la requête + paramètres de chemin et de requête
+
+Vous pouvez aussi déclarer un **corps**, et des paramètres de **chemin** et de **requête** dans la même *opération de chemin*.
+
+**FastAPI** saura reconnaître chacun d'entre eux et récupérer la bonne donnée au bon endroit.
+
+```Python hl_lines="18"
+{!../../../docs_src/body/tutorial004.py!}
+```
+
+Les paramètres de la fonction seront reconnus comme tel :
+
+* Si le paramètre est aussi déclaré dans le **chemin**, il sera utilisé comme paramètre de chemin.
+* Si le paramètre est d'un **type singulier** (comme `int`, `float`, `str`, `bool`, etc.), il sera interprété comme un paramètre de **requête**.
+* Si le paramètre est déclaré comme ayant pour type un **modèle Pydantic**, il sera interprété comme faisant partie du **corps** de la requête.
+
+!!! note
+ **FastAPI** saura que la valeur de `q` n'est pas requise grâce à la valeur par défaut `=None`.
+
+ Le type `Optional` dans `Optional[str]` n'est pas utilisé par **FastAPI**, mais sera utile à votre éditeur pour améliorer le support offert par ce dernier et détecter plus facilement des erreurs de type.
+
+## Sans Pydantic
+
+Si vous ne voulez pas utiliser des modèles Pydantic, vous pouvez aussi utiliser des paramètres de **Corps**. Pour cela, allez voir la partie de la documentation sur [Corps de la requête - Paramètres multiples](body-multiple-params.md){.internal-link target=_blank}.
\ No newline at end of file
diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml
index c1fb0f23d..018c2bd30 100644
--- a/docs/fr/mkdocs.yml
+++ b/docs/fr/mkdocs.yml
@@ -58,6 +58,7 @@ nav:
- fastapi-people.md
- python-types.md
- Tutoriel - Guide utilisateur:
+ - tutorial/body.md
- tutorial/background-tasks.md
- async.md
- Déploiement:
From bc99d2b7b82764eeb0c74da4b89f7d0c8e2590b1 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 5 Oct 2021 12:31:22 +0000
Subject: [PATCH 06/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 9564600a3..553fe0be6 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add French translation for `docs/tutorial/body.md`. PR [#3671](https://github.com/tiangolo/fastapi/pull/3671) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `deployment/docker.md`. PR [#3694](https://github.com/tiangolo/fastapi/pull/3694) by [@rjNemo](https://github.com/rjNemo).
* 🌐 Add Portuguese translation for `docs/tutorial/path-params.md`. PR [#3664](https://github.com/tiangolo/fastapi/pull/3664) by [@FelipeSilva93](https://github.com/FelipeSilva93).
* 🌐 Add Portuguese translation for `docs/deployment/https.md`. PR [#3754](https://github.com/tiangolo/fastapi/pull/3754) by [@lsglucas](https://github.com/lsglucas).
From 5fbf597cd5599fd0f578476129e1f861b8223f49 Mon Sep 17 00:00:00 2001
From: Yagiz Degirmenci <62724709+ycd@users.noreply.github.com>
Date: Tue, 5 Oct 2021 15:46:11 +0300
Subject: [PATCH 07/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translatio?=
=?UTF-8?q?n=20for=20`docs/index.md`=20(#1908)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián Ramírez
---
docs/tr/docs/index.md | 310 ++++++++++++++++++++++--------------------
1 file changed, 159 insertions(+), 151 deletions(-)
diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md
index 282e2b603..88660f7eb 100644
--- a/docs/tr/docs/index.md
+++ b/docs/tr/docs/index.md
@@ -6,7 +6,7 @@
- FastAPI framework, high performance, easy to learn, fast to code, ready for production
+ FastAPI framework, yüksek performanslı, öğrenmesi kolay, geliştirmesi hızlı, kullanıma sunulmaya hazır.
@@ -22,27 +22,27 @@
---
-**Documentation**: https://fastapi.tiangolo.com
+**dokümantasyon**: https://fastapi.tiangolo.com
-**Source Code**: https://github.com/tiangolo/fastapi
+**Kaynak kodu**: https://github.com/tiangolo/fastapi
---
-FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
+FastAPI, Python 3.6+'nın standart type hintlerine dayanan modern ve hızlı (yüksek performanslı) API'lar oluşturmak için kullanılabilecek web framework'ü.
-The key features are:
+Ana özellikleri:
-* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance).
+* **Hızlı**: çok yüksek performanslı, **NodeJS** ve **Go** ile eşdeğer seviyede performans sağlıyor, (Starlette ve Pydantic sayesinde.) [Python'un en hızlı frameworklerinden bir tanesi.](#performans).
+* **Kodlaması hızlı**: Yeni özellikler geliştirmek neredeyse %200 - %300 daha hızlı. *
+* **Daha az bug**: Geliştirici (insan) kaynaklı hatalar neredeyse %40 azaltıldı. *
+* **Sezgileri güçlü**: Editor (otomatik-tamamlama) desteği harika. Otomatik tamamlama her yerde. Debuglamak ile daha az zaman harcayacaksınız.
+* **Kolay**: Öğrenmesi ve kullanması kolay olacak şekilde. Doküman okumak için harcayacağınız süre azaltıldı.
+* **Kısa**: Kod tekrarını minimuma indirdik. Fonksiyon parametrelerinin tiplerini belirtmede farklı yollar sunarak karşılaşacağınız bug'ları azalttık.
+* **Güçlü**: Otomatik dokümantasyon ile beraber, kullanıma hazır kod yaz.
-* **Fast to code**: Increase the speed to develop features by about 200% to 300%. *
-* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
-* **Intuitive**: Great editor support. Completion everywhere. Less time debugging.
-* **Easy**: Designed to be easy to use and learn. Less time reading docs.
-* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
-* **Robust**: Get production-ready code. With automatic interactive documentation.
-* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.
+* **Standartlar belirli**: Tamamiyle API'ların açık standartlara bağlı ve (tam uyumlululuk içerisinde); OpenAPI (eski adıyla Swagger) ve JSON Schema.
-* estimation based on tests on an internal development team, building production applications.
+* Bahsi geçen rakamsal ifadeler tamamiyle, geliştirme takımının kendi sundukları ürünü geliştirirken yaptıkları testlere dayanmakta.
## Sponsors
@@ -61,64 +61,72 @@ The key features are:
Other sponsors
-## Opinions
+## Görüşler
-"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._"
+
+"_[...] Bugünlerde **FastAPI**'ı çok fazla kullanıyorum [...] Aslına bakarsanız **Microsoft'taki Machine Learning servislerimizin** hepsinde kullanmayı düşünüyorum. FastAPI ile geliştirdiğimiz servislerin bazıları çoktan **Windows**'un ana ürünlerine ve **Office** ürünlerine entegre edilmeye başlandı bile._"
---
-"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_"
+
+"_**FastAPI**'ı **tahminlerimiz**'i sorgulanabilir hale getirmek için **REST** mimarisı ile beraber server üzerinde kullanmaya başladık._"
+
Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - Uber(ref)
---
-"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_"
+
+"_**Netflix** **kriz yönetiminde** orkestrasyon yapabilmek için geliştirdiği yeni framework'ü **Dispatch**'in, açık kaynak versiyonunu paylaşmaktan gurur duyuyor. [**FastAPI** ile yapıldı.]_"
Kevin Glisson, Marc Vilanova, Forest Monsen - Netflix(ref)
---
-"_I’m over the moon excited about **FastAPI**. It’s so fun!_"
+
+"_**FastAPI** için ayın üzerindeymişcesine heyecanlıyım. Çok eğlenceli!_"
+
---
-"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._"
+"_Dürüst olmak gerekirse, geliştirdiğin şey bir çok açıdan çok sağlam ve parlak gözüküyor. Açıkcası benim **Hug**'ı tasarlarken yapmaya çalıştığım şey buydu - bunu birisinin başardığını görmek gerçekten çok ilham verici._"
-
---
-"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_"
+"_Eğer REST API geliştirmek için **modern bir framework** öğrenme arayışında isen, **FastAPI**'a bir göz at [...] Hızlı, kullanımı ve öğrenmesi kolay. [...]_"
-"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_"
+"_Biz **API** servislerimizi **FastAPI**'a geçirdik [...] Sizin de beğeneceğinizi düşünüyoruz. [...]_"
-
---
-## **Typer**, the FastAPI of CLIs
+## **Typer**, komut satırı uygulamalarının FastAPI'ı
-If you are building a CLI app to be used in the terminal instead of a web API, check out **Typer**.
+Eğer API yerine komut satırı uygulaması geliştiriyor isen **Typer**'a bir göz at.
-**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀
+**Typer** kısaca FastAPI'ın küçük kız kardeşi. Komut satırı uygulamalarının **FastAPI'ı** olması hedeflendi. ⌨️ 🚀
-## Requirements
+## Gereksinimler
Python 3.6+
-FastAPI stands on the shoulders of giants:
+FastAPI iki devin omuzları üstünde duruyor:
-* Starlette for the web parts.
-* Pydantic for the data parts.
+* Web tarafı için Starlette.
+* Data tarafı için Pydantic.
-## Installation
+## Yükleme
@@ -130,7 +138,7 @@ $ pip install fastapi
-You will also need an ASGI server, for production such as Uvicorn or Hypercorn.
+Uygulamanı kullanılabilir hale getirmek için Uvicorn ya da Hypercorn gibi bir ASGI serverına ihtiyacın olacak.
-## Example
+## Örnek
-### Create it
+### Şimdi dene
-* Create a file `main.py` with:
+* `main.py` adında bir dosya oluştur :
```Python
from typing import Optional
@@ -167,9 +175,9 @@ def read_item(item_id: int, q: Optional[str] = None):
```
-Or use async def...
+Ya da async def...
-If your code uses `async` / `await`, use `async def`:
+Eğer kodunda `async` / `await` var ise, `async def` kullan:
```Python hl_lines="9 14"
from typing import Optional
@@ -189,15 +197,15 @@ async def read_item(item_id: int, q: Optional[str] = None):
return {"item_id": item_id, "q": q}
```
-**Note**:
+**Not**:
-If you don't know, check the _"In a hurry?"_ section about `async` and `await` in the docs.
+Eğer ne olduğunu bilmiyor isen _"Acelen mi var?"_ kısmını oku `async` ve `await`.
-### Run it
+### Çalıştır
-Run the server with:
+Serverı aşağıdaki komut ile çalıştır:
-About the command uvicorn main:app --reload...
+Çalıştırdığımız uvicorn main:app --reload hakkında...
-The command `uvicorn main:app` refers to:
+`uvicorn main:app` şunları ifade ediyor:
-* `main`: the file `main.py` (the Python "module").
-* `app`: the object created inside of `main.py` with the line `app = FastAPI()`.
-* `--reload`: make the server restart after code changes. Only do this for development.
+* `main`: dosya olan `main.py` (yani Python "modülü").
+* `app`: ise `main.py` dosyasının içerisinde oluşturduğumuz `app = FastAPI()` 'a denk geliyor.
+* `--reload`: ise kodda herhangi bir değişiklik yaptığımızda serverın yapılan değişiklerileri algılayıp, değişiklikleri siz herhangi bir şey yapmadan uygulamasını sağlıyor.
-### Check it
+### Dokümantasyonu kontrol et
-Open your browser at http://127.0.0.1:8000/items/5?q=somequery.
+Browserını aç ve şu linke git http://127.0.0.1:8000/items/5?q=somequery.
-You will see the JSON response as:
+Bir JSON yanıtı göreceksin:
```JSON
{"item_id": 5, "q": "somequery"}
```
-You already created an API that:
+Az önce oluşturduğun API:
-* Receives HTTP requests in the _paths_ `/` and `/items/{item_id}`.
-* Both _paths_ take `GET` operations (also known as HTTP _methods_).
-* The _path_ `/items/{item_id}` has a _path parameter_ `item_id` that should be an `int`.
-* The _path_ `/items/{item_id}` has an optional `str` _query parameter_ `q`.
+* `/` ve `/items/{item_id}` adreslerine HTTP talebi alabilir hale geldi.
+* İki _adresde_ `GET` operasyonlarını (HTTP _metodları_ olarakta bilinen) yapabilir hale geldi.
+* `/items/{item_id}` _adresi_ ayrıca bir `item_id` _adres parametresine_ sahip ve bu bir `int` olmak zorunda.
+* `/items/{item_id}` _adresi_ opsiyonel bir `str` _sorgu paramtersine_ sahip bu da `q`.
-### Interactive API docs
+### İnteraktif API dokümantasyonu
-Now go to http://127.0.0.1:8000/docs.
+Şimdi http://127.0.0.1:8000/docs adresine git.
-You will see the automatic interactive API documentation (provided by Swagger UI):
+Senin için otomatik oluşturulmuş(Swagger UI tarafından sağlanan) interaktif bir API dokümanı göreceksin:

-### Alternative API docs
+### Alternatif API dokümantasyonu
-And now, go to http://127.0.0.1:8000/redoc.
+Şimdi http://127.0.0.1:8000/redoc adresine git.
-You will see the alternative automatic documentation (provided by ReDoc):
+Senin için alternatif olarak (ReDoc tarafından sağlanan) bir API dokümantasyonu daha göreceksin:

-## Example upgrade
+## Örnek bir değişiklik
-Now modify the file `main.py` to receive a body from a `PUT` request.
+Şimdi `main.py` dosyasını değiştirelim ve body ile `PUT` talebi alabilir hale getirelim.
-Declare the body using standard Python types, thanks to Pydantic.
+Şimdi Pydantic sayesinde, Python'un standart tiplerini kullanarak bir body tanımlayacağız.
```Python hl_lines="4 9 10 11 12 25 26 27"
from typing import Optional
@@ -293,175 +301,175 @@ def update_item(item_id: int, item: Item):
return {"item_name": item.name, "item_id": item_id}
```
-The server should reload automatically (because you added `--reload` to the `uvicorn` command above).
+Server otomatik olarak yeniden başlamalı (çünkü yukarıda `uvicorn`'u çalıştırırken `--reload` parametresini kullandık.).
-### Interactive API docs upgrade
+### İnteraktif API dokümantasyonu'nda değiştirme yapmak
-Now go to http://127.0.0.1:8000/docs.
+Şimdi http://127.0.0.1:8000/docs bağlantısına tekrar git.
-* The interactive API documentation will be automatically updated, including the new body:
+* İnteraktif API dokümantasyonu, yeni body ile beraber çoktan yenilenmiş olması lazım:

-* Click on the button "Try it out", it allows you to fill the parameters and directly interact with the API:
+* "Try it out"a tıkla, bu senin API parametleri üzerinde deneme yapabilmene izin veriyor:

-* Then click on the "Execute" button, the user interface will communicate with your API, send the parameters, get the results and show them on the screen:
+* Şimdi "Execute" butonuna tıkla, kullanıcı arayüzü otomatik olarak API'ın ile bağlantı kurarak ona bu parametreleri gönderecek ve sonucu karşına getirecek.

-### Alternative API docs upgrade
+### Alternatif API dokümantasyonunda değiştirmek
-And now, go to http://127.0.0.1:8000/redoc.
+Şimdi ise http://127.0.0.1:8000/redoc adresine git.
-* The alternative documentation will also reflect the new query parameter and body:
+* Alternatif dokümantasyonda koddaki değişimler ile beraber kendini yeni query ve body ile güncelledi.

-### Recap
+### Özet
-In summary, you declare **once** the types of parameters, body, etc. as function parameters.
+Özetleyecek olursak, URL, sorgu veya request body'deki parametrelerini fonksiyon parametresi olarak kullanıyorsun. Bu parametrelerin veri tiplerini bir kere belirtmen yeterli.
-You do that with standard modern Python types.
+Type-hinting işlemini Python dilindeki standart veri tipleri ile yapabilirsin
-You don't have to learn a new syntax, the methods or classes of a specific library, etc.
+Yeni bir syntax'e alışmana gerek yok, metodlar ve classlar zaten spesifik kütüphanelere ait.
-Just standard **Python 3.6+**.
+Sadece standart **Python 3.6+**.
-For example, for an `int`:
+Örnek olarak, `int` tanımlamak için:
```Python
item_id: int
```
-or for a more complex `Item` model:
+ya da daha kompleks `Item` tipi:
```Python
item: Item
```
-...and with that single declaration you get:
+...sadece kısa bir parametre tipi belirtmekle beraber, sahip olacakların:
-* Editor support, including:
- * Completion.
- * Type checks.
-* Validation of data:
- * Automatic and clear errors when the data is invalid.
- * Validation even for deeply nested JSON objects.
-* Conversion of input data: coming from the network to Python data and types. Reading from:
+* Editör desteği dahil olmak üzere:
+ * Otomatik tamamlama.
+ * Tip sorguları.
+* Datanın tipe uyumunun sorgulanması:
+ * Eğer data geçersiz ise, otomatik olarak hataları ayıklar.
+ * Çok derin JSON objelerinde bile veri tipi sorgusu yapar.
+* Gelen verinin dönüşümünü aşağıdaki veri tiplerini kullanarak gerçekleştirebiliyor.
* JSON.
- * Path parameters.
- * Query parameters.
+ * Path parametreleri.
+ * Query parametreleri.
* Cookies.
* Headers.
* Forms.
* Files.
-* Conversion of output data: converting from Python data and types to network data (as JSON):
- * Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).
- * `datetime` objects.
- * `UUID` objects.
- * Database models.
- * ...and many more.
-* Automatic interactive API documentation, including 2 alternative user interfaces:
+* Giden verinin dönüşümünü aşağıdaki veri tiplerini kullanarak gerçekleştirebiliyor (JSON olarak):
+ * Python tiplerinin (`str`, `int`, `float`, `bool`, `list`, vs) çevirisi.
+ * `datetime` objesi.
+ * `UUID` objesi.
+ * Veritabanı modelleri.
+ * ve daha fazlası...
+* 2 alternatif kullanıcı arayüzü dahil olmak üzere, otomatik interaktif API dokümanu:
* Swagger UI.
* ReDoc.
---
-Coming back to the previous code example, **FastAPI** will:
+Az önceki kod örneğine geri dönelim, **FastAPI**'ın yapacaklarına bir bakış atalım:
-* Validate that there is an `item_id` in the path for `GET` and `PUT` requests.
-* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests.
- * If it is not, the client will see a useful, clear error.
-* Check if there is an optional query parameter named `q` (as in `http://127.0.0.1:8000/items/foo?q=somequery`) for `GET` requests.
- * As the `q` parameter is declared with `= None`, it is optional.
- * Without the `None` it would be required (as is the body in the case with `PUT`).
-* For `PUT` requests to `/items/{item_id}`, Read the body as JSON:
- * Check that it has a required attribute `name` that should be a `str`.
- * Check that it has a required attribute `price` that has to be a `float`.
- * Check that it has an optional attribute `is_offer`, that should be a `bool`, if present.
- * All this would also work for deeply nested JSON objects.
-* Convert from and to JSON automatically.
-* Document everything with OpenAPI, that can be used by:
- * Interactive documentation systems.
- * Automatic client code generation systems, for many languages.
-* Provide 2 interactive documentation web interfaces directly.
+* `item_id`'nin `GET` ve `PUT` talepleri içinde olup olmadığının doğruluğunu kontol edecek.
+* `item_id`'nin tipinin `int` olduğunu `GET` ve `PUT` talepleri içinde olup olmadığının doğruluğunu kontol edecek.
+ * Eğer `GET` ve `PUT` içinde yok ise ve `int` değil ise, sebebini belirten bir hata mesajı gösterecek
+* Opsiyonel bir `q` parametresinin `GET` talebi için (`http://127.0.0.1:8000/items/foo?q=somequery` içinde) olup olmadığını kontrol edecek
+ * `q` parametresini `= None` ile oluşturduğumuz için, opsiyonel bir parametre olacak.
+ * Eğer `None` olmasa zorunlu bir parametre olacak idi (bu yüzden body'de `PUT` parametresi var).
+* `PUT` talebi için `/items/{item_id}`'nin body'sini, JSON olarak okuyor:
+ * `name` adında bir parametetre olup olmadığını ve var ise onun `str` olup olmadığını kontol ediyor.
+ * `price` adında bir parametetre olup olmadığını ve var ise onun `float` olup olmadığını kontol ediyor.
+ * `is_offer` adında bir parametetre olup olmadığını ve var ise onun `bool` olup olmadığını kontol ediyor.
+ * Bunların hepsini en derin JSON modellerinde bile yapacaktır.
+* Bütün veri tiplerini otomatik olarak JSON'a çeviriyor veya tam tersi.
+* Her şeyi dokümanlayıp, çeşitli yerlerde:
+ * İnteraktif dokümantasyon sistemleri.
+ * Otomatik alıcı kodu üretim sistemlerinde ve çeşitli dillerde.
+* İki ayrı web arayüzüyle direkt olarak interaktif bir dokümantasyon sunuyor.
---
-We just scratched the surface, but you already get the idea of how it all works.
+Henüz yüzeysel bir bakış attık, fakat sen çoktan çalışma mantığını anladın.
-Try changing the line with:
+Şimdi aşağıdaki satırı değiştirmeyi dene:
```Python
return {"item_name": item.name, "item_id": item_id}
```
-...from:
+...bundan:
```Python
... "item_name": item.name ...
```
-...to:
+...buna:
```Python
... "item_price": item.price ...
```
-...and see how your editor will auto-complete the attributes and know their types:
+...şimdi editör desteğinin nasıl veri tiplerini bildiğini ve otomatik tamamladığını gör:

-For a more complete example including more features, see the Tutorial - User Guide.
+Daha fazla örnek ve özellik için Tutorial - User Guide sayfasını git.
-**Spoiler alert**: the tutorial - user guide includes:
+**Spoiler**: Öğretici - Kullanıcı rehberi şunları içeriyor:
-* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
-* How to set **validation constraints** as `maximum_length` or `regex`.
-* A very powerful and easy to use **Dependency Injection** system.
-* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
-* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
-* Many extra features (thanks to Starlette) as:
+* **Parameterlerini** nasıl **headers**, **cookies**, **form fields** ve **files** olarak deklare edebileceğini.
+* `maximum_length` ya da `regex` gibi şeylerle nasıl **doğrulama** yapabileceğini.
+* Çok güçlü ve kullanımı kolay **Zorunluluk Entegrasyonu** oluşturmayı.
+* Güvenlik ve kimlik doğrulama, **JWT tokenleri**'yle beraber **OAuth2** desteği, ve **HTTP Basic** doğrulaması.
+* İleri seviye fakat ona göre oldukça basit olan **derince oluşturulmuş JSON modelleri** (Pydantic sayesinde).
+* Diğer ekstra özellikler (Starlette sayesinde):
* **WebSockets**
* **GraphQL**
- * extremely easy tests based on `requests` and `pytest`
+ * `requests` ve `pytest` sayesinde aşırı kolay testler.
* **CORS**
* **Cookie Sessions**
- * ...and more.
+ * ...ve daha fazlası.
-## Performance
+## Performans
-Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as one of the fastest Python frameworks available, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
+Bağımsız TechEmpower kıyaslamaları gösteriyor ki, Uvicorn'la beraber çalışan **FastAPI** uygulamaları Python'un en hızlı frameworklerinden birisi , sadece Starlette ve Uvicorn'dan daha yavaş ki FastAPI bunların üzerine kurulu.
-To understand more about it, see the section Benchmarks.
+Daha fazla bilgi için, bu bölüme bir göz at Benchmarks.
-## Optional Dependencies
+## Opsiyonel gereksinimler
-Used by Pydantic:
+Pydantic tarafında kullanılan:
-* ujson - for faster JSON "parsing".
-* email_validator - for email validation.
+* ujson - daha hızlı JSON "dönüşümü" için.
+* email_validator - email doğrulaması için.
-Used by Starlette:
+Starlette tarafında kullanılan:
-* requests - Required if you want to use the `TestClient`.
-* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`.
-* jinja2 - Required if you want to use the default template configuration.
-* python-multipart - Required if you want to support form "parsing", with `request.form()`.
-* itsdangerous - Required for `SessionMiddleware` support.
-* pyyaml - Required for Starlette's `SchemaGenerator` support (you probably don't need it with FastAPI).
-* graphene - Required for `GraphQLApp` support.
-* ujson - Required if you want to use `UJSONResponse`.
+* requests - Eğer `TestClient` kullanmak istiyorsan gerekli.
+* aiofiles - `FileResponse` ya da `StaticFiles` kullanmak istiyorsan gerekli.
+* jinja2 - Eğer kendine ait template konfigürasyonu oluşturmak istiyorsan gerekli
+* python-multipart - Form kullanmak istiyorsan gerekli ("dönüşümü").
+* itsdangerous - `SessionMiddleware` desteği için gerekli.
+* pyyaml - `SchemaGenerator` desteği için gerekli (Muhtemelen FastAPI kullanırken ihtiyacınız olmaz).
+* graphene - `GraphQLApp` desteği için gerekli.
+* ujson - `UJSONResponse` kullanmak istiyorsan gerekli.
-Used by FastAPI / Starlette:
+Hem FastAPI hem de Starlette tarafından kullanılan:
-* uvicorn - for the server that loads and serves your application.
-* orjson - Required if you want to use `ORJSONResponse`.
+* uvicorn - oluşturduğumuz uygulamayı bir web sunucusuna servis etmek için gerekli
+* orjson - `ORJSONResponse` kullanmak istiyor isen gerekli.
-You can install all of these with `pip install fastapi[all]`.
+Bunların hepsini `pip install fastapi[all]` ile yükleyebilirsin.
-## License
+## Lisans
-This project is licensed under the terms of the MIT license.
+Bu proje, MIT lisansı şartlarına göre lisanslanmıştır.
From c6461ad7dc9d37646a74ff0154cd202922b5e91e Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 5 Oct 2021 12:46:49 +0000
Subject: [PATCH 08/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 553fe0be6..0b1cf1abd 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Turkish translation for `docs/index.md`. PR [#1908](https://github.com/tiangolo/fastapi/pull/1908) by [@ycd](https://github.com/ycd).
* 🌐 Add French translation for `docs/tutorial/body.md`. PR [#3671](https://github.com/tiangolo/fastapi/pull/3671) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `deployment/docker.md`. PR [#3694](https://github.com/tiangolo/fastapi/pull/3694) by [@rjNemo](https://github.com/rjNemo).
* 🌐 Add Portuguese translation for `docs/tutorial/path-params.md`. PR [#3664](https://github.com/tiangolo/fastapi/pull/3664) by [@FelipeSilva93](https://github.com/FelipeSilva93).
From 507e9baf9eb4d5164bea4eb4173c3cabeefc3149 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?H=C3=BCseyin=20Emre=20Arma=C4=9Fan?=
Date: Tue, 5 Oct 2021 15:50:38 +0300
Subject: [PATCH 09/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translatio?=
=?UTF-8?q?n=20for=20`docs/benchmarks.md`=20(#2729)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián Ramírez
---
docs/tr/docs/benchmarks.md | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 docs/tr/docs/benchmarks.md
diff --git a/docs/tr/docs/benchmarks.md b/docs/tr/docs/benchmarks.md
new file mode 100644
index 000000000..1ce3c758f
--- /dev/null
+++ b/docs/tr/docs/benchmarks.md
@@ -0,0 +1,34 @@
+# Kıyaslamalar
+
+Bağımsız TechEmpower kıyaslamaları gösteriyor ki Uvicorn'la beraber çalışan **FastAPI** uygulamaları Python'un en hızlı frameworklerinden birisi , sadece Starlette ve Uvicorn'dan daha düşük sıralamada (FastAPI bu frameworklerin üzerine kurulu). (*)
+
+Fakat kıyaslamaları ve karşılaştırmaları incelerken şunları aklınızda bulundurmalısınız.
+
+## Kıyaslamalar ve hız
+
+Kıyaslamaları incelediğinizde, farklı özelliklere sahip birçok araçların eşdeğer olarak karşılaştırıldığını görmek yaygındır.
+
+Özellikle, Uvicorn, Starlette ve FastAPI'ın birlikte karşılaştırıldığını görmek için (diğer birçok araç arasında).
+
+Araç tarafından çözülen sorun ne kadar basitse, o kadar iyi performans alacaktır. Ve kıyaslamaların çoğu, araç tarafından sağlanan ek özellikleri test etmez.
+
+Hiyerarşi şöyledir:
+
+* **Uvicorn**: bir ASGI sunucusu
+ * **Starlette**: (Uvicorn'u kullanır) bir web microframeworkü
+ * **FastAPI**: (Starlette'i kullanır) data validation vb. ile API'lar oluşturmak için çeşitli ek özelliklere sahip bir API frameworkü
+
+* **Uvicorn**:
+ * Sunucunun kendisi dışında ekstra bir kod içermediği için en iyi performansa sahip olacaktır
+ * Direkt olarak Uvicorn'da bir uygulama yazmazsınız. Bu, en azından Starlette tarafından sağlanan tüm kodu (veya **FastAPI**) az çok içermesi gerektiği anlamına gelir. Ve eğer bunu yaptıysanız, son uygulamanız bir framework kullanmak ve uygulama kodlarını ve bugları en aza indirmekle aynı ek yüke sahip olacaktır.
+ * Eğer Uvicorn'u karşılaştırıyorsanız, Daphne, Hypercorn, uWSGI, vb. uygulama sunucuları ile karşılaştırın.
+* **Starlette**:
+ * Uvicorn'dan sonraki en iyi performansa sahip olacak. Aslında, Starlette çalışmak için Uvicorn'u kullanıyor. Dolayısıyla, muhtemelen daha fazla kod çalıştırmak zorunda kaldığında Uvicorn'dan sadece "daha yavaş" olabilir.
+ * Ancak routing based on paths ile vb. basit web uygulamaları oluşturmak için araçlar sağlar.
+ * Eğer Starlette'i karşılaştırıyorsanız, Sanic, Flask, Django, vb. frameworkler (veya microframeworkler) ile karşılaştırın.
+* **FastAPI**:
+ * Starlette'in Uvicorn'u kullandığı ve ondan daha hızlı olamayacağı gibi, **FastAPI** da Starlette'i kullanır, bu yüzden ondan daha hızlı olamaz.
+ * FastAPI, Starlette'e ek olarak daha fazla özellik sunar. Data validation ve serialization gibi API'lar oluştururken neredeyse ve her zaman ihtiyaç duyduğunuz özellikler. Ve bunu kullanarak, ücretsiz olarak otomatik dokümantasyon elde edersiniz (otomatik dokümantasyon çalışan uygulamalara ek yük getirmez, başlangıçta oluşturulur).
+ * FastAPI'ı kullanmadıysanız ve Starlette'i doğrudan kullandıysanız (veya başka bir araç, Sanic, Flask, Responder, vb.) tüm data validation'ı ve serialization'ı kendiniz sağlamanız gerekir. Dolayısıyla, son uygulamanız FastAPI kullanılarak oluşturulmuş gibi hâlâ aynı ek yüke sahip olacaktır. Çoğu durumda, uygulamalarda yazılan kodun büyük çoğunluğunu data validation ve serialization oluşturur.
+ * Dolayısıyla, FastAPI'ı kullanarak geliştirme süresinden, buglardan, kod satırlarından tasarruf edersiniz ve muhtemelen kullanmasaydınız aynı performansı (veya daha iyisini) elde edersiniz. (hepsini kodunuza uygulamak zorunda kalacağınız gibi)
+ * Eğer FastAPI'ı karşılaştırıyorsanız, Flask-apispec, NestJS, Molten, vb. gibi data validation, serialization ve dokümantasyon sağlayan bir web uygulaması frameworkü ile (veya araç setiyle) karşılaştırın. Entegre otomatik data validation, serialization ve dokümantasyon içeren frameworkler.
From 85f0d2b924389faaf5b0a533d407738481803a51 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 5 Oct 2021 12:51:14 +0000
Subject: [PATCH 10/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 0b1cf1abd..435d54c2d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Turkish translation for `docs/benchmarks.md`. PR [#2729](https://github.com/tiangolo/fastapi/pull/2729) by [@Telomeraz](https://github.com/Telomeraz).
* 🌐 Add Turkish translation for `docs/index.md`. PR [#1908](https://github.com/tiangolo/fastapi/pull/1908) by [@ycd](https://github.com/ycd).
* 🌐 Add French translation for `docs/tutorial/body.md`. PR [#3671](https://github.com/tiangolo/fastapi/pull/3671) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `deployment/docker.md`. PR [#3694](https://github.com/tiangolo/fastapi/pull/3694) by [@rjNemo](https://github.com/rjNemo).
From 63744b2e8a14e07faa64e6442b0ea6d3298101a6 Mon Sep 17 00:00:00 2001
From: Yagiz Degirmenci <62724709+ycd@users.noreply.github.com>
Date: Tue, 5 Oct 2021 16:01:50 +0300
Subject: [PATCH 11/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translatio?=
=?UTF-8?q?n=20for=20`docs/features.md`=20(#1950)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián Ramírez
---
docs/tr/docs/features.md | 209 +++++++++++++++++++++++++++++++++++++++
docs/tr/mkdocs.yml | 1 +
2 files changed, 210 insertions(+)
create mode 100644 docs/tr/docs/features.md
diff --git a/docs/tr/docs/features.md b/docs/tr/docs/features.md
new file mode 100644
index 000000000..c06c27c16
--- /dev/null
+++ b/docs/tr/docs/features.md
@@ -0,0 +1,209 @@
+# Özelikler
+
+## FastAPI özellikleri
+
+**FastAPI** sana bunları sağlıyor
+
+### Açık standartları temel alır
+
+* API oluşturma işlemlerinde OpenAPI buna path operasyonları parametreleri, body talebi, güvenlik gibi şeyler dahil olmak üzere deklare bunların deklare edilmesi.
+* Otomatik olarak data modelinin JSON Schema ile beraber dokümante edilmesi (OpenAPI'n kendisi zaten JSON Schema'ya dayanıyor).
+* Titiz bir çalışmanın sonucunda yukarıdaki standartlara uygun bir framework oluşturduk. Standartları pastanın üzerine sonradan eklenmiş bir çilek olarak görmedik.
+* Ayrıca bu bir çok dilde kullanılabilecek **client code generator** kullanımına da izin veriyor.
+
+### Otomatik dokümantasyon
+
+
+OpenAPI standartlarına dayalı olan bir framework olarak, geliştiricilerin birden çok seçeneği var, varsayılan olarak gelen 2 farklı interaktif API dokümantasyonu ve web kullanıcı arayüzü var.
+
+
+* Swagger UI interaktif olarak API'ınızı tarayıcı üzerinden çağırıp test edebilmenize olanak sağlıyor.
+
+
+
+* ReDoc ile beraber alternatif API dokümantasyonu.
+
+
+
+### Sadece modern Python
+
+Tamamiyle standartlar **Python 3.6**'nın type hintlerine dayanıyor (Pydantic'in sayesinde). Yeni bir syntax öğrenmene gerek yok. Sadece modern Python.
+
+
+Eğer Python type hintlerini bilmiyorsan veya bir hatırlatmaya ihtiyacın var ise(FastAPI kullanmasan bile) şu iki dakikalık küçük bilgilendirici içeriğe bir göz at: [Python Types](python-types.md){.internal-link target=_blank}.
+
+Standart Python'u typelarını belirterek yazıyorsun:
+
+```Python
+from typing import List, Dict
+from datetime import date
+
+from pydantic import BaseModel
+
+# Değişkeni str olarak belirt
+# ve o fonksiyon için harika bir editör desteği al
+def main(user_id: str):
+ return user_id
+
+
+# Pydantic modeli
+class User(BaseModel):
+ id: int
+ name: str
+ joined: date
+```
+
+Sonrasında bu şekilde kullanabilirsin
+
+```Python
+my_user: User = User(id=3, name="John Doe", joined="2018-07-19")
+
+second_user_data = {
+ "id": 4,
+ "name": "Mary",
+ "joined": "2018-11-30",
+}
+
+my_second_user: User = User(**second_user_data)
+```
+
+!!! info
+ `**second_user_data` şu anlama geliyor:
+
+ Key-Value çiftini direkt olarak `second_user_data` dictionarysine kaydet , yaptığın şey buna eşit olacak: `User(id=4, name="Mary", joined="2018-11-30")`
+
+### Editor desteği
+
+Bütün framework kullanılması kolay ve sezgileri güçlü olması için tasarlandı, verilen bütün kararlar geliştiricilere en iyi geliştirme deneyimini yaşatmak üzere, bir çok editör üzerinde test edildi.
+
+Son yapılan Python geliştiricileri anketinde, açık ara en çok kullanılan özellik "oto-tamamlama" idi..
+
+Bütün **FastAPI** frameworkü oto-tamamlama açısından geliştiriciyi tatmin etmek üzerine tasarlandı. Otomatik tamamlama her yerde çalışıyor.
+
+Dokümantasyona tekrardan çok nadir olarak geleceksin.
+
+Editörün sana nasıl yardım ettiğine bir bak:
+
+* Visual Studio Code ile:
+
+
+
+* PyCharm ile:
+
+
+
+
+Daha önceden düşünüp en imkansız diyebileceğin durumlarda bile otomatik tamamlama alacaksın, örnek olarak `price` JSON body içerisinde (nested bir JSON body de olabilirdi.) direkt olarak istekten geliyor, bu durumda bile oto-tammalama sağlıyor.
+
+Artık key isimlerini yanlış yazma, dokümantasyona dönüp deliler gibi yukarı aşağı sayfada gezmek ve en sonunda `username` mi yoksa `user_name` mi kullandım gibi sorular yok.
+
+### Kısa
+
+Her şey için mantıklı bir **varsayılanı** var. Parametrelerini opsiyonel olarak tanımlayıp API'nı istediğin gibi modifiye edebilirsin.
+
+Hepsi varsayılan olarak **çalışıyor**.
+
+
+### Doğrulama
+
+* Neredeyse bütün (ya da hepsi?) Python **data typeları** için doğrulama, kapsadıkları:
+ * JSON objeleri (`dict`).
+ * JSON array (`list`) item type'ı belirtirken.
+ * String (`str`) parametresi, minimum ve maksimum uzunluk gibi sınırlandırmalar yaparken.
+ * Numaralar (`int`, `float`) maksimum ve minimum gibi sınırlandırmalar yaparken.
+
+* Bunlar gibi en egzotik typelarla bile doğrulama yapabiliyorsunuz.:
+ * URL.
+ * Email.
+ * UUID.
+ * ...ve diğerleri.
+
+Bütün doğrulama olayları çok güçlü bir kütüphane sayesinde yapılıyor, **Pydantic**.
+
+### Güvenlik ve kimlik doğrulama
+
+Güvenlik ve doğrulama database ve data modellerinden taviz vermeden entegre edilebilir durumda.
+
+Bütün güvenlik şemaları OpenAPI'da tanımlanmış durumda, kapsadıkları:
+
+* HTTP Basic.
+* **OAuth2** (ve **JWT tokenleriyle** beraber). Bu öğretici içeriğe göz atabilirsin [OAuth2 with JWT](tutorial/security/oauth2-jwt.md){.internal-link target=_blank}.
+* API anahtarları:
+ * Headerlar.
+ * Query parametreleri.
+ * Cookies, vs.
+
+Bütün güvenlik özellikleri Starlette'den geliyor (**session cookies'de** dahil olmak üzere).
+
+Bütün hepsi tekrardan kullanılabilir aletler ve bileşenler olarak, kolayca sistemlerinize, data depolarınıza, ilişkisel ve NoSQL databaselerinize entegre edebileceğiniz şekilde yapıldı.
+
+### Dependency injection
+
+FastAPI'ın inanılmaz derecede kullanımı kolay, fakat inanılmaz derecede güçlü Dependency Injection sistemi var.
+
+* Dependencylerin bile dependencies'i olabiliyor, FastAPI bunun için **graph of "dependency"** yaratıyor.
+* Hepsi **otomatik olarak** FastAPI tarafından hallediliyor.
+* Bütün zorunlulukların gelen datalara bağlı olarak farklı gereksinimleri olabiliyor, ilave path operasyonlarının kısıtlamaları ve otomatik dokümantasyonu da ayrıca yapılıyor .
+* Path operasyonu parametreleri içerisinde belirtilen gereksinimler için bile **Otomatik doğrulama** yapılabiliyor.
+* Kompleks kimlik doğrulama sistemleri için destek, **database bağlantıları**, vs.
+* **Taviz yok** hiçbir şeyden taviz vermeden, database frontend vs. Bütün hepsinin kolayca entegre edilebiliyor.
+
+### Sınırsız "plug-inler"
+
+Başka bir deyişle, plug-inlere ihtiyacımız yok, import edip direkt olarak kullanmaya başlayabiliriz.
+
+Bütün entegrasyonlar kullanımı kolay olmak üzere (zorunluluklar ile beraber) tasarlandı, sen bir "plug-in" yaratıp 2 satır kod ile, *path operasyonlarında* kullandığımız syntax ve aynı yapı ile koduna entregre edebilirsin.
+
+
+### Test edildi
+
+* 100% test coverage.
+* 100% typeları belirtilmiş codebase.
+* FastAPI ile yapılan bir çok proje insanlar tarafından kullanılıyor.
+
+## Starlette özellikleri
+
+**FastAPI**, Starlette ile tamamiyle uyumlu ve üzerine kurulu. Yani FastAPI üzerine ekleme yapacağınız herhangi bir Starlette kodu da çalışacaktır.
+
+`FastAPI` aslında `Starlette`'nin bir sub-class'ı. Eğer Starlette'nin nasıl kullanılacağını biliyor isen, çoğu işlevini aynı şekilde yapıyor.
+
+**FastAPI** ile beraber **Starlette**'nin bütün özelliklerine de sahip olacaksınız (FastAPI aslında Starlette'nin steroid basmış hali):
+
+* Gerçekten etkileyici bir performansa sahip.Python'un ise en hızlı frameworklerinden bir tanesi, **NodeJS** ve **Go** ile ise eşdeğer performansa sahip..
+* **WebSocket** desteği.
+* **GraphQL** desteği.
+* Kullanım halinde arka plan işlevleri.
+* Başlatma ve kapatma eventleri(startup and shutdown).
+* Test sunucusu `requests` üzerine kurulu.
+* **CORS**, GZip, Static dosyalar, Streaming responseları.
+* **Session and Cookie** desteği.
+* 100% test kapsayıcılığı.
+* 100% typeları belirtilmiş codebase.
+
+## Pydantic özellikleri
+
+**FastAPI** ile Pydantic tamamiyle uyumlu ve üzerine kurulu. Yani FastAPI üzerine ekleme yapacağınız herhangi bir Pydantic kodu da çalışacaktır.
+
+Bunlara Pydantic üzerine kurulu ORM databaseler ve , ODM kütüphaneler de dahil olmak üzere.
+
+Bu ayrıca şu anlama da geliyor, bir çok durumda requestten gelen objeyi **direkt olarak database**'e her şeyi otomatik olarak doğrulanmış bir biçimde aktarabilirisin.
+
+Aynı şekilde, databaseden gelen objeyi de **direkt olarak isteğe** de tamamiyle doğrulanmış bir biçimde gönderebilirsiniz.
+
+**FastAPI** ile beraber **Pydantic**'in bütün özelliklerine sahip olacaksınız (FastAPI data kontrolünü Pydantic'in üzerine kurduğu için):
+
+* **Kafa karıştırmaz**:
+ * Farklı bir syntax öğrenmenize gerek kalmaz,
+ * Eğer Python typelarını nasıl kullanacağını biliyorsan Pydantic kullanmayı da biliyorsundur.
+* Kullandığın geliştirme araçları ile iyi çalışır **IDE/linter/brain**:
+ * Pydantic'in veri yapıları aslında sadece senin tanımladığın classlar; Bu yüzden doğrulanmış dataların ile otomatik tamamlama, linting ve mypy'ı kullanarak sorunsuz bir şekilde çalışabilirsin
+* **Hızlı**:
+ * Benchmarklarda, Pydantic'in diğer bütün test edilmiş bütün kütüphanelerden daha hızlı.
+* **En kompleks** yapıları bile doğrula:
+ * Hiyerarşik Pydantic modellerinin kullanımı ile beraber, Python `typing`’s `List` and `Dict`, vs gibi şeyleri doğrula.
+ * Doğrulayıcılar en kompleks data şemalarının bile temiz ve kolay bir şekilde tanımlanmasına izin veriyor, ve hepsi JSON şeması olarak dokümante ediliyor
+ * Pydantic, JSON objen ne kadar derin (nested) olursa olsun doğrulamasını ve gösterimini yapıyor
+* **Genişletilebilir**:
+ * Pydantic özelleştirilmiş data tiplerinin tanımlanmasının yapılmasına izin veriyor ayrıca validator decoratorü ile senin doğrulamaları genişletip, kendi doğrulayıcılarını yazmana izin veriyor.
+* 100% test kapsayıcılığı.
+
diff --git a/docs/tr/mkdocs.yml b/docs/tr/mkdocs.yml
index 5e429fdef..d4ff63d0c 100644
--- a/docs/tr/mkdocs.yml
+++ b/docs/tr/mkdocs.yml
@@ -54,6 +54,7 @@ nav:
- tr: /tr/
- uk: /uk/
- zh: /zh/
+- features.md
markdown_extensions:
- toc:
permalink: true
From 19fd336cde290606e37cfbc059ca15360f2de9bc Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 5 Oct 2021 13:02:28 +0000
Subject: [PATCH 12/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 435d54c2d..16a807dd7 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Turkish translation for `docs/features.md`. PR [#1950](https://github.com/tiangolo/fastapi/pull/1950) by [@ycd](https://github.com/ycd).
* 🌐 Add Turkish translation for `docs/benchmarks.md`. PR [#2729](https://github.com/tiangolo/fastapi/pull/2729) by [@Telomeraz](https://github.com/Telomeraz).
* 🌐 Add Turkish translation for `docs/index.md`. PR [#1908](https://github.com/tiangolo/fastapi/pull/1908) by [@ycd](https://github.com/ycd).
* 🌐 Add French translation for `docs/tutorial/body.md`. PR [#3671](https://github.com/tiangolo/fastapi/pull/3671) by [@Smlep](https://github.com/Smlep).
From eb515b1af75d9d1bf7c00a0ca4c994ba346b6978 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 5 Oct 2021 15:31:39 +0200
Subject: [PATCH 13/98] =?UTF-8?q?=F0=9F=93=9D=20Re-structure=20release=20n?=
=?UTF-8?q?otes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 16a807dd7..2cf6f9ea9 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,22 @@
## Latest Changes
+
+### Features
+
+* ⬆Increase supported version of aiofiles to suppress warnings. PR [#2899](https://github.com/tiangolo/fastapi/pull/2899) by [@SnkSynthesis](https://github.com/SnkSynthesis).
+* ➖ Do not require backports in Python >= 3.7. PR [#1880](https://github.com/tiangolo/fastapi/pull/1880) by [@FFY00](https://github.com/FFY00).
+* ⬆ Upgrade required Python version to >= 3.6.1, needed by typing.Deque, used by Pydantic. PR [#2733](https://github.com/tiangolo/fastapi/pull/2733) by [@hukkin](https://github.com/hukkin).
+* ⬆️ Bump Uvicorn max range to 0.15.0. PR [#3345](https://github.com/tiangolo/fastapi/pull/3345) by [@Kludex](https://github.com/Kludex).
+
+### Docs
+
+* 📝 Update GraphQL docs, recommend Strawberry. PR [#3981](https://github.com/tiangolo/fastapi/pull/3981) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Re-write and extend Deployment guide: Concepts, Uvicorn, Gunicorn, Docker, Containers, Kubernetes. PR [#3974](https://github.com/tiangolo/fastapi/pull/3974) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Upgrade HTTPS guide with more explanations and diagrams. PR [#3950](https://github.com/tiangolo/fastapi/pull/3950) by [@tiangolo](https://github.com/tiangolo).
+
+### Translations
+
* 🌐 Add Turkish translation for `docs/features.md`. PR [#1950](https://github.com/tiangolo/fastapi/pull/1950) by [@ycd](https://github.com/ycd).
* 🌐 Add Turkish translation for `docs/benchmarks.md`. PR [#2729](https://github.com/tiangolo/fastapi/pull/2729) by [@Telomeraz](https://github.com/Telomeraz).
* 🌐 Add Turkish translation for `docs/index.md`. PR [#1908](https://github.com/tiangolo/fastapi/pull/1908) by [@ycd](https://github.com/ycd).
@@ -9,21 +25,17 @@
* 🌐 Add French translation for `deployment/docker.md`. PR [#3694](https://github.com/tiangolo/fastapi/pull/3694) by [@rjNemo](https://github.com/rjNemo).
* 🌐 Add Portuguese translation for `docs/tutorial/path-params.md`. PR [#3664](https://github.com/tiangolo/fastapi/pull/3664) by [@FelipeSilva93](https://github.com/FelipeSilva93).
* 🌐 Add Portuguese translation for `docs/deployment/https.md`. PR [#3754](https://github.com/tiangolo/fastapi/pull/3754) by [@lsglucas](https://github.com/lsglucas).
-* ✨ Update GitHub Action: notify-translations, to avoid a race conditon. PR [#3989](https://github.com/tiangolo/fastapi/pull/3989) by [@tiangolo](https://github.com/tiangolo).
+* 🌐 Add German translation for `docs/features.md`. PR [#3699](https://github.com/tiangolo/fastapi/pull/3699) by [@mawassk](https://github.com/mawassk).
+
+### Internal
+
+* ✨ Update GitHub Action: notify-translations, to avoid a race conditions. PR [#3989](https://github.com/tiangolo/fastapi/pull/3989) by [@tiangolo](https://github.com/tiangolo).
* ⬆️ Upgrade development `autoflake`, supporting multi-line imports. PR [#3988](https://github.com/tiangolo/fastapi/pull/3988) by [@tiangolo](https://github.com/tiangolo).
* ⬆️ Increase dependency ranges for tests and docs: pytest-cov, pytest-asyncio, black, httpx, sqlalchemy, databases, mkdocs-markdownextradata-plugin. PR [#3987](https://github.com/tiangolo/fastapi/pull/3987) by [@tiangolo](https://github.com/tiangolo).
* 👥 Update FastAPI People. PR [#3986](https://github.com/tiangolo/fastapi/pull/3986) by [@github-actions[bot]](https://github.com/apps/github-actions).
-* ⬆Increase supported version of aiofiles to suppress warnings. PR [#2899](https://github.com/tiangolo/fastapi/pull/2899) by [@SnkSynthesis](https://github.com/SnkSynthesis).
-* ➖ Do not require backports in Python >= 3.7. PR [#1880](https://github.com/tiangolo/fastapi/pull/1880) by [@FFY00](https://github.com/FFY00).
-* ⬆ Upgrade required Python version to >= 3.6.1, needed by typing.Deque, used by Pydantic. PR [#2733](https://github.com/tiangolo/fastapi/pull/2733) by [@hukkin](https://github.com/hukkin).
-* ⬆ Upgrade internal testing dependencies: mypy to version 0.910, add newly needed type packages. PR [#3350](https://github.com/tiangolo/fastapi/pull/3350) by [@ArcLightSlavik](https://github.com/ArcLightSlavik).
-* ⬆️ Bump Uvicorn max range to 0.15.0. PR [#3345](https://github.com/tiangolo/fastapi/pull/3345) by [@Kludex](https://github.com/Kludex).
* 💚 Fix badges in README and main page. PR [#3979](https://github.com/tiangolo/fastapi/pull/3979) by [@ghandic](https://github.com/ghandic).
-* 📝 Update GraphQL docs, recommend Strawberry. PR [#3981](https://github.com/tiangolo/fastapi/pull/3981) by [@tiangolo](https://github.com/tiangolo).
+* ⬆ Upgrade internal testing dependencies: mypy to version 0.910, add newly needed type packages. PR [#3350](https://github.com/tiangolo/fastapi/pull/3350) by [@ArcLightSlavik](https://github.com/ArcLightSlavik).
* ✨ Add Deepset Sponsorship. PR [#3976](https://github.com/tiangolo/fastapi/pull/3976) by [@tiangolo](https://github.com/tiangolo).
-* 📝 Re-write and extend Deployment guide: Concepts, Uvicorn, Gunicorn, Docker, Containers, Kubernetes. PR [#3974](https://github.com/tiangolo/fastapi/pull/3974) by [@tiangolo](https://github.com/tiangolo).
-* 📝 Upgrade HTTPS guide with more explanations and diagrams. PR [#3950](https://github.com/tiangolo/fastapi/pull/3950) by [@tiangolo](https://github.com/tiangolo).
-* 🌐 Add German translation for `docs/features.md`. PR [#3699](https://github.com/tiangolo/fastapi/pull/3699) by [@mawassk](https://github.com/mawassk).
* 🎨 Tweak CSS styles for shell animations. PR [#3888](https://github.com/tiangolo/fastapi/pull/3888) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add new Sponsor Calmcode.io. PR [#3777](https://github.com/tiangolo/fastapi/pull/3777) by [@tiangolo](https://github.com/tiangolo).
From 378fa4ef755a0f814cd61daf571466fde3af9b05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 5 Oct 2021 15:32:18 +0200
Subject: [PATCH 14/98] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.68.2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 7 +++++++
fastapi/__init__.py | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 2cf6f9ea9..56bb42bdc 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,13 @@
## Latest Changes
+## 0.68.2
+
+This release has **no breaking changes**. 🎉
+
+It upgrades the version ranges of sub-dependencies to allow applications using FastAPI to easily upgrade them.
+
+Soon there will be a new FastAPI release upgrading Starlette to take advantage of recent improvements, but as that has a higher chance of having breaking changes, it will be in a separate release.
### Features
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index 316362669..ba2b9abf4 100644
--- a/fastapi/__init__.py
+++ b/fastapi/__init__.py
@@ -1,6 +1,6 @@
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
-__version__ = "0.68.1"
+__version__ = "0.68.2"
from starlette import status as status
From 2210c84efd16668e9561fd448f80abe6249b27da Mon Sep 17 00:00:00 2001
From: bilal alpaslan <47563997+BilalAlpaslan@users.noreply.github.com>
Date: Tue, 5 Oct 2021 18:47:51 +0300
Subject: [PATCH 15/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translatio?=
=?UTF-8?q?n=20for=20`docs/fastapi-people.md`=20(#3848)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián Ramírez
---
docs/tr/docs/fastapi-people.md | 178 +++++++++++++++++++++++++++++++++
docs/tr/mkdocs.yml | 1 +
2 files changed, 179 insertions(+)
create mode 100644 docs/tr/docs/fastapi-people.md
diff --git a/docs/tr/docs/fastapi-people.md b/docs/tr/docs/fastapi-people.md
new file mode 100644
index 000000000..3e459036a
--- /dev/null
+++ b/docs/tr/docs/fastapi-people.md
@@ -0,0 +1,178 @@
+# FastAPI Topluluğu
+
+FastAPI, her kökenden insanı ağırlayan harika bir topluluğa sahip.
+
+## Yazan - Geliştiren
+
+Hey! 👋
+
+İşte bu benim:
+
+{% if people %}
+
+{% endif %}
+
+Ben **FastAPI** 'nin yazarı ve geliştiricisiyim. Bununla ilgili daha fazla bilgiyi şurada okuyabilirsiniz:
+ [FastAPI yardım - yardım al - Yazar ile iletişime geç](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
+
+... Burada size harika FastAPI topluluğunu göstermek istiyorum.
+
+---
+
+**FastAPI** topluluğundan destek alıyor. Ve katkıda bulunanları vurgulamak istiyorum.
+
+İşte o mükemmel insanlar:
+
+* [GitHubdaki sorunları (issues) çözmelerinde diğerlerine yardım et](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
+* [Pull Requests oluşturun](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
+* Pull Requests 'leri gözden geçirin, [özelliklede çevirileri](contributing.md#translations){.internal-link target=_blank}.
+
+Onlara bir alkış. 👏 🙇
+
+## Geçen ayın en aktif kullanıcıları
+
+Bunlar geçen ay boyunca [GitHub' da başkalarına sorunlarında (issues) en çok yardımcı olan ](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} kullanıcılar ☕
+
+{% if people %}
+
+{% endif %}
+
+## Uzmanlar
+
+İşte **FastAPI Uzmanları**. 🤓
+
+Bunlar *tüm zamanlar boyunca* [GitHub' da başkalarına sorunlarında (issues) en çok yardımcı olan](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} kullanıcılar.
+
+Başkalarına yardım ederek uzman olduklarını kanıtladılar. ✨
+
+{% if people %}
+
+{% endif %}
+
+## En fazla katkıda bulunanlar
+
+işte **En fazla katkıda bulunanlar**. 👷
+
+Bu kullanıcılar en çok [Pull Requests oluşturan](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} ve onu kaynak koduna *birleştirenler*.
+
+Kaynak koduna, belgelere, çevirilere vb. katkıda bulundular. 📦
+
+{% if people %}
+
+{% endif %}
+
+Çok fazla katkıda bulunan var (binden fazla), hepsini şurda görebilirsin: FastAPI GitHub Katkıda Bulunanlar. 👷
+
+## En fazla inceleme yapanlar
+
+İşte **En fazla inceleme yapanlar**. 🕵️
+
+### Çeviri için İncelemeler
+
+Yalnızca birkaç dil konuşabiliyorum (ve çok da iyi değilim 😅). Bu yüzden döküman çevirilerini [**onaylama yetkisi**](contributing.md#translations){.internal-link target=_blank} siz inceleyenlere aittir. Sizler olmadan diğer birkaç dilde dokümantasyon olmazdı.
+
+---
+
+**En fazla inceleme yapanlar** 🕵️ kodun, belgelerin ve özellikle **çevirilerin** kalitesini sağlamak için diğerlerinden daha fazla pull requests incelemiştir.
+
+{% if people %}
+
+If we want to call asynchronous functions in our tests, our test functions have to be asynchronous. Anyio provides a neat plugin for this, that allows us to specify that some test functions are to be called asynchronously.
## HTTPX
@@ -66,7 +54,7 @@ $ pytest
## In Detail
-The marker `@pytest.mark.asyncio` tells pytest that this test function should be called asynchronously:
+The marker `@pytest.mark.anyio` tells pytest that this test function should be called asynchronously:
```Python hl_lines="7"
{!../../../docs_src/async_tests/test_main.py!}
@@ -97,4 +85,4 @@ that we used to make our requests with the `TestClient`.
As the testing function is now asynchronous, you can now also call (and `await`) other `async` functions apart from sending requests to your FastAPI application in your tests, exactly as you would call them anywhere else in your code.
!!! tip
- If you encounter a `RuntimeError: Task attached to a different loop` when integrating asynchronous function calls in your tests (e.g. when using MongoDB's MotorClient) check out this issue in the pytest-asyncio repository.
+ If you encounter a `RuntimeError: Task attached to a different loop` when integrating asynchronous function calls in your tests (e.g. when using MongoDB's MotorClient) Remember to instantiate objects that need an event loop only within async functions, e.g. an `'@app.on_event("startup")` callback.
diff --git a/docs/en/docs/advanced/extending-openapi.md b/docs/en/docs/advanced/extending-openapi.md
index 9179126df..d8d280ba6 100644
--- a/docs/en/docs/advanced/extending-openapi.md
+++ b/docs/en/docs/advanced/extending-openapi.md
@@ -152,21 +152,6 @@ After that, your file structure could look like:
└── swagger-ui.css
```
-### Install `aiofiles`
-
-Now you need to install `aiofiles`:
-
-
-
-
## Using `Jinja2Templates`
* Import `Jinja2Templates`.
diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md
index 998564bb3..cc6982b79 100644
--- a/docs/en/docs/index.md
+++ b/docs/en/docs/index.md
@@ -443,7 +443,6 @@ Used by Pydantic:
Used by Starlette:
* requests - Required if you want to use the `TestClient`.
-* aiofiles - Required if you want to use `FileResponse` or `StaticFiles`.
* jinja2 - Required if you want to use the default template configuration.
* python-multipart - Required if you want to support form "parsing", with `request.form()`.
* itsdangerous - Required for `SessionMiddleware` support.
diff --git a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
index 3388a0828..82553afae 100644
--- a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -7,15 +7,6 @@ To do this, use `yield` instead of `return`, and write the extra steps after.
!!! tip
Make sure to use `yield` one single time.
-!!! info
- For this to work, you need to use **Python 3.7** or above, or in **Python 3.6**, install the "backports":
-
- ```
- pip install async-exit-stack async-generator
- ```
-
- This installs async-exit-stack and async-generator.
-
!!! note "Technical Details"
Any function that is valid to use with:
diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md
index c623fad29..e8ebb29c8 100644
--- a/docs/en/docs/tutorial/sql-databases.md
+++ b/docs/en/docs/tutorial/sql-databases.md
@@ -441,17 +441,6 @@ You can find an example of Alembic in a FastAPI project in the templates from [P
### Create a dependency
-!!! info
- For this to work, you need to use **Python 3.7** or above, or in **Python 3.6**, install the "backports":
-
- ```console
- $ pip install async-exit-stack async-generator
- ```
-
- This installs async-exit-stack and async-generator.
-
- You can also use the alternative method with a "middleware" explained at the end.
-
Now use the `SessionLocal` class we created in the `sql_app/databases.py` file to create a dependency.
We need to have an independent database session/connection (`SessionLocal`) per request, use the same session through all the request and then close it after the request is finished.
diff --git a/docs/en/docs/tutorial/static-files.md b/docs/en/docs/tutorial/static-files.md
index c103bd940..7a0c36af3 100644
--- a/docs/en/docs/tutorial/static-files.md
+++ b/docs/en/docs/tutorial/static-files.md
@@ -2,20 +2,6 @@
You can serve static files automatically from a directory using `StaticFiles`.
-## Install `aiofiles`
-
-First you need to install `aiofiles`:
-
-
-
## Use `StaticFiles`
* Import `StaticFiles`.
diff --git a/docs_src/async_tests/test_main.py b/docs_src/async_tests/test_main.py
index c141d86ca..9f1527d5f 100644
--- a/docs_src/async_tests/test_main.py
+++ b/docs_src/async_tests/test_main.py
@@ -4,7 +4,7 @@ from httpx import AsyncClient
from .main import app
-@pytest.mark.asyncio
+@pytest.mark.anyio
async def test_root():
async with AsyncClient(app=app, base_url="http://test") as ac:
response = await ac.get("/")
diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py
index d1fdfe5f6..04382c69e 100644
--- a/fastapi/concurrency.py
+++ b/fastapi/concurrency.py
@@ -1,4 +1,5 @@
-from typing import Any, Callable
+import sys
+from typing import AsyncGenerator, ContextManager, TypeVar
from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa
from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa
@@ -6,41 +7,21 @@ from starlette.concurrency import ( # noqa
run_until_first_complete as run_until_first_complete,
)
-asynccontextmanager_error_message = """
-FastAPI's contextmanager_in_threadpool require Python 3.7 or above,
-or the backport for Python 3.6, installed with:
- pip install async-generator
-"""
+if sys.version_info >= (3, 7):
+ from contextlib import AsyncExitStack as AsyncExitStack
+ from contextlib import asynccontextmanager as asynccontextmanager
+else:
+ from contextlib2 import AsyncExitStack as AsyncExitStack # noqa
+ from contextlib2 import asynccontextmanager as asynccontextmanager # noqa
-def _fake_asynccontextmanager(func: Callable[..., Any]) -> Callable[..., Any]:
- def raiser(*args: Any, **kwargs: Any) -> Any:
- raise RuntimeError(asynccontextmanager_error_message)
-
- return raiser
+_T = TypeVar("_T")
-try:
- from contextlib import asynccontextmanager as asynccontextmanager # type: ignore
-except ImportError:
- try:
- from async_generator import ( # type: ignore # isort: skip
- asynccontextmanager as asynccontextmanager,
- )
- except ImportError: # pragma: no cover
- asynccontextmanager = _fake_asynccontextmanager
-
-try:
- from contextlib import AsyncExitStack as AsyncExitStack # type: ignore
-except ImportError:
- try:
- from async_exit_stack import AsyncExitStack as AsyncExitStack # type: ignore
- except ImportError: # pragma: no cover
- AsyncExitStack = None # type: ignore
-
-
-@asynccontextmanager # type: ignore
-async def contextmanager_in_threadpool(cm: Any) -> Any:
+@asynccontextmanager
+async def contextmanager_in_threadpool(
+ cm: ContextManager[_T],
+) -> AsyncGenerator[_T, None]:
try:
yield await run_in_threadpool(cm.__enter__)
except Exception as e:
diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py
index 95049d40e..35ba44aab 100644
--- a/fastapi/dependencies/utils.py
+++ b/fastapi/dependencies/utils.py
@@ -1,4 +1,3 @@
-import asyncio
import dataclasses
import inspect
from contextlib import contextmanager
@@ -6,6 +5,7 @@ from copy import deepcopy
from typing import (
Any,
Callable,
+ Coroutine,
Dict,
List,
Mapping,
@@ -17,10 +17,10 @@ from typing import (
cast,
)
+import anyio
from fastapi import params
from fastapi.concurrency import (
AsyncExitStack,
- _fake_asynccontextmanager,
asynccontextmanager,
contextmanager_in_threadpool,
)
@@ -266,18 +266,6 @@ def get_typed_annotation(param: inspect.Parameter, globalns: Dict[str, Any]) ->
return annotation
-async_contextmanager_dependencies_error = """
-FastAPI dependencies with yield require Python 3.7 or above,
-or the backports for Python 3.6, installed with:
- pip install async-exit-stack async-generator
-"""
-
-
-def check_dependency_contextmanagers() -> None:
- if AsyncExitStack is None or asynccontextmanager == _fake_asynccontextmanager:
- raise RuntimeError(async_contextmanager_dependencies_error) # pragma: no cover
-
-
def get_dependant(
*,
path: str,
@@ -289,8 +277,6 @@ def get_dependant(
path_param_names = get_path_param_names(path)
endpoint_signature = get_typed_signature(call)
signature_params = endpoint_signature.parameters
- if is_gen_callable(call) or is_async_gen_callable(call):
- check_dependency_contextmanagers()
dependant = Dependant(call=call, name=name, path=path, use_cache=use_cache)
for param_name, param in signature_params.items():
if isinstance(param.default, params.Depends):
@@ -452,14 +438,6 @@ async def solve_generator(
if is_gen_callable(call):
cm = contextmanager_in_threadpool(contextmanager(call)(**sub_values))
elif is_async_gen_callable(call):
- if not inspect.isasyncgenfunction(call):
- # asynccontextmanager from the async_generator backfill pre python3.7
- # does not support callables that are not functions or methods.
- # See https://github.com/python-trio/async_generator/issues/32
- #
- # Expand the callable class into its __call__ method before decorating it.
- # This approach will work on newer python versions as well.
- call = getattr(call, "__call__", None)
cm = asynccontextmanager(call)(**sub_values)
return await stack.enter_async_context(cm)
@@ -539,10 +517,7 @@ async def solve_dependencies(
solved = dependency_cache[sub_dependant.cache_key]
elif is_gen_callable(call) or is_async_gen_callable(call):
stack = request.scope.get("fastapi_astack")
- if stack is None:
- raise RuntimeError(
- async_contextmanager_dependencies_error
- ) # pragma: no cover
+ assert isinstance(stack, AsyncExitStack)
solved = await solve_generator(
call=call, stack=stack, sub_values=sub_values
)
@@ -697,9 +672,18 @@ async def request_body_to_args(
and lenient_issubclass(field.type_, bytes)
and isinstance(value, sequence_types)
):
- awaitables = [sub_value.read() for sub_value in value]
- contents = await asyncio.gather(*awaitables)
- value = sequence_shape_to_type[field.shape](contents)
+ results: List[Union[bytes, str]] = []
+
+ async def process_fn(
+ fn: Callable[[], Coroutine[Any, Any, Any]]
+ ) -> None:
+ result = await fn()
+ results.append(result)
+
+ async with anyio.create_task_group() as tg:
+ for sub_value in value:
+ tg.start_soon(process_fn, sub_value.read)
+ value = sequence_shape_to_type[field.shape](results)
v_, errors_ = field.validate(value, values, loc=loc)
diff --git a/pyproject.toml b/pyproject.toml
index 5b6b272a7..ddce5a39c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -33,8 +33,10 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
requires = [
- "starlette ==0.14.2",
- "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0"
+ "starlette ==0.15.0",
+ "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
+ # TODO: remove contextlib2 as a direct dependency after upgrading Starlette
+ "contextlib2 >= 21.6.0; python_version < '3.7'",
]
description-file = "README.md"
requires-python = ">=3.6.1"
@@ -46,7 +48,6 @@ Documentation = "https://fastapi.tiangolo.com/"
test = [
"pytest >=6.2.4,<7.0.0",
"pytest-cov >=2.12.0,<4.0.0",
- "pytest-asyncio >=0.14.0,<0.16.0",
"mypy ==0.910",
"flake8 >=3.8.3,<4.0.0",
"black ==21.9b0",
@@ -60,11 +61,9 @@ test = [
"orjson >=3.2.1,<4.0.0",
"ujson >=4.0.1,<5.0.0",
"python-multipart >=0.0.5,<0.0.6",
- "aiofiles >=0.5.0,<0.8.0",
# TODO: try to upgrade after upgrading Starlette
"flask >=1.1.2,<2.0.0",
- "async_exit_stack >=1.0.1,<2.0.0; python_version < '3.7'",
- "async_generator >=1.10,<2.0.0; python_version < '3.7'",
+ "anyio[trio] >=3.2.1,<4.0.0",
# types
"types-ujson ==0.1.1",
@@ -90,7 +89,6 @@ dev = [
]
all = [
"requests >=2.24.0,<3.0.0",
- "aiofiles >=0.5.0,<0.8.0",
# TODO: try to upgrade after upgrading Starlette
"jinja2 >=2.11.2,<3.0.0",
"python-multipart >=0.0.5,<0.0.6",
@@ -103,8 +101,6 @@ all = [
"orjson >=3.2.1,<4.0.0",
"email_validator >=1.1.1,<2.0.0",
"uvicorn[standard] >=0.12.0,<0.16.0",
- "async_exit_stack >=1.0.1,<2.0.0; python_version < '3.7'",
- "async_generator >=1.10,<2.0.0; python_version < '3.7'",
]
[tool.isort]
@@ -148,6 +144,8 @@ junit_family = "xunit2"
filterwarnings = [
"error",
'ignore:"@coroutine" decorator is deprecated since Python 3\.8, use "async def" instead:DeprecationWarning',
+ # TODO: needed by AnyIO in Python 3.9, try to remove after an AnyIO upgrade
+ 'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning',
# TODO: if these ignores are needed, enable them, otherwise remove them
# 'ignore:The explicit passing of coroutine objects to asyncio\.wait\(\) is deprecated since Python 3\.8:DeprecationWarning',
# 'ignore:Exception ignored in.
Date: Wed, 6 Oct 2021 15:32:53 +0000
Subject: [PATCH 24/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 868059224..c6fc827ad 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* ✨ Add support for Trio via AnyIO. PR [#3372](https://github.com/tiangolo/fastapi/pull/3372) by [@graingert](https://github.com/graingert).
* 🔧 Lint only in Python 3.7 and above. PR [#4006](https://github.com/tiangolo/fastapi/pull/4006) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add GitHub Action notify-translations config for Azerbaijani. PR [#3995](https://github.com/tiangolo/fastapi/pull/3995) by [@tiangolo](https://github.com/tiangolo).
* 🌐 Initialize Azerbaijani translations. PR [#3941](https://github.com/tiangolo/fastapi/pull/3941) by [@madatbay](https://github.com/madatbay).
From a8bde38f7c4498edafce088bb9b525b07db889ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Wed, 6 Oct 2021 17:42:55 +0200
Subject: [PATCH 25/98] =?UTF-8?q?=E2=9E=96=20Remove=20`graphene`=20as=20an?=
=?UTF-8?q?=20optional=20dependency=20(#4007)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index ddce5a39c..73a020109 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -84,8 +84,6 @@ dev = [
"autoflake >=1.4.0,<2.0.0",
"flake8 >=3.8.3,<4.0.0",
"uvicorn[standard] >=0.12.0,<0.16.0",
- # TODO: remove in the next major version
- "graphene >=2.1.8,<3.0.0"
]
all = [
"requests >=2.24.0,<3.0.0",
@@ -95,8 +93,6 @@ all = [
# TODO: try to upgrade after upgrading Starlette
"itsdangerous >=1.1.0,<2.0.0",
"pyyaml >=5.3.1,<6.0.0",
- # TODO: remove in the next major version
- "graphene >=2.1.8,<3.0.0",
"ujson >=4.0.1,<5.0.0",
"orjson >=3.2.1,<4.0.0",
"email_validator >=1.1.1,<2.0.0",
From c15f0423188c4768a60dc934f86e233732c000e4 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 6 Oct 2021 15:43:37 +0000
Subject: [PATCH 26/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index c6fc827ad..0849a07d5 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* ➖ Remove `graphene` as an optional dependency. PR [#4007](https://github.com/tiangolo/fastapi/pull/4007) by [@tiangolo](https://github.com/tiangolo).
* ✨ Add support for Trio via AnyIO. PR [#3372](https://github.com/tiangolo/fastapi/pull/3372) by [@graingert](https://github.com/graingert).
* 🔧 Lint only in Python 3.7 and above. PR [#4006](https://github.com/tiangolo/fastapi/pull/4006) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Add GitHub Action notify-translations config for Azerbaijani. PR [#3995](https://github.com/tiangolo/fastapi/pull/3995) by [@tiangolo](https://github.com/tiangolo).
From d9fa2311b358cdbc545f5c60f98d0119ec8f0c92 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 7 Oct 2021 12:36:09 +0200
Subject: [PATCH 27/98] =?UTF-8?q?=F0=9F=93=9D=20Add=20docs=20for=20using?=
=?UTF-8?q?=20Trio=20with=20Hypercorn=20(#4014)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/async.md | 10 +++++++-
docs/en/docs/deployment/manually.md | 37 +++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md
index 7fadee87f..8194650fd 100644
--- a/docs/en/docs/async.md
+++ b/docs/en/docs/async.md
@@ -324,7 +324,15 @@ So, about the egg and the chicken, how do you call the first `async` function?
If you are working with **FastAPI** you don't have to worry about that, because that "first" function will be your *path operation function*, and FastAPI will know how to do the right thing.
-But if you want to use `async` / `await` without FastAPI, check the official Python docs.
+But if you want to use `async` / `await` without FastAPI, you can do it as well.
+
+### Write your own async code
+
+Starlette (and **FastAPI**) are based on AnyIO, which makes it compatible with both Python's standard library asyncio and Trio.
+
+In particular, you can directly use AnyIO for your advanced concurrency use cases that require more advanced patterns in your own code.
+
+And even if you were not using FastAPI, you could also write your own async applications with AnyIO to be highly compatible and get its benefits (e.g. *structured concurrency*).
### Other forms of asynchronous code
diff --git a/docs/en/docs/deployment/manually.md b/docs/en/docs/deployment/manually.md
index 80a7df7e6..6a3619b65 100644
--- a/docs/en/docs/deployment/manually.md
+++ b/docs/en/docs/deployment/manually.md
@@ -92,6 +92,43 @@ You can then your application the same way you have done in the tutorials, but w
It helps a lot during **development**, but you **shouldn't** use it in **production**.
+## Hypercorn with Trio
+
+Starlette and **FastAPI** are based on AnyIO, which makes them compatible with both Python's standard library asyncio and Trio.
+
+Nevertheless, Uvicorn is currently only compatible with asyncio, and it normally uses `uvloop`, the high-performance drop-in replacement for `asyncio`.
+
+But if you want to directly use **Trio**, then you can use **Hypercorn** as it supports it. ✨
+
+### Install Hypercorn with Trio
+
+First you need to install Hypercorn with Trio support:
+
+
```console
- $ pip install uvicorn[standard]
+ $ pip install "uvicorn[standard]"
---> 100%
```
diff --git a/docs/en/docs/deployment/server-workers.md b/docs/en/docs/deployment/server-workers.md
index 2892d5797..84a2b0f33 100644
--- a/docs/en/docs/deployment/server-workers.md
+++ b/docs/en/docs/deployment/server-workers.md
@@ -39,7 +39,7 @@ And then the Gunicorn-compatible **Uvicorn worker** class would be in charge of
```console
-$ pip install uvicorn[standard] gunicorn
+$ pip install "uvicorn[standard]" gunicorn
---> 100%
```
diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md
index aa2c16a2e..7de1e50df 100644
--- a/docs/en/docs/index.md
+++ b/docs/en/docs/index.md
@@ -134,7 +134,7 @@ You will also need an ASGI server, for production such as
```console
-$ pip install uvicorn[standard]
+$ pip install "uvicorn[standard]"
---> 100%
```
@@ -457,7 +457,7 @@ Used by FastAPI / Starlette:
* uvicorn - for the server that loads and serves your application.
* orjson - Required if you want to use `ORJSONResponse`.
-You can install all of these with `pip install fastapi[all]`.
+You can install all of these with `pip install "fastapi[all]"`.
## License
diff --git a/docs/en/docs/tutorial/index.md b/docs/en/docs/tutorial/index.md
index bd02cd539..8b4a9df9b 100644
--- a/docs/en/docs/tutorial/index.md
+++ b/docs/en/docs/tutorial/index.md
@@ -43,7 +43,7 @@ For the tutorial, you might want to install it with all the optional dependencie
```console
-$ pip install fastapi[all]
+$ pip install "fastapi[all]"
---> 100%
```
@@ -64,7 +64,7 @@ $ pip install fastapi[all]
Also install `uvicorn` to work as the server:
```
- pip install uvicorn[standard]
+ pip install "uvicorn[standard]"
```
And the same for each of the optional dependencies that you want to use.
diff --git a/docs/en/docs/tutorial/security/oauth2-jwt.md b/docs/en/docs/tutorial/security/oauth2-jwt.md
index fda722cd1..f88cf23c0 100644
--- a/docs/en/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/en/docs/tutorial/security/oauth2-jwt.md
@@ -33,7 +33,7 @@ We need to install `python-jose` to generate and verify the JWT tokens in Python
+
+```console
+$ uvicorn main:app --reload
+
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+INFO: Started reloader process [28720]
+INFO: Started server process [28722]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+```
+
+
+
+!!! note
+ La commande `uvicorn main:app` fait référence à :
+
+ * `main` : le fichier `main.py` (le module Python).
+ * `app` : l'objet créé dans `main.py` via la ligne `app = FastAPI()`.
+ * `--reload` : l'option disant à uvicorn de redémarrer le serveur à chaque changement du code. À ne pas utiliser en production !
+
+Vous devriez voir dans la console, une ligne semblable à la suivante :
+
+```hl_lines="4"
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+```
+
+Cette ligne montre l'URL par laquelle l'app est actuellement accessible, sur votre machine locale.
+
+### Allez voir le résultat
+
+Ouvrez votre navigateur à l'adresse http://127.0.0.1:8000.
+
+Vous obtiendrez cette réponse JSON :
+
+```JSON
+{"message": "Hello World"}
+```
+
+### Documentation interactive de l'API
+
+Rendez-vous sur http://127.0.0.1:8000/docs.
+
+Vous verrez la documentation interactive de l'API générée automatiquement (via Swagger UI) :
+
+
+
+### Documentation alternative
+
+Ensuite, rendez-vous sur http://127.0.0.1:8000/redoc.
+
+Vous y verrez la documentation alternative (via ReDoc) :
+
+
+
+### OpenAPI
+
+**FastAPI** génère un "schéma" contenant toute votre API dans le standard de définition d'API **OpenAPI**.
+
+#### "Schéma"
+
+Un "schéma" est une définition ou une description de quelque chose. Pas le code qui l'implémente, uniquement une description abstraite.
+
+#### "Schéma" d'API
+
+Ici, OpenAPI est une spécification qui dicte comment définir le schéma de votre API.
+
+Le schéma inclut les chemins de votre API, les paramètres potentiels de chaque chemin, etc.
+
+#### "Schéma" de données
+
+Le terme "schéma" peut aussi faire référence à la forme de la donnée, comme un contenu JSON.
+
+Dans ce cas, cela signifierait les attributs JSON, ainsi que les types de ces attributs, etc.
+
+#### OpenAPI et JSON Schema
+
+**OpenAPI** définit un schéma d'API pour votre API. Il inclut des définitions (ou "schémas") de la donnée envoyée et reçue par votre API en utilisant **JSON Schema**, le standard des schémas de données JSON.
+
+#### Allez voir `openapi.json`
+
+Si vous êtes curieux d'à quoi ressemble le schéma brut **OpenAPI**, **FastAPI** génère automatiquement un (schéma) JSON avec les descriptions de toute votre API.
+
+Vous pouvez le voir directement à cette adresse : http://127.0.0.1:8000/openapi.json.
+
+Le schéma devrait ressembler à ceci :
+
+
+```JSON
+{
+ "openapi": "3.0.2",
+ "info": {
+ "title": "FastAPI",
+ "version": "0.1.0"
+ },
+ "paths": {
+ "/items/": {
+ "get": {
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+
+
+
+...
+```
+
+#### À quoi sert OpenAPI
+
+Le schéma **OpenAPI** est ce qui alimente les deux systèmes de documentation interactive.
+
+Et il existe des dizaines d'alternatives, toutes basées sur **OpenAPI**. Vous pourriez facilement ajouter n'importe laquelle de ces alternatives à votre application **FastAPI**.
+
+Vous pourriez aussi l'utiliser pour générer du code automatiquement, pour les clients qui communiquent avec votre API. Comme par exemple, des applications frontend, mobiles ou IOT.
+
+## Récapitulatif, étape par étape
+
+### Étape 1 : import `FastAPI`
+
+```Python hl_lines="1"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+`FastAPI` est une classe Python qui fournit toutes les fonctionnalités nécessaires au lancement de votre API.
+
+!!! note "Détails techniques"
+ `FastAPI` est une classe héritant directement de `Starlette`.
+
+ Vous pouvez donc aussi utiliser toutes les fonctionnalités de Starlette depuis `FastAPI`.
+
+### Étape 2 : créer une "instance" `FastAPI`
+
+```Python hl_lines="3"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Ici la variable `app` sera une "instance" de la classe `FastAPI`.
+
+Ce sera le point principal d'interaction pour créer toute votre API.
+
+Cette `app` est la même que celle à laquelle fait référence `uvicorn` dans la commande :
+
+
+
+```console
+$ uvicorn main:app --reload
+
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+```
+
+
+
+Si vous créez votre app avec :
+
+```Python hl_lines="3"
+{!../../../docs_src/first_steps/tutorial002.py!}
+```
+
+Et la mettez dans un fichier `main.py`, alors vous appeleriez `uvicorn` avec :
+
+
+
+```console
+$ uvicorn main:my_awesome_api --reload
+
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+```
+
+
+
+### Étape 3: créer une *opération de chemin*
+
+#### Chemin
+
+Chemin, ou "path" fait référence ici à la dernière partie de l'URL démarrant au premier `/`.
+
+Donc, dans un URL tel que :
+
+```
+https://example.com/items/foo
+```
+
+...le "path" serait :
+
+```
+/items/foo
+```
+
+!!! info
+ Un chemin, ou "path" est aussi souvent appelé route ou "endpoint".
+
+
+#### Opération
+
+"Opération" fait référence à une des "méthodes" HTTP.
+
+Une de :
+
+* `POST`
+* `GET`
+* `PUT`
+* `DELETE`
+
+...ou une des plus exotiques :
+
+* `OPTIONS`
+* `HEAD`
+* `PATCH`
+* `TRACE`
+
+Dans le protocol HTTP, vous pouvez communiquer avec chaque chemin en utilisant une (ou plus) de ces "méthodes".
+
+---
+
+En construisant des APIs, vous utilisez généralement ces méthodes HTTP spécifiques pour effectuer une action précise.
+
+Généralement vous utilisez :
+
+* `POST` : pour créer de la donnée.
+* `GET` : pour lire de la donnée.
+* `PUT` : pour mettre à jour de la donnée.
+* `DELETE` : pour supprimer de la donnée.
+
+Donc, dans **OpenAPI**, chaque méthode HTTP est appelée une "opération".
+
+Nous allons donc aussi appeler ces dernières des "**opérations**".
+
+
+#### Définir un *décorateur d'opération de chemin*
+
+```Python hl_lines="6"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Le `@app.get("/")` dit à **FastAPI** que la fonction en dessous est chargée de gérer les requêtes qui vont sur :
+
+* le chemin `/`
+* en utilisant une opération get
+
+!!! info "`@décorateur` Info"
+ Cette syntaxe `@something` en Python est appelée un "décorateur".
+
+ Vous la mettez au dessus d'une fonction. Comme un joli chapeau décoratif (j'imagine que ce terme vient de là 🤷🏻♂).
+
+ Un "décorateur" prend la fonction en dessous et en fait quelque chose.
+
+ Dans notre cas, ce décorateur dit à **FastAPI** que la fonction en dessous correspond au **chemin** `/` avec l'**opération** `get`.
+
+ C'est le "**décorateur d'opération de chemin**".
+
+Vous pouvez aussi utiliser les autres opérations :
+
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+
+Tout comme celles les plus exotiques :
+
+* `@app.options()`
+* `@app.head()`
+* `@app.patch()`
+* `@app.trace()`
+
+!!! tip "Astuce"
+ Vous êtes libres d'utiliser chaque opération (méthode HTTP) comme vous le désirez.
+
+ **FastAPI** n'impose pas de sens spécifique à chacune d'elle.
+
+ Les informations qui sont présentées ici forment une directive générale, pas des obligations.
+
+ Par exemple, quand l'on utilise **GraphQL**, toutes les actions sont effectuées en utilisant uniquement des opérations `POST`.
+
+### Étape 4 : définir la **fonction de chemin**.
+
+Voici notre "**fonction de chemin**" (ou fonction d'opération de chemin) :
+
+* **chemin** : `/`.
+* **opération** : `get`.
+* **fonction** : la fonction sous le "décorateur" (sous `@app.get("/")`).
+
+```Python hl_lines="7"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+C'est une fonction Python.
+
+Elle sera appelée par **FastAPI** quand une requête sur l'URL `/` sera reçue via une opération `GET`.
+
+Ici, c'est une fonction asynchrone (définie avec `async def`).
+
+---
+
+Vous pourriez aussi la définir comme une fonction classique plutôt qu'avec `async def` :
+
+```Python hl_lines="7"
+{!../../../docs_src/first_steps/tutorial003.py!}
+```
+
+!!! note
+ Si vous ne connaissez pas la différence, allez voir la section [Concurrence : *"Vous êtes pressés ?"*](../async.md#vous-etes-presses){.internal-link target=_blank}.
+
+### Étape 5 : retourner le contenu
+
+```Python hl_lines="8"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Vous pouvez retourner un dictionnaire (`dict`), une liste (`list`), des valeurs seules comme des chaines de caractères (`str`) et des entiers (`int`), etc.
+
+Vous pouvez aussi retourner des models **Pydantic** (qui seront détaillés plus tard).
+
+Il y a de nombreux autres objets et modèles qui seront automatiquement convertis en JSON. Essayez d'utiliser vos favoris, il est fort probable qu'ils soient déjà supportés.
+
+## Récapitulatif
+
+* Importez `FastAPI`.
+* Créez une instance d'`app`.
+* Ajoutez une **décorateur d'opération de chemin** (tel que `@app.get("/")`).
+* Ajoutez une **fonction de chemin** (telle que `def root(): ...` comme ci-dessus).
+* Lancez le serveur de développement (avec `uvicorn main:app --reload`).
diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml
index 01cf8d5e0..6242a88fd 100644
--- a/docs/fr/mkdocs.yml
+++ b/docs/fr/mkdocs.yml
@@ -59,6 +59,7 @@ nav:
- fastapi-people.md
- python-types.md
- Tutoriel - Guide utilisateur:
+ - tutorial/first-steps.md
- tutorial/path-params.md
- tutorial/query-params.md
- tutorial/body.md
From fb1f34123124641850d5cfbe1d247a654ab51586 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Oct 2021 18:47:42 +0000
Subject: [PATCH 82/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index d15ca6103..cec6c2749 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add French translation for Tutorial - First steps. PR [#3455](https://github.com/tiangolo/fastapi/pull/3455) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `docs/tutorial/path-params.md`. PR [#3548](https://github.com/tiangolo/fastapi/pull/3548) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `docs/tutorial/query-params.md`. PR [#3556](https://github.com/tiangolo/fastapi/pull/3556) by [@Smlep](https://github.com/Smlep).
* 🌐 Add Turkish translation for `docs/python-types.md`. PR [#3926](https://github.com/tiangolo/fastapi/pull/3926) by [@BilalAlpaslan](https://github.com/BilalAlpaslan).
From 0a61a6c8656da738ee6438c1fa927e3cbad64bdd Mon Sep 17 00:00:00 2001
From: "weekwith.me" <63915557+0417taehyun@users.noreply.github.com>
Date: Wed, 27 Oct 2021 03:53:40 +0900
Subject: [PATCH 83/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20`docs/tutorial/de?=
=?UTF-8?q?pendencies/classes-as-dependencies`:=20Add=20type=20of=20query?=
=?UTF-8?q?=20parameters=20in=20a=20description=20of=20`Classes=20as=20dep?=
=?UTF-8?q?endencies`=20(#4015)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../docs/tutorial/dependencies/classes-as-dependencies.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md b/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
index 8c00374bf..7747e3e1b 100644
--- a/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
+++ b/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
@@ -91,9 +91,9 @@ Those parameters are what **FastAPI** will use to "solve" the dependency.
In both cases, it will have:
-* an optional `q` query parameter.
-* a `skip` query parameter, with a default of `0`.
-* a `limit` query parameter, with a default of `100`.
+* An optional `q` query parameter that is a `str`.
+* A `skip` query parameter that is an `int`, with a default of `0`.
+* A `limit` query parameter that is an `int`, with a default of `100`.
In both cases the data will be converted, validated, documented on the OpenAPI schema, etc.
From 58ab733f19846b4875c5b79bfb1f4d1cb7f4823f Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Oct 2021 18:54:22 +0000
Subject: [PATCH 84/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index cec6c2749..72f2e9b58 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 📝 Update `docs/tutorial/dependencies/classes-as-dependencies`: Add type of query parameters in a description of `Classes as dependencies`. PR [#4015](https://github.com/tiangolo/fastapi/pull/4015) by [@0417taehyun](https://github.com/0417taehyun).
* 🌐 Add French translation for Tutorial - First steps. PR [#3455](https://github.com/tiangolo/fastapi/pull/3455) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `docs/tutorial/path-params.md`. PR [#3548](https://github.com/tiangolo/fastapi/pull/3548) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `docs/tutorial/query-params.md`. PR [#3556](https://github.com/tiangolo/fastapi/pull/3556) by [@Smlep](https://github.com/Smlep).
From 146ff28d9cd226783aac1d65336ee694471455f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Wed, 8 Dec 2021 16:04:04 +0100
Subject: [PATCH 85/98] =?UTF-8?q?=F0=9F=94=A7=20Add=20CryptAPI=20sponsor?=
=?UTF-8?q?=20(#4264)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 1 +
docs/en/data/sponsors.yml | 3 +
docs/en/data/sponsors_badge.yml | 1 +
docs/en/docs/img/sponsors/cryptapi-banner.svg | 1375 +++++++++++++++++
docs/en/docs/img/sponsors/cryptapi.svg | 1216 +++++++++++++++
docs/en/overrides/main.html | 6 +
6 files changed, 2602 insertions(+)
create mode 100644 docs/en/docs/img/sponsors/cryptapi-banner.svg
create mode 100644 docs/en/docs/img/sponsors/cryptapi.svg
diff --git a/README.md b/README.md
index 830031581..53de38bd9 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,7 @@ The key features are:
+
diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml
index 4949e6c56..baa2e440d 100644
--- a/docs/en/data/sponsors.yml
+++ b/docs/en/data/sponsors.yml
@@ -2,6 +2,9 @@ gold:
- url: https://bit.ly/2QSouzH
title: "Jina: build neural search-as-a-service for any kind of data in just minutes."
img: https://fastapi.tiangolo.com/img/sponsors/jina.svg
+ - url: https://cryptapi.io/
+ title: "CryptAPI: Your easy to use, secure and privacy oriented payment gateway."
+ img: https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg
silver:
- url: https://www.deta.sh/?ref=fastapi
title: The launchpad for all your (team's) ideas
diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml
index 0496c6279..759748728 100644
--- a/docs/en/data/sponsors_badge.yml
+++ b/docs/en/data/sponsors_badge.yml
@@ -6,3 +6,4 @@ logins:
- mikeckennedy
- koaning
- deepset-ai
+ - cryptapi
diff --git a/docs/en/docs/img/sponsors/cryptapi-banner.svg b/docs/en/docs/img/sponsors/cryptapi-banner.svg
new file mode 100644
index 000000000..29cd772da
--- /dev/null
+++ b/docs/en/docs/img/sponsors/cryptapi-banner.svg
@@ -0,0 +1,1375 @@
+
+
diff --git a/docs/en/docs/img/sponsors/cryptapi.svg b/docs/en/docs/img/sponsors/cryptapi.svg
new file mode 100644
index 000000000..db4e09347
--- /dev/null
+++ b/docs/en/docs/img/sponsors/cryptapi.svg
@@ -0,0 +1,1216 @@
+
+
diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html
index aa381faa3..70b0253bd 100644
--- a/docs/en/overrides/main.html
+++ b/docs/en/overrides/main.html
@@ -40,6 +40,12 @@
{% endblock %}
From f282c0e20718e50063a4c4ea164e83f13d020872 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 Dec 2021 15:04:50 +0000
Subject: [PATCH 86/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 72f2e9b58..d37959dcc 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🔧 Add CryptAPI sponsor. PR [#4264](https://github.com/tiangolo/fastapi/pull/4264) by [@tiangolo](https://github.com/tiangolo).
* 📝 Update `docs/tutorial/dependencies/classes-as-dependencies`: Add type of query parameters in a description of `Classes as dependencies`. PR [#4015](https://github.com/tiangolo/fastapi/pull/4015) by [@0417taehyun](https://github.com/0417taehyun).
* 🌐 Add French translation for Tutorial - First steps. PR [#3455](https://github.com/tiangolo/fastapi/pull/3455) by [@Smlep](https://github.com/Smlep).
* 🌐 Add French translation for `docs/tutorial/path-params.md`. PR [#3548](https://github.com/tiangolo/fastapi/pull/3548) by [@Smlep](https://github.com/Smlep).
From dabb4898f140d98f5e5a4668fdbcd0361459fa8d Mon Sep 17 00:00:00 2001
From: kimjaeyoonn <87240205+kimjaeyoonn@users.noreply.github.com>
Date: Thu, 9 Dec 2021 00:32:24 +0900
Subject: [PATCH 87/98] =?UTF-8?q?=F0=9F=8C=90=20Fix=20Korean=20translation?=
=?UTF-8?q?=20for=20`docs/ko/docs/tutorial/index.md`=20(#4193)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/ko/docs/tutorial/index.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/ko/docs/tutorial/index.md b/docs/ko/docs/tutorial/index.md
index a18a9ffc7..622aad1aa 100644
--- a/docs/ko/docs/tutorial/index.md
+++ b/docs/ko/docs/tutorial/index.md
@@ -2,11 +2,11 @@
이 자습서는 **FastAPI**의 대부분의 기능을 단계별로 사용하는 방법을 보여줍니다.
-각 섹션은 이전 섹션을 기반해서 점진적으로 만들어 졌지만, 주제를 구분하여 구성 되었기 때문에 특정 API 요구사항을 해결하기 위해 어떤 특정 항목이던지 직접 이동할 수 있습니다.
+각 섹션은 이전 섹션을 기반해서 점진적으로 만들어 졌지만, 주제에 따라 다르게 구성되었기 때문에 특정 API 요구사항을 해결하기 위해서라면 어느 특정 항목으로던지 직접 이동할 수 있습니다.
또한 향후 참조가 될 수 있도록 만들어졌습니다.
-그러므로 다시 돌아와서 정확히 필요한 것을 볼 수 있습니다.
+그러므로 다시 돌아와서 정확히 필요한 것을 확인할 수 있습니다.
## 코드 실행하기
@@ -30,7 +30,7 @@ $ uvicorn main:app --reload
코드를 작성하거나 복사, 편집할 때, 로컬에서 실행하는 것을 **강력히 장려**합니다.
-편집기에서 이렇게 사용하면, 모든 타입 검사, 자동완성 등 작성해야 하는 코드가 얼마나 적은지 보면서 FastAPI의 장점을 실제로 확인할 수 있습니다.
+편집기에서 이렇게 사용한다면, 모든 타입 검사와 자동완성 등 작성해야 하는 코드가 얼마나 적은지 보면서 FastAPI의 장점을 실제로 확인할 수 있습니다.
---
@@ -77,4 +77,4 @@ $ pip install fastapi[all]
하지만 (지금 읽고 있는) **자습서 - 사용자 안내서**를 먼저 읽는게 좋습니다.
-**자습서 - 사용자 안내서**만으로 완전한 애플리케이션을 구축한 다음, **고급 사용자 안내서**의 몇 가지 추가 아이디어를 사용하여 필요에 따라 다양한 방식으로 확장할 수 있도록 설계되었습니다.
+**자습서 - 사용자 안내서**만으로도 완전한 애플리케이션을 구축할 수 있으며, 필요에 따라 **고급 사용자 안내서**에서 제공하는 몇 가지 추가적인 기능을 사용하여 다양한 방식으로 확장할 수 있도록 설계되었습니다.
From cace5a79f77c7518eecb92ab1909a7d14cf466ff Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 Dec 2021 15:33:09 +0000
Subject: [PATCH 88/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index d37959dcc..efb84de47 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Fix Korean translation for `docs/ko/docs/tutorial/index.md`. PR [#4193](https://github.com/tiangolo/fastapi/pull/4193) by [@kimjaeyoonn](https://github.com/kimjaeyoonn).
* 🔧 Add CryptAPI sponsor. PR [#4264](https://github.com/tiangolo/fastapi/pull/4264) by [@tiangolo](https://github.com/tiangolo).
* 📝 Update `docs/tutorial/dependencies/classes-as-dependencies`: Add type of query parameters in a description of `Classes as dependencies`. PR [#4015](https://github.com/tiangolo/fastapi/pull/4015) by [@0417taehyun](https://github.com/0417taehyun).
* 🌐 Add French translation for Tutorial - First steps. PR [#3455](https://github.com/tiangolo/fastapi/pull/3455) by [@Smlep](https://github.com/Smlep).
From 446d194c4675e8b3e0f6315dce31af22a229aeca Mon Sep 17 00:00:00 2001
From: daehyeon kim <87962045+DevDae@users.noreply.github.com>
Date: Thu, 9 Dec 2021 00:37:30 +0900
Subject: [PATCH 89/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Korean=20translation?=
=?UTF-8?q?=20for=20`docs/ko/docs/deployment/versions.md`=20(#4121)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
---
docs/ko/docs/deployment/versions.md | 88 +++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
create mode 100644 docs/ko/docs/deployment/versions.md
diff --git a/docs/ko/docs/deployment/versions.md b/docs/ko/docs/deployment/versions.md
new file mode 100644
index 000000000..4c1bcdc2e
--- /dev/null
+++ b/docs/ko/docs/deployment/versions.md
@@ -0,0 +1,88 @@
+# FastAPI 버전들에 대하여
+
+**FastAPI** 는 이미 많은 응용 프로그램과 시스템들을 만드는데 사용되고 있습니다. 그리고 100%의 테스트 정확성을 가지고 있습니다. 하지만 이것은 아직까지도 빠르게 발전하고 있습니다.
+
+새로운 특징들이 빈번하게 추가되고, 오류들이 지속적으로 수정되고 있습니다. 그리고 코드가 계속적으로 향상되고 있습니다.
+
+이것이 아직도 최신 버전이 `0.x.x`인 이유입니다. 이것은 각각의 버전들이 잠재적으로 변할 수 있다는 것을 보여줍니다. 이는 유의적 버전 관습을 따릅니다.
+
+지금 바로 **FastAPI**로 응용 프로그램을 만들 수 있습니다. 이때 (아마 지금까지 그래 왔던 것처럼), 사용하는 버전이 코드와 잘 맞는지 확인해야합니다.
+
+## `fastapi` 버전을 표시
+
+가장 먼저 해야할 것은 응용 프로그램이 잘 작동하는 가장 최신의 구체적인 **FastAPI** 버전을 표시하는 것입니다.
+
+예를 들어, 응용 프로그램에 `0.45.0` 버전을 사용했다고 가정합니다.
+
+만약에 `requirements.txt` 파일을 사용했다면, 다음과 같이 버전을 명세할 수 있습니다:
+
+```txt
+fastapi==0.45.0
+```
+
+이것은 `0.45.0` 버전을 사용했다는 것을 의미합니다.
+
+또는 다음과 같이 표시할 수 있습니다:
+
+```txt
+fastapi>=0.45.0,<0.46.0
+```
+
+이것은 `0.45.0` 버전과 같거나 높으면서 `0.46.0` 버전 보다는 낮은 버전을 사용했다는 것을 의미합니다. 예를 들어, `0.45.2` 버전과 같은 경우는 해당 조건을 만족합니다.
+
+만약에 Poetry, Pipenv, 또는 그밖의 다양한 설치 도구를 사용한다면, 패키지에 구체적인 버전을 정의할 수 있는 방법을 가지고 있을 것입니다.
+
+## 이용가능한 버전들
+
+[Release Notes](../release-notes.md){.internal-link target=_blank}를 통해 사용할 수 있는 버전들을 확인할 수 있습니다.(예를 들어, 가장 최신의 버전을 확인할 수 있습니다.)
+
+
+## 버전들에 대해
+
+유의적 버전 관습을 따라서, `1.0.0` 이하의 모든 버전들은 잠재적으로 급변할 수 있습니다.
+
+FastAPI는 오류를 수정하고, 일반적인 변경사항을 위해 "패치"버전의 관습을 따릅니다.
+
+!!! tip "팁"
+ 여기서 말하는 "패치"란 버전의 마지막 숫자로, 예를 들어 `0.2.3` 버전에서 "패치"는 `3`을 의미합니다.
+
+따라서 다음과 같이 버전을 표시할 수 있습니다:
+
+```txt
+fastapi>=0.45.0,<0.46.0
+```
+
+수정된 사항과 새로운 요소들이 "마이너" 버전에 추가되었습니다.
+
+!!! tip "팁"
+ "마이너"란 버전 넘버의 가운데 숫자로, 예를 들어서 `0.2.3`의 "마이너" 버전은 `2`입니다.
+
+## FastAPI 버전의 업그레이드
+
+응용 프로그램을 검사해야합니다.
+
+(Starlette 덕분에), **FastAPI** 를 이용하여 굉장히 쉽게 할 수 있습니다. [Testing](../tutorial/testing.md){.internal-link target=_blank}문서를 확인해 보십시오:
+
+검사를 해보고 난 후에, **FastAPI** 버전을 더 최신으로 업그레이드 할 수 있습니다. 그리고 코드들이 테스트에 정상적으로 작동하는지 확인을 해야합니다.
+
+만약에 모든 것이 정상 작동하거나 필요한 부분을 변경하고, 모든 검사를 통과한다면, 새로운 버전의 `fastapi`를 표시할 수 있습니다.
+
+## Starlette에 대해
+
+`starlette`의 버전은 표시할 수 없습니다.
+
+서로다른 버전의 **FastAPI**가 구체적이고 새로운 버전의 Starlette을 사용할 것입니다.
+
+그러므로 **FastAPI**가 알맞은 Starlette 버전을 사용하도록 하십시오.
+
+## Pydantic에 대해
+
+Pydantic은 **FastAPI** 를 위한 검사를 포함하고 있습니다. 따라서, 새로운 버전의 Pydantic(`1.0.0`이상)은 항상 FastAPI와 호환됩니다.
+
+작업을 하고 있는 `1.0.0` 이상의 모든 버전과 `2.0.0` 이하의 Pydantic 버전을 표시할 수 있습니다.
+
+예를 들어 다음과 같습니다:
+
+```txt
+pydantic>=1.2.0,<2.0.0
+```
From 8e416875ce98e89b05da53cf95fccd40818c903f Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 Dec 2021 15:38:10 +0000
Subject: [PATCH 90/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index efb84de47..0f0edaa7b 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Korean translation for `docs/ko/docs/deployment/versions.md`. PR [#4121](https://github.com/tiangolo/fastapi/pull/4121) by [@DevDae](https://github.com/DevDae).
* 🌐 Fix Korean translation for `docs/ko/docs/tutorial/index.md`. PR [#4193](https://github.com/tiangolo/fastapi/pull/4193) by [@kimjaeyoonn](https://github.com/kimjaeyoonn).
* 🔧 Add CryptAPI sponsor. PR [#4264](https://github.com/tiangolo/fastapi/pull/4264) by [@tiangolo](https://github.com/tiangolo).
* 📝 Update `docs/tutorial/dependencies/classes-as-dependencies`: Add type of query parameters in a description of `Classes as dependencies`. PR [#4015](https://github.com/tiangolo/fastapi/pull/4015) by [@0417taehyun](https://github.com/0417taehyun).
From a5d697b9b56443ac1abfc09f358e9eb56031422e Mon Sep 17 00:00:00 2001
From: Spike
Date: Thu, 9 Dec 2021 00:41:26 +0900
Subject: [PATCH 91/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Korean=20translation?=
=?UTF-8?q?=20for=20Tutorial=20-=20Path=20Parameters=20and=20Numeric=20Val?=
=?UTF-8?q?idations=20(#2432)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../path-params-numeric-validations.md | 122 ++++++++++++++++++
docs/ko/mkdocs.yml | 1 +
2 files changed, 123 insertions(+)
create mode 100644 docs/ko/docs/tutorial/path-params-numeric-validations.md
diff --git a/docs/ko/docs/tutorial/path-params-numeric-validations.md b/docs/ko/docs/tutorial/path-params-numeric-validations.md
new file mode 100644
index 000000000..abb9d03db
--- /dev/null
+++ b/docs/ko/docs/tutorial/path-params-numeric-validations.md
@@ -0,0 +1,122 @@
+# 경로 매개변수와 숫자 검증
+
+`Query`를 사용하여 쿼리 매개변수에 더 많은 검증과 메타데이터를 선언하는 방법과 동일하게 `Path`를 사용하여 경로 매개변수에 검증과 메타데이터를 같은 타입으로 선언할 수 있습니다.
+
+## 경로 임포트
+
+먼저 `fastapi`에서 `Path`를 임포트합니다:
+
+```Python hl_lines="3"
+{!../../../docs_src/path_params_numeric_validations/tutorial001.py!}
+```
+
+## 메타데이터 선언
+
+`Query`에 동일한 매개변수를 선언할 수 있습니다.
+
+예를 들어, `title` 메타데이터 값을 경로 매개변수 `item_id`에 선언하려면 다음과 같이 입력할 수 있습니다:
+
+```Python hl_lines="10"
+{!../../../docs_src/path_params_numeric_validations/tutorial001.py!}
+```
+
+!!! note "참고"
+ 경로 매개변수는 경로의 일부여야 하므로 언제나 필수적입니다.
+
+ 즉, `...`로 선언해서 필수임을 나타내는게 좋습니다.
+
+ 그럼에도 `None`으로 선언하거나 기본값을 지정할지라도 아무 영향을 끼치지 않으며 언제나 필수입니다.
+
+## 필요한 경우 매개변수 정렬하기
+
+`str` 형인 쿼리 매개변수 `q`를 필수로 선언하고 싶다고 해봅시다.
+
+해당 매개변수에 대해 아무런 선언을 할 필요가 없으므로 `Query`를 정말로 써야할 필요는 없습니다.
+
+하지만 `item_id` 경로 매개변수는 여전히 `Path`를 사용해야 합니다.
+
+파이썬은 "기본값"이 없는 값 앞에 "기본값"이 있는 값을 입력하면 불평합니다.
+
+그러나 매개변수들을 재정렬함으로써 기본값(쿼리 매개변수 `q`)이 없는 값을 처음 부분에 위치 할 수 있습니다.
+
+**FastAPI**에서는 중요하지 않습니다. 이름, 타입 그리고 선언구(`Query`, `Path` 등)로 매개변수를 감지하며 순서는 신경 쓰지 않습니다.
+
+따라서 함수를 다음과 같이 선언 할 수 있습니다:
+
+```Python hl_lines="8"
+{!../../../docs_src/path_params_numeric_validations/tutorial002.py!}
+```
+
+## 필요한 경우 매개변수 정렬하기, 트릭
+
+`Query`나 아무런 기본값으로도 `q` 경로 매개변수를 선언하고 싶지 않지만 `Path`를 사용하여 경로 매개변수를 `item_id` 다른 순서로 선언하고 싶다면, 파이썬은 이를 위한 작고 특별한 문법이 있습니다.
+
+`*`를 함수의 첫 번째 매개변수로 전달하세요.
+
+파이썬은 `*`으로 아무런 행동도 하지 않지만, 따르는 매개변수들은 kwargs로도 알려진 키워드 인자(키-값 쌍)여야 함을 인지합니다. 기본값을 가지고 있지 않더라도 그렇습니다.
+
+```Python hl_lines="8"
+{!../../../docs_src/path_params_numeric_validations/tutorial003.py!}
+```
+
+## 숫자 검증: 크거나 같음
+
+`Query`와 `Path`(나중에 볼 다른 것들도)를 사용하여 문자열 뿐만 아니라 숫자의 제약을 선언할 수 있습니다.
+
+여기서 `ge=1`인 경우, `item_id`는 `1`보다 "크거나(`g`reater) 같은(`e`qual)" 정수형 숫자여야 합니다.
+
+```Python hl_lines="8"
+{!../../../docs_src/path_params_numeric_validations/tutorial004.py!}
+```
+
+## 숫자 검증: 크거나 같음 및 작거나 같음
+
+동일하게 적용됩니다:
+
+* `gt`: 크거나(`g`reater `t`han)
+* `le`: 작거나 같은(`l`ess than or `e`qual)
+
+```Python hl_lines="9"
+{!../../../docs_src/path_params_numeric_validations/tutorial005.py!}
+```
+
+## 숫자 검증: 부동소수, 크거나 및 작거나
+
+숫자 검증은 `float` 값에도 동작합니다.
+
+여기에서 ge뿐만 아니라 gt를 선언 할 수있는 것이 중요해집니다. 예를 들어 필요한 경우, 값이 `1`보다 작더라도 반드시 `0`보다 커야합니다.
+
+즉, `0.5`는 유효한 값입니다. 그러나 `0.0` 또는 `0`은 그렇지 않습니다.
+
+lt 역시 마찬가지입니다.
+
+```Python hl_lines="11"
+{!../../../docs_src/path_params_numeric_validations/tutorial006.py!}
+```
+
+## 요약
+
+`Query`, `Path`(아직 보지 못한 다른 것들도)를 사용하면 [쿼리 매개변수와 문자열 검증](query-params-str-validations.md){.internal-link target=_blank}에서와 마찬가지로 메타데이터와 문자열 검증을 선언할 수 있습니다.
+
+그리고 숫자 검증 또한 선언할 수 있습니다:
+
+* `gt`: 크거나(`g`reater `t`han)
+* `ge`: 크거나 같은(`g`reater than or `e`qual)
+* `lt`: 작거나(`l`ess `t`han)
+* `le`: 작거나 같은(`l`ess than or `e`qual)
+
+!!! info "정보"
+ `Query`, `Path`, 그리고 나중에게 보게될 것들은 (여러분이 사용할 필요가 없는) 공통 `Param` 클래스의 서브 클래스입니다.
+
+ 그리고 이들 모두는 여태까지 본 추가 검증과 메타데이터의 동일한 모든 매개변수를 공유합니다.
+
+!!! note "기술 세부사항"
+ `fastapi`에서 `Query`, `Path` 등을 임포트 할 때, 이것들은 실제로 함수입니다.
+
+ 호출되면 동일한 이름의 클래스의 인스턴스를 반환합니다.
+
+ 즉, 함수인 `Query`를 임포트한 겁니다. 그리고 호출하면 `Query`라는 이름을 가진 클래스의 인스턴스를 반환합니다.
+
+ 편집기에서 타입에 대한 오류를 표시하지 않도록 하기 위해 (클래스를 직접 사용하는 대신) 이러한 함수들이 있습니다.
+
+ 이렇게 하면 오류를 무시하기 위한 사용자 설정을 추가하지 않고도 일반 편집기와 코딩 도구를 사용할 수 있습니다.
diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml
index 0bf1a9713..0cd0e2f9f 100644
--- a/docs/ko/mkdocs.yml
+++ b/docs/ko/mkdocs.yml
@@ -61,6 +61,7 @@ nav:
- tutorial/path-params.md
- tutorial/query-params.md
- tutorial/header-params.md
+ - tutorial/path-params-numeric-validations.md
markdown_extensions:
- toc:
permalink: true
From da69a1c4c0460ab475e3d2ad351bac3a12bf6690 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 Dec 2021 15:42:12 +0000
Subject: [PATCH 92/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 0f0edaa7b..907df6430 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Korean translation for Tutorial - Path Parameters and Numeric Validations. PR [#2432](https://github.com/tiangolo/fastapi/pull/2432) by [@hard-coders](https://github.com/hard-coders).
* 🌐 Add Korean translation for `docs/ko/docs/deployment/versions.md`. PR [#4121](https://github.com/tiangolo/fastapi/pull/4121) by [@DevDae](https://github.com/DevDae).
* 🌐 Fix Korean translation for `docs/ko/docs/tutorial/index.md`. PR [#4193](https://github.com/tiangolo/fastapi/pull/4193) by [@kimjaeyoonn](https://github.com/kimjaeyoonn).
* 🔧 Add CryptAPI sponsor. PR [#4264](https://github.com/tiangolo/fastapi/pull/4264) by [@tiangolo](https://github.com/tiangolo).
From 461e0d4cce8542cbed53791fbc80f5731883c061 Mon Sep 17 00:00:00 2001
From: Kwang Soo Jeong
Date: Thu, 9 Dec 2021 00:43:31 +0900
Subject: [PATCH 93/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Korean=20translation?=
=?UTF-8?q?=20for=20Tutorial=20-=20JSON=20Compatible=20Encoder=20(#3152)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/ko/docs/tutorial/encoder.md | 34 ++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 docs/ko/docs/tutorial/encoder.md
diff --git a/docs/ko/docs/tutorial/encoder.md b/docs/ko/docs/tutorial/encoder.md
new file mode 100644
index 000000000..8b5fdb8b7
--- /dev/null
+++ b/docs/ko/docs/tutorial/encoder.md
@@ -0,0 +1,34 @@
+# JSON 호환 가능 인코더
+
+데이터 유형(예: Pydantic 모델)을 JSON과 호환된 형태로 반환해야 하는 경우가 있습니다. (예: `dict`, `list` 등)
+
+예를 들면, 데이터베이스에 저장해야하는 경우입니다.
+
+이를 위해, **FastAPI** 에서는 `jsonable_encoder()` 함수를 제공합니다.
+
+## `jsonable_encoder` 사용
+
+JSON 호환 가능 데이터만 수신하는 `fake_db` 데이터베이스가 존재한다고 가정하겠습니다.
+
+예를 들면, `datetime` 객체는 JSON과 호환되는 데이터가 아니므로 이 데이터는 받아들여지지 않습니다.
+
+따라서 `datetime` 객체는 ISO format 데이터를 포함하는 `str`로 변환되어야 합니다.
+
+같은 방식으로 이 데이터베이스는 Pydantic 모델(속성이 있는 객체)을 받지 않고, `dict` 만을 받습니다.
+
+이를 위해 `jsonable_encoder` 를 사용할 수 있습니다.
+
+Pydantic 모델과 같은 객체를 받고 JSON 호환 가능한 버전으로 반환합니다:
+
+```Python hl_lines="5 22"
+{!../../../docs_src/encoder/tutorial001.py!}
+```
+
+이 예시는 Pydantic 모델을 `dict`로, `datetime` 형식을 `str`로 변환합니다.
+
+이렇게 호출한 결과는 파이썬 표준인 `json.dumps()`로 인코딩 할 수 있습니다.
+
+길이가 긴 문자열 형태의 JSON 형식(문자열)의 데이터가 들어있는 상황에서는 `str`로 반환하지 않습니다. JSON과 모두 호환되는 값과 하위 값이 있는 Python 표준 데이터 구조 (예: `dict`)를 반환합니다.
+
+!!! note "참고"
+ 실제로 `jsonable_encoder`는 **FastAPI** 에서 내부적으로 데이터를 변환하는 데 사용하지만, 다른 많은 곳에서도 이는 유용합니다.
From dd463d0dc2d48777bd9149d6938a672e8f81b203 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 Dec 2021 15:44:10 +0000
Subject: [PATCH 94/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 907df6430..31034c847 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Korean translation for Tutorial - JSON Compatible Encoder. PR [#3152](https://github.com/tiangolo/fastapi/pull/3152) by [@NEONKID](https://github.com/NEONKID).
* 🌐 Add Korean translation for Tutorial - Path Parameters and Numeric Validations. PR [#2432](https://github.com/tiangolo/fastapi/pull/2432) by [@hard-coders](https://github.com/hard-coders).
* 🌐 Add Korean translation for `docs/ko/docs/deployment/versions.md`. PR [#4121](https://github.com/tiangolo/fastapi/pull/4121) by [@DevDae](https://github.com/DevDae).
* 🌐 Fix Korean translation for `docs/ko/docs/tutorial/index.md`. PR [#4193](https://github.com/tiangolo/fastapi/pull/4193) by [@kimjaeyoonn](https://github.com/kimjaeyoonn).
From 39dbee9d563967aeab15637974d40a374e6df85c Mon Sep 17 00:00:00 2001
From: Nina Hwang <79563565+NinaHwang@users.noreply.github.com>
Date: Thu, 9 Dec 2021 00:45:37 +0900
Subject: [PATCH 95/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Korean=20translation?=
=?UTF-8?q?=20for=20`docs/tutorial/response-status-code.md`=20(#3742)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez
---
docs/ko/docs/tutorial/response-status-code.md | 89 +++++++++++++++++++
docs/ko/mkdocs.yml | 1 +
2 files changed, 90 insertions(+)
create mode 100644 docs/ko/docs/tutorial/response-status-code.md
diff --git a/docs/ko/docs/tutorial/response-status-code.md b/docs/ko/docs/tutorial/response-status-code.md
new file mode 100644
index 000000000..d201867a1
--- /dev/null
+++ b/docs/ko/docs/tutorial/response-status-code.md
@@ -0,0 +1,89 @@
+# 응답 상태 코드
+
+응답 모델과 같은 방법으로, 어떤 *경로 작동*이든 `status_code` 매개변수를 사용하여 응답에 대한 HTTP 상태 코드를 선언할 수 있습니다.
+
+* `@app.get()`
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+* 기타
+
+```Python hl_lines="6"
+{!../../../docs_src/response_status_code/tutorial001.py!}
+```
+
+!!! note "참고"
+ `status_code` 는 "데코레이터" 메소드(`get`, `post` 등)의 매개변수입니다. 모든 매개변수들과 본문처럼 *경로 작동 함수*가 아닙니다.
+
+`status_code` 매개변수는 HTTP 상태 코드를 숫자로 입력받습니다.
+
+!!! info "정보"
+ `status_code` 는 파이썬의 `http.HTTPStatus` 와 같은 `IntEnum` 을 입력받을 수도 있습니다.
+
+`status_code` 매개변수는:
+
+* 응답에서 해당 상태 코드를 반환합니다.
+* 상태 코드를 OpenAPI 스키마(및 사용자 인터페이스)에 문서화 합니다.
+
+
+
+!!! note "참고"
+ 어떤 응답 코드들은 해당 응답에 본문이 없다는 것을 의미하기도 합니다 (다음 항목 참고).
+
+ 이에 따라 FastAPI는 응답 본문이 없음을 명시하는 OpenAPI를 생성합니다.
+
+## HTTP 상태 코드에 대하여
+
+!!! note "참고"
+ 만약 HTTP 상태 코드에 대하여 이미 알고있다면, 다음 항목으로 넘어가십시오.
+
+HTTP는 세자리의 숫자 상태 코드를 응답의 일부로 전송합니다.
+
+이 상태 코드들은 각자를 식별할 수 있도록 지정된 이름이 있으나, 중요한 것은 숫자 코드입니다.
+
+요약하자면:
+
+* `**1xx**` 상태 코드는 "정보"용입니다. 이들은 직접적으로는 잘 사용되지는 않습니다. 이 상태 코드를 갖는 응답들은 본문을 가질 수 없습니다.
+* `**2xx**` 상태 코드는 "성공적인" 응답을 위해 사용됩니다. 가장 많이 사용되는 유형입니다.
+ * `200` 은 디폴트 상태 코드로, 모든 것이 "성공적임"을 의미합니다.
+ * 다른 예로는 `201` "생성됨"이 있습니다. 일반적으로 데이터베이스에 새로운 레코드를 생성한 후 사용합니다.
+ * 단, `204` "내용 없음"은 특별한 경우입니다. 이것은 클라이언트에게 반환할 내용이 없는 경우 사용합니다. 따라서 응답은 본문을 가질 수 없습니다.
+* `**3xx**` 상태 코드는 "리다이렉션"용입니다. 본문을 가질 수 없는 `304` "수정되지 않음"을 제외하고, 이 상태 코드를 갖는 응답에는 본문이 있을 수도, 없을 수도 있습니다.
+* `**4xx**` 상태 코드는 "클라이언트 오류" 응답을 위해 사용됩니다. 이것은 아마 가장 많이 사용하게 될 두번째 유형입니다.
+ * 일례로 `404` 는 "찾을 수 없음" 응답을 위해 사용합니다.
+ * 일반적인 클라이언트 오류의 경우 `400` 을 사용할 수 있습니다.
+* `**5xx**` 상태 코드는 서버 오류에 사용됩니다. 이것들을 직접 사용할 일은 거의 없습니다. 응용 프로그램 코드나 서버의 일부에서 문제가 발생하면 자동으로 이들 상태 코드 중 하나를 반환합니다.
+
+!!! tip "팁"
+ 각각의 상태 코드와 이들이 의미하는 내용에 대해 더 알고싶다면 MDN HTTP 상태 코드에 관한 문서 를 확인하십시오.
+
+## 이름을 기억하는 쉬운 방법
+
+상기 예시 참고:
+
+```Python hl_lines="6"
+{!../../../docs_src/response_status_code/tutorial001.py!}
+```
+
+`201` 은 "생성됨"를 의미하는 상태 코드입니다.
+
+하지만 모든 상태 코드들이 무엇을 의미하는지 외울 필요는 없습니다.
+
+`fastapi.status` 의 편의 변수를 사용할 수 있습니다.
+
+```Python hl_lines="1 6"
+{!../../../docs_src/response_status_code/tutorial002.py!}
+```
+
+이것은 단순히 작업을 편리하게 하기 위한 것으로, HTTP 상태 코드와 동일한 번호를 갖고있지만, 이를 사용하면 편집기의 자동완성 기능을 사용할 수 있습니다:
+
+
+
+!!! note "기술적 세부사항"
+ `from starlette import status` 역시 사용할 수 있습니다.
+
+ **FastAPI**는 개발자인 당신의 편의를 위해 `fastapi.status` 와 동일한 `starlette.status` 도 제공합니다. 하지만 이것은 Starlette로부터 직접 제공됩니다.
+
+## 기본값 변경
+
+추후 여기서 선언하는 기본 상태 코드가 아닌 다른 상태 코드를 반환하는 방법을 [숙련된 사용자 지침서](https://fastapi.tiangolo.com/ko/advanced/response-change-status-code/){.internal-link target=_blank}에서 확인할 수 있습니다.
diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml
index 0cd0e2f9f..dd2d6a7ac 100644
--- a/docs/ko/mkdocs.yml
+++ b/docs/ko/mkdocs.yml
@@ -62,6 +62,7 @@ nav:
- tutorial/query-params.md
- tutorial/header-params.md
- tutorial/path-params-numeric-validations.md
+ - tutorial/response-status-code.md
markdown_extensions:
- toc:
permalink: true
From fb9c4b31b91fe9f9601302046997e007fe35ef95 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 8 Dec 2021 15:46:19 +0000
Subject: [PATCH 96/98] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 31034c847..ca7553855 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -2,6 +2,7 @@
## Latest Changes
+* 🌐 Add Korean translation for `docs/tutorial/response-status-code.md`. PR [#3742](https://github.com/tiangolo/fastapi/pull/3742) by [@NinaHwang](https://github.com/NinaHwang).
* 🌐 Add Korean translation for Tutorial - JSON Compatible Encoder. PR [#3152](https://github.com/tiangolo/fastapi/pull/3152) by [@NEONKID](https://github.com/NEONKID).
* 🌐 Add Korean translation for Tutorial - Path Parameters and Numeric Validations. PR [#2432](https://github.com/tiangolo/fastapi/pull/2432) by [@hard-coders](https://github.com/hard-coders).
* 🌐 Add Korean translation for `docs/ko/docs/deployment/versions.md`. PR [#4121](https://github.com/tiangolo/fastapi/pull/4121) by [@DevDae](https://github.com/DevDae).
From 10e3a02582cfbf58b9c93dd782b4c2cb7a615da5 Mon Sep 17 00:00:00 2001
From: Leandro de Souza <85115541+leandrodesouzadev@users.noreply.github.com>
Date: Wed, 8 Dec 2021 12:50:35 -0300
Subject: [PATCH 97/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20portuguese=20transla?=
=?UTF-8?q?tion=20for=20`docs/tutorial/query-params-str-validations.md`=20?=
=?UTF-8?q?(#3965)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Mário Victor Ribeiro Silva
Co-authored-by: Leandro de Souza
Co-authored-by: Sebastián Ramírez
---
.../tutorial/query-params-str-validations.md | 303 ++++++++++++++++++
docs/pt/mkdocs.yml | 1 +
2 files changed, 304 insertions(+)
create mode 100644 docs/pt/docs/tutorial/query-params-str-validations.md
diff --git a/docs/pt/docs/tutorial/query-params-str-validations.md b/docs/pt/docs/tutorial/query-params-str-validations.md
new file mode 100644
index 000000000..baac5f493
--- /dev/null
+++ b/docs/pt/docs/tutorial/query-params-str-validations.md
@@ -0,0 +1,303 @@
+# Parâmetros de consulta e validações de texto
+
+O **FastAPI** permite que você declare informações adicionais e validações aos seus parâmetros.
+
+Vamos utilizar essa aplicação como exemplo:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial001.py!}
+```
+
+O parâmetro de consulta `q` é do tipo `Optional[str]`, o que significa que é do tipo `str` mas que também pode ser `None`, e de fato, o valor padrão é `None`, então o FastAPI saberá que não é obrigatório.
+
+!!! note "Observação"
+ O FastAPI saberá que o valor de `q` não é obrigatório por causa do valor padrão `= None`.
+
+ O `Optional` em `Optional[str]` não é usado pelo FastAPI, mas permitirá que seu editor lhe dê um melhor suporte e detecte erros.
+
+## Validação adicional
+
+Nós iremos forçar que mesmo o parâmetro `q` seja opcional, sempre que informado, **seu tamanho não exceda 50 caracteres**.
+
+### Importe `Query`
+
+Para isso, primeiro importe `Query` de `fastapi`:
+
+```Python hl_lines="3"
+{!../../../docs_src/query_params_str_validations/tutorial002.py!}
+```
+
+## Use `Query` como o valor padrão
+
+Agora utilize-o como valor padrão do seu parâmetro, definindo o parâmetro `max_length` para 50:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial002.py!}
+```
+
+Note que substituímos o valor padrão de `None` para `Query(None)`, o primeiro parâmetro de `Query` serve para o mesmo propósito: definir o valor padrão do parâmetro.
+
+Então:
+
+```Python
+q: Optional[str] = Query(None)
+```
+
+...Torna o parâmetro opcional, da mesma maneira que:
+
+```Python
+q: Optional[str] = None
+```
+
+Mas o declara explicitamente como um parâmetro de consulta.
+
+!!! info "Informação"
+ Tenha em mente que o FastAPI se preocupa com a parte:
+
+ ```Python
+ = None
+ ```
+
+ Ou com:
+
+ ```Python
+ = Query(None)
+ ```
+
+ E irá utilizar o `None` para detectar que o parâmetro de consulta não é obrigatório.
+
+ O `Optional` é apenas para permitir que seu editor de texto lhe dê um melhor suporte.
+
+Então, podemos passar mais parâmetros para `Query`. Neste caso, o parâmetro `max_length` que se aplica a textos:
+
+```Python
+q: str = Query(None, max_length=50)
+```
+
+Isso irá validar os dados, mostrar um erro claro quando os dados forem inválidos, e documentar o parâmetro na *operação de rota* do esquema OpenAPI..
+
+## Adicionando mais validações
+
+Você também pode incluir um parâmetro `min_length`:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial003.py!}
+```
+
+## Adicionando expressões regulares
+
+Você pode definir uma expressão regular que combine com um padrão esperado pelo parâmetro:
+
+```Python hl_lines="10"
+{!../../../docs_src/query_params_str_validations/tutorial004.py!}
+```
+
+Essa expressão regular específica verifica se o valor recebido no parâmetro:
+
+* `^`: Inicia com os seguintes caracteres, ou seja, não contém caracteres anteriores.
+* `fixedquery`: contém o valor exato `fixedquery`.
+* `$`: termina aqui, não contém nenhum caractere após `fixedquery`.
+
+Se você se sente perdido com todo esse assunto de **"expressão regular"**, não se preocupe. Esse é um assunto complicado para a maioria das pessoas. Você ainda pode fazer muitas coisas sem utilizar expressões regulares.
+
+Mas assim que você precisar e já tiver aprendido sobre, saiba que você poderá usá-las diretamente no **FastAPI**.
+
+## Valores padrão
+
+Da mesma maneira que você utiliza `None` como o primeiro argumento para ser utilizado como um valor padrão, você pode usar outros valores.
+
+Vamos dizer que você queira que o parâmetro de consulta `q` tenha um `min_length` de `3`, e um valor padrão de `"fixedquery"`, então declararíamos assim:
+
+```Python hl_lines="7"
+{!../../../docs_src/query_params_str_validations/tutorial005.py!}
+```
+
+!!! note "Observação"
+ O parâmetro torna-se opcional quando possui um valor padrão.
+
+## Torne-o obrigatório
+
+Quando você não necessita de validações ou de metadados adicionais, podemos fazer com que o parâmetro de consulta `q` seja obrigatório por não declarar um valor padrão, dessa forma:
+
+```Python
+q: str
+```
+
+em vez desta:
+
+```Python
+q: Optional[str] = None
+```
+
+Mas agora nós o estamos declarando como `Query`, conforme abaixo:
+
+```Python
+q: Optional[str] = Query(None, min_length=3)
+```
+
+Então, quando você precisa declarar um parâmetro obrigatório utilizando o `Query`, você pode utilizar `...` como o primeiro argumento:
+
+```Python hl_lines="7"
+{!../../../docs_src/query_params_str_validations/tutorial006.py!}
+```
+
+!!! info "Informação"
+ Se você nunca viu os `...` antes: é um valor único especial, faz parte do Python e é chamado "Ellipsis".
+
+Dessa forma o **FastAPI** saberá que o parâmetro é obrigatório.
+
+## Lista de parâmetros de consulta / múltiplos valores
+
+Quando você declara explicitamente um parâmetro com `Query` você pode declará-lo para receber uma lista de valores, ou podemos dizer, que irá receber mais de um valor.
+
+Por exemplo, para declarar que o parâmetro `q` pode aparecer diversas vezes na URL, você escreveria:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial011.py!}
+```
+
+Então, com uma URL assim:
+
+```
+http://localhost:8000/items/?q=foo&q=bar
+```
+
+você receberá os múltiplos *parâmetros de consulta* `q` com os valores (`foo` e `bar`) em uma lista (`list`) Python dentro da *função de operação de rota*, no *parâmetro da função* `q`.
+
+Assim, a resposta para essa URL seria:
+
+```JSON
+{
+ "q": [
+ "foo",
+ "bar"
+ ]
+}
+```
+
+!!! tip "Dica"
+ Para declarar um parâmetro de consulta com o tipo `list`, como no exemplo acima, você precisa usar explicitamente o `Query`, caso contrário será interpretado como um corpo da requisição.
+
+A documentação interativa da API irá atualizar de acordo, permitindo múltiplos valores:
+
+
+
+### Lista de parâmetros de consulta / múltiplos valores por padrão
+
+E você também pode definir uma lista (`list`) de valores padrão caso nenhum seja informado:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial012.py!}
+```
+
+Se você for até:
+
+```
+http://localhost:8000/items/
+```
+
+O valor padrão de `q` será: `["foo", "bar"]` e sua resposta será:
+
+```JSON
+{
+ "q": [
+ "foo",
+ "bar"
+ ]
+}
+```
+
+#### Usando `list`
+
+Você também pode utilizar o tipo `list` diretamente em vez de `List[str]`:
+
+```Python hl_lines="7"
+{!../../../docs_src/query_params_str_validations/tutorial013.py!}
+```
+
+!!! note "Observação"
+ Tenha em mente que neste caso, o FastAPI não irá validar os conteúdos da lista.
+
+ Por exemplo, um `List[int]` iria validar (e documentar) que os contéudos da lista são números inteiros. Mas apenas `list` não.
+
+## Declarando mais metadados
+
+Você pode adicionar mais informações sobre o parâmetro.
+
+Essa informações serão inclusas no esquema do OpenAPI e utilizado pela documentação interativa e ferramentas externas.
+
+!!! note "Observação"
+ Tenha em mente que cada ferramenta oferece diferentes níveis de suporte ao OpenAPI.
+
+ Algumas delas não exibem todas as informações extras que declaramos, ainda que na maioria dos casos, esses recursos estão planejados para desenvolvimento.
+
+Você pode adicionar um `title`:
+
+```Python hl_lines="10"
+{!../../../docs_src/query_params_str_validations/tutorial007.py!}
+```
+
+E uma `description`:
+
+```Python hl_lines="13"
+{!../../../docs_src/query_params_str_validations/tutorial008.py!}
+```
+
+## Apelidos (alias) de parâmetros
+
+Imagine que você queira que um parâmetro tenha o nome `item-query`.
+
+Desta maneira:
+
+```
+http://127.0.0.1:8000/items/?item-query=foobaritems
+```
+
+Mas o nome `item-query` não é um nome de váriavel válido no Python.
+
+O que mais se aproxima é `item_query`.
+
+Mas ainda você precisa que o nome seja exatamente `item-query`...
+
+Então você pode declarar um `alias`, e esse apelido (alias) que será utilizado para encontrar o valor do parâmetro:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial009.py!}
+```
+
+## Parâmetros descontinuados
+
+Agora vamos dizer que você não queria mais utilizar um parâmetro.
+
+Você tem que deixá-lo ativo por um tempo, já que existem clientes o utilizando. Mas você quer que a documentação deixe claro que este parâmetro será descontinuado.
+
+Então você passa o parâmetro `deprecated=True` para `Query`:
+
+```Python hl_lines="18"
+{!../../../docs_src/query_params_str_validations/tutorial010.py!}
+```
+
+Na documentação aparecerá assim:
+
+
+
+## Recapitulando
+
+Você pode adicionar validações e metadados adicionais aos seus parâmetros.
+
+Validações genéricas e metadados:
+
+* `alias`
+* `title`
+* `description`
+* `deprecated`
+
+Validações específicas para textos:
+
+* `min_length`
+* `max_length`
+* `regex`
+
+Nesses exemplos você viu como declarar validações em valores do tipo `str`.
+
+Leia os próximos capítulos para ver como declarar validação de outros tipos, como números.
diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml
index 219f41b81..ea4af852e 100644
--- a/docs/pt/mkdocs.yml
+++ b/docs/pt/mkdocs.yml
@@ -62,6 +62,7 @@ nav:
- tutorial/first-steps.md
- tutorial/path-params.md
- tutorial/body-fields.md
+ - tutorial/query-params-str-validations.md
- Segurança:
- tutorial/security/index.md
- Guia de Usuário Avançado:
From fa5639cb3564a475335f468b1d2d80ae5d8845d0 Mon Sep 17 00:00:00 2001
From: Nina Hwang <79563565+NinaHwang@users.noreply.github.com>
Date: Thu, 9 Dec 2021 00:52:01 +0900
Subject: [PATCH 98/98] =?UTF-8?q?=F0=9F=8C=90=20Add=20Korean=20translation?=
=?UTF-8?q?=20for=20`docs/tutorial/request-files.md`=20(#3743)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Spike
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez
---
docs/ko/docs/tutorial/request-files.md | 144 +++++++++++++++++++++++++
docs/ko/mkdocs.yml | 1 +
2 files changed, 145 insertions(+)
create mode 100644 docs/ko/docs/tutorial/request-files.md
diff --git a/docs/ko/docs/tutorial/request-files.md b/docs/ko/docs/tutorial/request-files.md
new file mode 100644
index 000000000..769a676cd
--- /dev/null
+++ b/docs/ko/docs/tutorial/request-files.md
@@ -0,0 +1,144 @@
+# 파일 요청
+
+`File`을 사용하여 클라이언트가 업로드할 파일들을 정의할 수 있습니다.
+
+!!! info "정보"
+ 업로드된 파일을 전달받기 위해 먼저 `python-multipart`를 설치해야합니다.
+
+ 예시) `pip install python-multipart`.
+
+ 업로드된 파일들은 "폼 데이터"의 형태로 전송되기 때문에 이 작업이 필요합니다.
+
+## `File` 임포트
+
+`fastapi` 에서 `File` 과 `UploadFile` 을 임포트 합니다:
+
+```Python hl_lines="1"
+{!../../../docs_src/request_files/tutorial001.py!}
+```
+
+## `File` 매개변수 정의
+
+`Body` 및 `Form` 과 동일한 방식으로 파일의 매개변수를 생성합니다:
+
+```Python hl_lines="7"
+{!../../../docs_src/request_files/tutorial001.py!}
+```
+
+!!! info "정보"
+ `File` 은 `Form` 으로부터 직접 상속된 클래스입니다.
+
+ 하지만 `fastapi`로부터 `Query`, `Path`, `File` 등을 임포트 할 때, 이것들은 특별한 클래스들을 반환하는 함수라는 것을 기억하기 바랍니다.
+
+!!! tip "팁"
+ File의 본문을 선언할 때, 매개변수가 쿼리 매개변수 또는 본문(JSON) 매개변수로 해석되는 것을 방지하기 위해 `File` 을 사용해야합니다.
+
+파일들은 "폼 데이터"의 형태로 업로드 됩니다.
+
+*경로 작동 함수*의 매개변수를 `bytes` 로 선언하는 경우 **FastAPI**는 파일을 읽고 `bytes` 형태의 내용을 전달합니다.
+
+이것은 전체 내용이 메모리에 저장된다는 것을 의미한다는 걸 염두하기 바랍니다. 이는 작은 크기의 파일들에 적합합니다.
+
+어떤 경우에는 `UploadFile` 을 사용하는 것이 더 유리합니다.
+
+## `File` 매개변수와 `UploadFile`
+
+`File` 매개변수를 `UploadFile` 타입으로 정의합니다:
+
+```Python hl_lines="12"
+{!../../../docs_src/request_files/tutorial001.py!}
+```
+
+`UploadFile` 을 사용하는 것은 `bytes` 과 비교해 다음과 같은 장점이 있습니다:
+
+* "스풀 파일"을 사용합니다.
+ * 최대 크기 제한까지만 메모리에 저장되며, 이를 초과하는 경우 디스크에 저장됩니다.
+* 따라서 이미지, 동영상, 큰 이진코드와 같은 대용량 파일들을 많은 메모리를 소모하지 않고 처리하기에 적합합니다.
+* 업로드 된 파일의 메타데이터를 얻을 수 있습니다.
+* file-like `async` 인터페이스를 갖고 있습니다.
+* file-like object를 필요로하는 다른 라이브러리에 직접적으로 전달할 수 있는 파이썬 `SpooledTemporaryFile` 객체를 반환합니다.
+
+### `UploadFile`
+
+`UploadFile` 은 다음과 같은 어트리뷰트가 있습니다:
+
+* `filename` : 문자열(`str`)로 된 업로드된 파일의 파일명입니다 (예: `myimage.jpg`).
+* `content_type` : 문자열(`str`)로 된 파일 형식(MIME type / media type)입니다 (예: `image/jpeg`).
+* `file` : `SpooledTemporaryFile` (파일류 객체)입니다. 이것은 "파일류" 객체를 필요로하는 다른 라이브러리에 직접적으로 전달할 수 있는 실질적인 파이썬 파일입니다.
+
+`UploadFile` 에는 다음의 `async` 메소드들이 있습니다. 이들은 내부적인 `SpooledTemporaryFile` 을 사용하여 해당하는 파일 메소드를 호출합니다.
+
+* `write(data)`: `data`(`str` 또는 `bytes`)를 파일에 작성합니다.
+* `read(size)`: 파일의 바이트 및 글자의 `size`(`int`)를 읽습니다.
+* `seek(offset)`: 파일 내 `offset`(`int`) 위치의 바이트로 이동합니다.
+ * 예) `await myfile.seek(0)` 를 사용하면 파일의 시작부분으로 이동합니다.
+ * `await myfile.read()` 를 사용한 후 내용을 다시 읽을 때 유용합니다.
+* `close()`: 파일을 닫습니다.
+
+상기 모든 메소드들이 `async` 메소드이기 때문에 “await”을 사용하여야 합니다.
+
+예를들어, `async` *경로 작동 함수*의 내부에서 다음과 같은 방식으로 내용을 가져올 수 있습니다:
+
+```Python
+contents = await myfile.read()
+```
+
+만약 일반적인 `def` *경로 작동 함수*의 내부라면, 다음과 같이 `UploadFile.file` 에 직접 접근할 수 있습니다:
+
+```Python
+contents = myfile.file.read()
+```
+
+!!! note "`async` 기술적 세부사항"
+ `async` 메소드들을 사용할 때 **FastAPI**는 스레드풀에서 파일 메소드들을 실행하고 그들을 기다립니다.
+
+!!! note "Starlette 기술적 세부사항"
+ **FastAPI**의 `UploadFile` 은 **Starlette**의 `UploadFile` 을 직접적으로 상속받지만, **Pydantic** 및 FastAPI의 다른 부분들과의 호환성을 위해 필요한 부분들이 추가되었습니다.
+
+## "폼 데이터"란
+
+HTML의 폼들(``)이 서버에 데이터를 전송하는 방식은 대개 데이터에 JSON과는 다른 "특별한" 인코딩을 사용합니다.
+
+**FastAPI**는 JSON 대신 올바른 위치에서 데이터를 읽을 수 있도록 합니다.
+
+!!! note "기술적 세부사항"
+ 폼의 데이터는 파일이 포함되지 않은 경우 일반적으로 "미디어 유형" `application/x-www-form-urlencoded` 을 사용해 인코딩 됩니다.
+
+ 하지만 파일이 포함된 경우, `multipart/form-data`로 인코딩됩니다. `File`을 사용하였다면, **FastAPI**는 본문의 적합한 부분에서 파일을 가져와야 한다는 것을 인지합니다.
+
+ 인코딩과 폼 필드에 대해 더 알고싶다면, POST에 관한MDN웹 문서 를 참고하기 바랍니다,.
+
+!!! warning "주의"
+ 다수의 `File` 과 `Form` 매개변수를 한 *경로 작동*에 선언하는 것이 가능하지만, 요청의 본문이 `application/json` 가 아닌 `multipart/form-data` 로 인코딩 되기 때문에 JSON으로 받아야하는 `Body` 필드를 함께 선언할 수는 없습니다.
+
+ 이는 **FastAPI**의 한계가 아니라, HTTP 프로토콜에 의한 것입니다.
+
+## 다중 파일 업로드
+
+여러 파일을 동시에 업로드 할 수 있습니다.
+
+그들은 "폼 데이터"를 사용하여 전송된 동일한 "폼 필드"에 연결됩니다.
+
+이 기능을 사용하기 위해 , `bytes` 의 `List` 또는 `UploadFile` 를 선언하기 바랍니다:
+
+```Python hl_lines="10 15"
+{!../../../docs_src/request_files/tutorial002.py!}
+```
+
+선언한대로, `bytes` 의 `list` 또는 `UploadFile` 들을 전송받을 것입니다.
+
+!!! note "참고"
+ 2019년 4월 14일부터 Swagger UI가 하나의 폼 필드로 다수의 파일을 업로드하는 것을 지원하지 않습니다. 더 많은 정보를 원하면, #4276과 #3641을 참고하세요.
+
+ 그럼에도, **FastAPI**는 표준 Open API를 사용해 이미 호환이 가능합니다.
+
+ 따라서 Swagger UI 또는 기타 그 외의 OpenAPI를 지원하는 툴이 다중 파일 업로드를 지원하는 경우, 이들은 **FastAPI**와 호환됩니다.
+
+!!! note "기술적 세부사항"
+ `from starlette.responses import HTMLResponse` 역시 사용할 수 있습니다.
+
+ **FastAPI**는 개발자의 편의를 위해 `fastapi.responses` 와 동일한 `starlette.responses` 도 제공합니다. 하지만 대부분의 응답들은 Starlette로부터 직접 제공됩니다.
+
+## 요약
+
+폼 데이터로써 입력 매개변수로 업로드할 파일을 선언할 경우 `File` 을 사용하기 바랍니다.
diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml
index dd2d6a7ac..124e7b1d3 100644
--- a/docs/ko/mkdocs.yml
+++ b/docs/ko/mkdocs.yml
@@ -63,6 +63,7 @@ nav:
- tutorial/header-params.md
- tutorial/path-params-numeric-validations.md
- tutorial/response-status-code.md
+ - tutorial/request-files.md
markdown_extensions:
- toc:
permalink: true