Browse Source

🌐 Update translations for ja (update-outdated)

pull/15171/head
github-actions[bot] 4 months ago
committed by Yurii Motov
parent
commit
ed5216eb7e
  1. 8
      docs/ja/docs/deployment/cloud.md
  2. 12
      docs/ja/docs/deployment/concepts.md
  3. 44
      docs/ja/docs/deployment/docker.md
  4. 4
      docs/ja/docs/deployment/fastapicloud.md
  5. 20
      docs/ja/docs/deployment/https.md
  6. 2
      docs/ja/docs/deployment/index.md
  7. 14
      docs/ja/docs/deployment/manually.md
  8. 28
      docs/ja/docs/deployment/server-workers.md
  9. 6
      docs/ja/docs/deployment/versions.md
  10. 2
      docs/ja/docs/how-to/authentication-error-status-code.md
  11. 2
      docs/ja/docs/how-to/conditional-openapi.md
  12. 4
      docs/ja/docs/how-to/configure-swagger-ui.md
  13. 12
      docs/ja/docs/how-to/custom-docs-ui-assets.md
  14. 4
      docs/ja/docs/how-to/extending-openapi.md
  15. 4
      docs/ja/docs/how-to/general.md
  16. 30
      docs/ja/docs/how-to/graphql.md
  17. 2
      docs/ja/docs/how-to/index.md
  18. 8
      docs/ja/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
  19. 6
      docs/ja/docs/how-to/testing-database.md

8
docs/ja/docs/deployment/cloud.md

@ -6,7 +6,7 @@ FastAPI アプリケーションは、実質的にどのようなクラウドプ
## FastAPI Cloud { #fastapi-cloud }
**<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>** は、**FastAPI** の作者と同じチームによって作られています。
**[FastAPI Cloud](https://fastapicloud.com)** は、**FastAPI** の作者と同じチームによって作られています。
API の**構築**、**デプロイ**、**アクセス**までのプロセスを、最小限の手間で効率化します。
@ -16,9 +16,9 @@ FastAPI Cloud は、*FastAPI and friends* オープンソースプロジェク
## クラウドプロバイダ - スポンサー { #cloud-providers-sponsors }
他にもいくつかのクラウドプロバイダが ✨ [**FastAPI をスポンサーしています**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} ✨。🙇
他にもいくつかのクラウドプロバイダが ✨ [**FastAPI をスポンサーしています**](../help-fastapi.md#sponsor-the-author) ✨。🙇
それらのガイドを参考にし、サービスを試してみるのもよいでしょう:
* <a href="https://docs.render.com/deploy-fastapi?utm_source=deploydoc&utm_medium=referral&utm_campaign=fastapi" class="external-link" target="_blank">Render</a>
* <a href="https://docs.railway.com/guides/fastapi?utm_medium=integration&utm_source=docs&utm_campaign=fastapi" class="external-link" target="_blank">Railway</a>
* [Render](https://docs.render.com/deploy-fastapi?utm_source=deploydoc&utm_medium=referral&utm_campaign=fastapi)
* [Railway](https://docs.railway.com/guides/fastapi?utm_medium=integration&utm_source=docs&utm_campaign=fastapi)

12
docs/ja/docs/deployment/concepts.md

@ -29,7 +29,7 @@
## セキュリティ - HTTPS { #security-https }
[前チャプターのHTTPSについて](https.md){.internal-link target=_blank}では、HTTPSがどのようにAPIを暗号化するのかについて学びました。
[前チャプターのHTTPSについて](https.md)では、HTTPSがどのようにAPIを暗号化するのかについて学びました。
通常、アプリケーションサーバにとって**外部の**コンポーネントである**TLS Termination Proxy**によって提供されることが一般的です。このプロキシは通信の暗号化を担当します。
@ -43,9 +43,9 @@ TLS Termination Proxyとして使用できるツールには以下のような
* Caddy
* 証明書の更新を自動的に処理 ✨
* Nginx
* 証明書更新のためにCertbotのような外部コンポーネントを使用
* 証明書更新のために Certbot のような外部コンポーネントを使用
* HAProxy
* 証明書更新のためにCertbotのような外部コンポーネントを使用
* 証明書更新のために Certbot のような外部コンポーネントを使用
* Nginx のような Ingress Controller を持つ Kubernetes
* 証明書の更新に cert-manager のような外部コンポーネントを使用
* クラウド・プロバイダーがサービスの一部として内部的に処理(下記を参照👇)
@ -193,7 +193,7 @@ FastAPI アプリケーションでは、Uvicorn を実行する `fastapi` コ
### ワーカー・プロセス と ポート { #worker-processes-and-ports }
[HTTPSについて](https.md){.internal-link target=_blank}のドキュメントで、1つのサーバーで1つのポートとIPアドレスの組み合わせでリッスンできるのは1つのプロセスだけであることを覚えていますでしょうか?
[HTTPSについて](https.md)のドキュメントで、1つのサーバーで1つのポートとIPアドレスの組み合わせでリッスンできるのは1つのプロセスだけであることを覚えていますでしょうか?
これはいまだに同じです。
@ -250,7 +250,7 @@ FastAPI アプリケーションでは、Uvicorn を実行する `fastapi` コ
これらの**コンテナ**やDockerそしてKubernetesに関する項目が、まだあまり意味をなしていなくても心配しないでください。
コンテナ・イメージ、Docker、Kubernetesなどについては、将来の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}.
コンテナ・イメージ、Docker、Kubernetesなどについては、将来の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md).
///
@ -290,7 +290,7 @@ FastAPI アプリケーションでは、Uvicorn を実行する `fastapi` コ
/// tip | 豆知識
コンテナを使った具体的な例については、将来の章で紹介します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}.
コンテナを使った具体的な例については、将来の章で紹介します: [コンテナ内のFastAPI - Docker](docker.md).
///

44
docs/ja/docs/deployment/docker.md

@ -1,6 +1,6 @@
# コンテナ内のFastAPI - Docker { #fastapi-in-containers-docker }
FastAPIアプリケーションをデプロイする場合、一般的なアプローチは**Linuxコンテナ・イメージ**をビルドすることです。基本的には <a href="https://www.docker.com/" class="external-link" target="_blank">**Docker**</a>を用いて行われます。生成されたコンテナ・イメージは、いくつかの方法のいずれかでデプロイできます。
FastAPIアプリケーションをデプロイする場合、一般的なアプローチは**Linuxコンテナ・イメージ**をビルドすることです。基本的には [**Docker**](https://www.docker.com/) を用いて行われます。生成されたコンテナ・イメージは、いくつかの方法のいずれかでデプロイできます。
Linuxコンテナの使用には、**セキュリティ**、**反復可能性(レプリカビリティ)**、**シンプリシティ**など、いくつかの利点があります。
@ -60,16 +60,16 @@ Linuxコンテナは、ホスト(マシン、仮想マシン、クラウドサ
Dockerは、**コンテナ・イメージ**と**コンテナ**を作成・管理するための主要なツールの1つです。
そして、多くのツールや環境、データベース、アプリケーションに対応している予め作成された**公式のコンテナ・イメージ**をパブリックに提供している<a href="https://hub.docker.com/" class="external-link" target="_blank">Docker Hub</a>というものがあります。
そして、多くのツールや環境、データベース、アプリケーションに対応している予め作成された**公式のコンテナ・イメージ**をパブリックに提供している [Docker Hub](https://hub.docker.com/) というものがあります。
例えば、公式イメージの1つに<a href="https://hub.docker.com/_/python" class="external-link" target="_blank">Python Image</a>があります。
例えば、公式イメージの1つに [Python Image](https://hub.docker.com/_/python) があります。
その他にも、データベースなどさまざまなイメージがあります:
* <a href="https://hub.docker.com/_/postgres" class="external-link" target="_blank">PostgreSQL</a>
* <a href="https://hub.docker.com/_/mysql" class="external-link" target="_blank">MySQL</a>
* <a href="https://hub.docker.com/_/mongo" class="external-link" target="_blank">MongoDB</a>
* <a href="https://hub.docker.com/_/redis" class="external-link" target="_blank">Redis</a>, etc.
* [PostgreSQL](https://hub.docker.com/_/postgres)
* [MySQL](https://hub.docker.com/_/mysql)
* [MongoDB](https://hub.docker.com/_/mongo)
* [Redis](https://hub.docker.com/_/redis), etc.
予め作成されたコンテナ・イメージを使用することで、異なるツールを**組み合わせて**使用することが非常に簡単になります。例えば、新しいデータベースを試す場合に特に便利です。ほとんどの場合、**公式イメージ**を使い、環境変数で設定するだけで良いです。
@ -111,7 +111,7 @@ FastAPI用の**Dockerイメージ**を、**公式Python**イメージに基づ
最も一般的な方法は、`requirements.txt` ファイルにパッケージ名とそのバージョンを 1 行ずつ書くことです。
もちろん、[FastAPI バージョンについて](versions.md){.internal-link target=_blank}で読んだのと同じアイデアを使用して、バージョンの範囲を設定します。
もちろん、[FastAPI バージョンについて](versions.md)で読んだのと同じアイデアを使用して、バージョンの範囲を設定します。
例えば、`requirements.txt` は次のようになります:
@ -238,7 +238,7 @@ CMD ["fastapi", "run", "app/main.py", "--port", "80"]
#### `CMD` を使う - Exec形式 { #use-cmd-exec-form }
Docker命令 <a href="https://docs.docker.com/reference/dockerfile/#cmd" class="external-link" target="_blank">`CMD`</a> は2つの形式で書けます:
Docker命令 [`CMD`](https://docs.docker.com/reference/dockerfile/#cmd) は2つの形式で書けます:
**Exec** 形式:
@ -254,11 +254,11 @@ CMD ["fastapi", "run", "app/main.py", "--port", "80"]
CMD fastapi run app/main.py --port 80
```
FastAPIが正常にシャットダウンでき、[lifespan events](../advanced/events.md){.internal-link target=_blank}がトリガーされるように、常に **exec** 形式を使用してください。
FastAPIが正常にシャットダウンでき、[lifespan events](../advanced/events.md)がトリガーされるように、常に **exec** 形式を使用してください。
詳しくは、<a href="https://docs.docker.com/reference/dockerfile/#shell-and-exec-form" class="external-link" target="_blank">shell形式とexec形式に関するDockerドキュメント</a>をご覧ください。
詳しくは、[shell形式とexec形式に関するDockerドキュメント](https://docs.docker.com/reference/dockerfile/#shell-and-exec-form)をご覧ください。
これは `docker compose` を使用する場合にかなり目立つことがあります。より技術的な詳細は、このDocker ComposeのFAQセクションをご覧ください:<a href="https://docs.docker.com/compose/faq/#why-do-my-services-take-10-seconds-to-recreate-or-stop" class="external-link" target="_blank">Why do my services take 10 seconds to recreate or stop?</a>
これは `docker compose` を使用する場合にかなり目立つことがあります。より技術的な詳細は、このDocker ComposeのFAQセクションをご覧ください:[Why do my services take 10 seconds to recreate or stop?](https://docs.docker.com/compose/faq/#why-do-my-services-take-10-seconds-to-recreate-or-stop)
#### ディレクトリ構造 { #directory-structure }
@ -354,7 +354,7 @@ $ docker run -d --name mycontainer -p 80:80 myimage
## 確認する { #check-it }
Dockerコンテナの<a href="http://192.168.99.100/items/5?q=somequery" class="external-link" target="_blank">http://192.168.99.100/items/5?q=somequery</a><a href="http://127.0.0.1/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1/items/5?q=somequery</a> (またはそれに相当するDockerホストを使用したもの)といったURLで確認できるはずです。
Dockerコンテナの[http://192.168.99.100/items/5?q=somequery](http://192.168.99.100/items/5?q=somequery) や [http://127.0.0.1/items/5?q=somequery](http://127.0.0.1/items/5?q=somequery) (またはそれに相当するDockerホストを使用したもの)といったURLで確認できるはずです。
アクセスすると以下のようなものが表示されます:
@ -364,17 +364,17 @@ Dockerコンテナの<a href="http://192.168.99.100/items/5?q=somequery" class="
## インタラクティブなAPIドキュメント { #interactive-api-docs }
これらのURLにもアクセスできます: <a href="http://192.168.99.100/docs" class="external-link" target="_blank">http://192.168.99.100/docs</a><a href="http://127.0.0.1/docs" class="external-link" target="_blank">http://127.0.0.1/docs</a> (またはそれに相当するDockerホストを使用したもの)
これらのURLにもアクセスできます: [http://192.168.99.100/docs](http://192.168.99.100/docs) や [http://127.0.0.1/docs](http://127.0.0.1/docs) (またはそれに相当するDockerホストを使用したもの)
アクセスすると、自動対話型APIドキュメント(<a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a>が提供)が表示されます:
アクセスすると、自動対話型APIドキュメント([Swagger UI](https://github.com/swagger-api/swagger-ui)が提供)が表示されます:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
## 代替のAPIドキュメント { #alternative-api-docs }
また、<a href="http://192.168.99.100/redoc" class="external-link" target="_blank">http://192.168.99.100/redoc</a><a href="http://127.0.0.1/redoc" class="external-link" target="_blank">http://127.0.0.1/redoc</a> (またはそれに相当するDockerホストを使用したもの)にもアクセスできます。
また、[http://192.168.99.100/redoc](http://192.168.99.100/redoc) や [http://127.0.0.1/redoc](http://127.0.0.1/redoc) (またはそれに相当するDockerホストを使用したもの)にもアクセスできます。
代替の自動ドキュメント(<a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a>によって提供される)が表示されます:
代替の自動ドキュメント([ReDoc](https://github.com/Rebilly/ReDoc)によって提供される)が表示されます:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
@ -415,7 +415,7 @@ CMD ["fastapi", "run", "main.py", "--port", "80"]
## デプロイメントのコンセプト { #deployment-concepts }
コンテナという観点から、[デプロイのコンセプト](concepts.md){.internal-link target=_blank}に共通するいくつかについて、もう一度説明しましょう。
コンテナという観点から、[デプロイのコンセプト](concepts.md)に共通するいくつかについて、もう一度説明しましょう。
コンテナは主に、アプリケーションの**ビルドとデプロイ**のプロセスを簡素化するためのツールですが、これらの**デプロイのコンセプト**を扱うための特定のアプローチを強制するものではなく、いくつかの戦略があります。
@ -434,7 +434,7 @@ CMD ["fastapi", "run", "main.py", "--port", "80"]
FastAPI アプリケーションの **コンテナ・イメージ**(および後で実行中の **コンテナ**)だけに焦点を当てると、通常、HTTPSは別のツールを用いて**外部で**処理されます。
例えば<a href="https://traefik.io/" class="external-link" target="_blank">Traefik</a>のように、**HTTPS**と**証明書**の**自動**取得を扱う別のコンテナである可能性もあります。
例えば [Traefik](https://traefik.io/) のように、**HTTPS**と**証明書**の**自動**取得を扱う別のコンテナである可能性もあります。
/// tip | 豆知識
@ -564,7 +564,7 @@ Docker Composeで**単一サーバ**(クラスタではない)にデプロ
/// info | 情報
もしKubernetesを使用している場合, これはおそらく<a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" class="external-link" target="_blank">Init Container</a>でしょう。
もしKubernetesを使用している場合, これはおそらく[Init Container](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)でしょう。
///
@ -576,7 +576,7 @@ Docker Composeで**単一サーバ**(クラスタではない)にデプロ
### ベースDockerイメージ { #base-docker-image }
以前は、公式のFastAPI Dockerイメージがありました:<a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" class="external-link" target="_blank">tiangolo/uvicorn-gunicorn-fastapi</a>。しかし、現在は非推奨です。⛔️
以前は、公式のFastAPI Dockerイメージがありました:[tiangolo/uvicorn-gunicorn-fastapi](https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker)。しかし、現在は非推奨です。⛔️
おそらく、このベースDockerイメージ(またはその他の類似のもの)は**使用しない**方がよいでしょう。
@ -606,7 +606,7 @@ Docker Composeで**単一サーバ**(クラスタではない)にデプロ
## `uv` を使ったDockerイメージ { #docker-image-with-uv }
<a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">uv</a> を使ってプロジェクトのインストールと管理をしている場合は、<a href="https://docs.astral.sh/uv/guides/integration/docker/" class="external-link" target="_blank">uv Docker guide</a>に従ってください。
[uv](https://github.com/astral-sh/uv) を使ってプロジェクトのインストールと管理をしている場合は、[uv Docker guide](https://docs.astral.sh/uv/guides/integration/docker/)に従ってください。
## まとめ { #recap }

4
docs/ja/docs/deployment/fastapicloud.md

@ -1,6 +1,6 @@
# FastAPI Cloud { #fastapi-cloud }
<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>**コマンド1つ** でデプロイできます。まだならウェイティングリストにご登録ください。🚀
[FastAPI Cloud](https://fastapicloud.com)**コマンド1つ** でデプロイできます。まだならウェイティングリストにご登録ください。🚀
## ログイン { #login }
@ -40,7 +40,7 @@ Deploying to FastAPI Cloud...
## FastAPI Cloud について { #about-fastapi-cloud }
**<a href="https://fastapicloud.com" class="external-link" target="_blank">FastAPI Cloud</a>** は、**FastAPI** の作者とチームによって開発されています。
**[FastAPI Cloud](https://fastapicloud.com)** は、**FastAPI** の作者とチームによって開発されています。
最小限の手間で API を**構築**・**デプロイ**・**利用**できるように工程を簡素化します。

20
docs/ja/docs/deployment/https.md

@ -10,7 +10,7 @@ HTTPSは単に「有効」か「無効」かで決まるものだと思いがち
///
利用者の視点から **HTTPS の基本を学ぶ**に当たっては、次のリソースをオススメします: <a href="https://howhttps.works/" class="external-link" target="_blank">https://howhttps.works/</a>.
利用者の視点から **HTTPS の基本を学ぶ**に当たっては、次のリソースをオススメします: [https://howhttps.works/](https://howhttps.works/).
さて、**開発者の視点**から、HTTPSについて考える際に念頭に置くべきことをいくつかみていきましょう:
@ -28,13 +28,13 @@ HTTPSは単に「有効」か「無効」かで決まるものだと思いがち
* **デフォルトでは**、**IPアドレスごとに1つのHTTPS証明書**しか持てないことになります。
* これは、サーバーの規模やアプリケーションの規模に寄りません。
* しかし、これには**解決策**があります。
* **TLS**プロトコル(HTTPの前に、TCPレベルで暗号化を処理するもの)には、**<a href="https://en.wikipedia.org/wiki/Server_Name_Indication" class="external-link" target="_blank"><abbr title="Server Name Indication - サーバー名表示">SNI</abbr></a>**と呼ばれる**拡張**があります。
* **TLS**プロトコル(HTTPの前に、TCPレベルで暗号化を処理するもの)には、**[<abbr title="Server Name Indication - サーバー名表示">SNI</abbr>](https://en.wikipedia.org/wiki/Server_Name_Indication)**と呼ばれる**拡張**があります。
* このSNI拡張機能により、1つのサーバー(**単一のIPアドレス**を持つ)が**複数のHTTPS証明書**を持ち、**複数のHTTPSドメイン/アプリケーション**にサービスを提供できるようになります。
* これが機能するためには、**パブリックIPアドレス**でリッスンしている、サーバー上で動作している**単一の**コンポーネント(プログラム)が、サーバー内の**すべてのHTTPS証明書**を持っている必要があります。
* セキュアな接続を取得した**後**でも、通信プロトコルは**HTTPのまま**です。
* コンテンツは**HTTPプロトコル**で送信されているにもかかわらず、**暗号化**されています。
サーバー(マシン、ホストなど)上で**1つのプログラム/HTTPサーバー**を実行させ、**HTTPSに関する全てのこと**を管理するのが一般的です。**暗号化された HTTPS リクエスト** を受信し、**復号化された HTTP リクエスト** を同じサーバーで実行されている実際の HTTP アプリケーション(この場合は **FastAPI** アプリケーション)に送信し、アプリケーションから **HTTP レスポンス** を受け取り、適切な **HTTPS 証明書** を使用して **暗号化** し、そして**HTTPS** を使用してクライアントに送り返します。このサーバーはしばしば **<a href="https://en.wikipedia.org/wiki/TLS_termination_proxy" class="external-link" target="_blank">TLS Termination Proxy</a>**と呼ばれます。
サーバー(マシン、ホストなど)上で**1つのプログラム/HTTPサーバー**を実行させ、**HTTPSに関する全てのこと**を管理するのが一般的です。**暗号化された HTTPS リクエスト** を受信し、**復号化された HTTP リクエスト** を同じサーバーで実行されている実際の HTTP アプリケーション(この場合は **FastAPI** アプリケーション)に送信し、アプリケーションから **HTTP レスポンス** を受け取り、適切な **HTTPS 証明書** を使用して **暗号化** し、そして**HTTPS** を使用してクライアントに送り返します。このサーバーはしばしば **[TLS Termination Proxy](https://en.wikipedia.org/wiki/TLS_termination_proxy)**と呼ばれます。
TLS Termination Proxyとして使えるオプションには、以下のようなものがあります:
@ -50,7 +50,7 @@ Let's Encrypt以前は、これらの**HTTPS証明書**は信頼できる第三
これらの証明書を取得するための手続きは面倒で、かなりの書類を必要とし、証明書はかなり高価なものでした。
しかしその後、**<a href="https://letsencrypt.org/" class="external-link" target="_blank">Let's Encrypt</a>** が作られました。
しかしその後、**[Let's Encrypt](https://letsencrypt.org/)** が作られました。
これはLinux Foundationのプロジェクトから生まれたものです。 自動化された方法で、**HTTPS証明書を無料で**提供します。これらの証明書は、すべての標準的な暗号化セキュリティを使用し、また短命(約3ヶ月)ですが、こういった寿命の短さによって、**セキュリティは実際に優れています**。
@ -68,7 +68,7 @@ Let's Encrypt以前は、これらの**HTTPS証明書**は信頼できる第三
おそらくクラウドサーバー(仮想マシン)かそれに類するものを手に入れ、<dfn title="時間とともに変化しない。動的ではない。">固定の</dfn> **パブリックIPアドレス**を持つことになるでしょう。
DNSサーバーでは、**取得したドメイン**をあなたのサーバーのパリック**IPアドレス**に向けるレコード(「`A record`」)を設定します。
DNSサーバーでは、**取得したドメイン**をあなたのサーバーのパリック**IPアドレス**に向けるレコード(「`A record`」)を設定します。
これはおそらく、最初の1回だけあり、すべてをセットアップするときに行うでしょう。
@ -80,7 +80,7 @@ DNSサーバーでは、**取得したドメイン**をあなたのサーバー
### DNS { #dns }
では、実際のHTTPSの部分に注目してみう。
では、実際のHTTPSの部分に注目してみましょう。
まず、ブラウザは**DNSサーバー**に**ドメインに対するIP**が何であるかを確認します。今回は、`someapp.example.com`とします。
@ -100,7 +100,7 @@ TLS接続を確立するためのクライアントとサーバー間のこの
### SNI拡張機能付きのTLS { #tls-with-sni-extension }
サーバー内の**1つのプロセス**だけが、特定 の**IPアドレス**の特定の**ポート** で待ち受けることができます。
サーバー内の**1つのプロセス**だけが、特定の**IPアドレス**の特定の**ポート**で待ち受けることができます。
同じIPアドレスの他のポートで他のプロセスがリッスンしている可能性もありますが、IPアドレスとポートの組み合わせごとに1つだけです。
@ -204,9 +204,9 @@ TLS Termination Proxyは次に、事前に合意が取れている暗号(`someap
プロキシヘッダーは次のとおりです:
* <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For" class="external-link" target="_blank">X-Forwarded-For</a>
* <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Proto" class="external-link" target="_blank">X-Forwarded-Proto</a>
* <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Host" class="external-link" target="_blank">X-Forwarded-Host</a>
* [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-For)
* [X-Forwarded-Proto](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Proto)
* [X-Forwarded-Host](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Forwarded-Host)
///

2
docs/ja/docs/deployment/index.md

@ -16,7 +16,7 @@
複数のツールを組み合わせて自分で**サーバーをデプロイ**することもできますし、作業の一部を代行してくれる **クラウドサービス** を使うこともできます。ほかにも選択肢があります。
たとえば、FastAPI の開発チームである私たちは、クラウドへの FastAPI アプリのデプロイを可能な限り合理化し、FastAPI を使って開発するのと同じ開発者体験を提供するために、<a href="https://fastapicloud.com" class="external-link" target="_blank">**FastAPI Cloud**</a> を構築しました。
たとえば、FastAPI の開発チームである私たちは、クラウドへの FastAPI アプリのデプロイを可能な限り合理化し、FastAPI を使って開発するのと同じ開発者体験を提供するために、[**FastAPI Cloud**](https://fastapicloud.com) を構築しました。
**FastAPI** アプリケーションをデプロイする際に、おそらく念頭に置くべき主要な概念をいくつか紹介します(ただし、そのほとんどは他の種類の Web アプリケーションにも当てはまります)。

14
docs/ja/docs/deployment/manually.md

@ -52,11 +52,11 @@ FastAPI は、Python の Web フレームワークとサーバーのための標
他にもいくつかの選択肢があります:
* <a href="https://www.uvicorn.dev/" class="external-link" target="_blank">Uvicorn</a>: 高性能な ASGI サーバー。
* <a href="https://hypercorn.readthedocs.io/" class="external-link" target="_blank">Hypercorn</a>: HTTP/2 や Trio に対応する ASGI サーバーなど。
* <a href="https://github.com/django/daphne" class="external-link" target="_blank">Daphne</a>: Django Channels のために作られた ASGI サーバー。
* <a href="https://github.com/emmett-framework/granian" class="external-link" target="_blank">Granian</a>: Python アプリケーション向けの Rust 製 HTTP サーバー。
* <a href="https://unit.nginx.org/howto/fastapi/" class="external-link" target="_blank">NGINX Unit</a>: 軽量で多用途な Web アプリケーションランタイム。
* [Uvicorn](https://www.uvicorn.dev/): 高性能な ASGI サーバー。
* [Hypercorn](https://hypercorn.readthedocs.io/): HTTP/2 や Trio に対応する ASGI サーバーなど。
* [Daphne](https://github.com/django/daphne): Django Channels のために作られた ASGI サーバー。
* [Granian](https://github.com/emmett-framework/granian): Python アプリケーション向けの Rust 製 HTTP サーバー。
* [NGINX Unit](https://unit.nginx.org/howto/fastapi/): 軽量で多用途な Web アプリケーションランタイム。
## サーバーマシンとサーバープログラム { #server-machine-and-server-program }
@ -74,7 +74,7 @@ FastAPI をインストールすると、本番サーバーの Uvicorn が同梱
ただし、ASGI サーバーを手動でインストールすることもできます。
[仮想環境](../virtual-environments.md){.internal-link target=_blank}を作成して有効化し、サーバーアプリケーションをインストールしてください。
[仮想環境](../virtual-environments.md)を作成して有効化し、サーバーアプリケーションをインストールしてください。
例として、Uvicorn をインストールするには:
@ -94,7 +94,7 @@ $ pip install "uvicorn[standard]"
`standard` を付けると、Uvicorn は推奨の追加依存関係もインストールして使用します。
その中には、`asyncio` の高性能なドロップイン代替であり、大きな並行実行性能の向上をもたら`uvloop` も含まれます。
その中には、`uvloop` も含まれます。これは `asyncio` の高性能なドロップイン代替で、大きな並行実行性能の向上をもたらます。
`pip install "fastapi[standard]"` のように FastAPI をインストールした場合は、すでに `uvicorn[standard]` も含まれます。

28
docs/ja/docs/deployment/server-workers.md

@ -13,13 +13,13 @@
アプリケーションをデプロイする際には、**複数のコア**を利用し、そしてより多くのリクエストを処理できるようにするために、プロセスの**レプリケーション**を持つことを望むでしょう。
前のチャプターである[デプロイメントのコンセプト](concepts.md){.internal-link target=_blank}にて見てきたように、有効な戦略がいくつかあります。
前のチャプターである[デプロイメントのコンセプト](concepts.md)にて見てきたように、有効な戦略がいくつかあります。
ここでは、`fastapi` コマンド、または `uvicorn` コマンドを直接使って、**ワーカープロセス**付きの **Uvicorn** を使う方法を紹介します。
/// info | 情報
DockerやKubernetesなどのコンテナを使用している場合は、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}
DockerやKubernetesなどのコンテナを使用している場合は、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md)。
特に**Kubernetes**上で実行する場合は、おそらくワーカーは使わず、代わりに**コンテナごとに単一のUvicornプロセス**を実行したいはずですが、それについてはその章の後半で説明します。
@ -61,17 +61,17 @@ $ <font color="#4E9A06">fastapi</font> run --workers 4 <u style="text-decoration
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Uvicorn running on <font color="#729FCF"><u style="text-decoration-style:solid">http://0.0.0.0:8000</u></font> <b>(</b>Press CTRL+C to
quit<b>)</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started parent process <b>[</b><font color="#34E2E2"><b>27365</b></font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27368</b></font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27369</b></font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27370</b></font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27367</b></font><b>]</b>
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27368</b></font><b>]</b>
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27369</b></font><b>]</b>
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27370</b></font><b>]</b>
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Started server process <b>[</b><font color="#34E2E2"><b>27367</b></font><b>]</b>
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Waiting for application startup.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color="#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
<span style="background-color:#007166"><font color="#D3D7CF"> INFO </font></span> Application startup complete.
```
@ -126,7 +126,7 @@ $ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
## コンテナとDocker { #containers-and-docker }
次章の[コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}では、その他の**デプロイメントのコンセプト**を扱うために使える戦略をいくつか説明します。
次章の[コンテナ内のFastAPI - Docker](docker.md)では、その他の**デプロイメントのコンセプト**を扱うために使える戦略をいくつか説明します。
単一のUvicornプロセスを実行するために、**ゼロから独自のイメージを構築する**方法も紹介します。これは簡単なプロセスで、**Kubernetes**のような分散コンテナ管理システムを使う場合に、おそらくやりたいことでしょう。

6
docs/ja/docs/deployment/versions.md

@ -4,7 +4,7 @@
新機能が高頻度で追加され、定期的にバグが修正され、コードは継続的に改善されています。
これが現在のバージョンがいまだに `0.x.x` な理由であり、それぞれのバージョンは破壊的な変更がなされる可能性があります。これは、<a href="https://semver.org/" class="external-link" target="_blank">セマンティック バージョニング</a>の規則に則っています。
これが現在のバージョンがいまだに `0.x.x` な理由であり、それぞれのバージョンは破壊的な変更がなされる可能性があります。これは、[セマンティック バージョニング](https://semver.org/)の規則に則っています。
**FastAPI** を使用すると本番用アプリケーションを今すぐ作成できます(そして、おそらくあなたはしばらく前からそうしているはずです)。必要なのは、残りのコードと正しく動作するバージョンを使用していることを確認することだけです。
@ -34,7 +34,7 @@ fastapi[standard]>=0.112.0,<0.113.0
## 利用可能なバージョン { #available-versions }
利用可能なバージョン(例: 現在の最新が何かを確認するため)は、[Release Notes](../release-notes.md){.internal-link target=_blank} で確認できます。
利用可能なバージョン(例: 現在の最新が何かを確認するため)は、[Release Notes](../release-notes.md) で確認できます。
## バージョンについて { #about-versions }
@ -66,7 +66,7 @@ fastapi>=0.45.0,<0.46.0
アプリケーションにテストを追加すべきです。
**FastAPI** では非常に簡単に実現できます(Starlette のおかげです)。ドキュメントを確認して下さい: [テスト](../tutorial/testing.md){.internal-link target=_blank}
**FastAPI** では非常に簡単に実現できます(Starlette のおかげです)。ドキュメントを確認して下さい: [テスト](../tutorial/testing.md)
テストを追加したら、**FastAPI** のバージョンをより新しいものにアップグレードし、テストを実行することで全てのコードが正しく動作するか確認できます。

2
docs/ja/docs/how-to/authentication-error-status-code.md

@ -2,7 +2,7 @@
FastAPI バージョン `0.122.0` より前は、統合されたセキュリティユーティリティが認証に失敗してクライアントへエラーを返す際、HTTP ステータスコード `403 Forbidden` を使用していました。
FastAPI バージョン `0.122.0` 以降では、より適切な HTTP ステータスコード `401 Unauthorized` を使用し、HTTP 仕様に従ってレスポンスに妥当な `WWW-Authenticate` ヘッダーを含めます。<a href="https://datatracker.ietf.org/doc/html/rfc7235#section-3.1" class="external-link" target="_blank">RFC 7235</a><a href="https://datatracker.ietf.org/doc/html/rfc9110#name-401-unauthorized" class="external-link" target="_blank">RFC 9110</a>
FastAPI バージョン `0.122.0` 以降では、より適切な HTTP ステータスコード `401 Unauthorized` を使用し、HTTP 仕様に従ってレスポンスに妥当な `WWW-Authenticate` ヘッダーを含めます。[RFC 7235](https://datatracker.ietf.org/doc/html/rfc7235#section-3.1), [RFC 9110](https://datatracker.ietf.org/doc/html/rfc9110#name-401-unauthorized)
しかし、何らかの理由でクライアントが従来の挙動に依存している場合は、セキュリティクラスでメソッド `make_not_authenticated_error` をオーバーライドすることで、その挙動に戻せます。

2
docs/ja/docs/how-to/conditional-openapi.md

@ -10,7 +10,7 @@
もしセキュリティ上の欠陥がソースコードにあるならば、それは存在したままです。
ドキュメンテーションを非表示にするのは、単にあなたのAPIへのアクセス方法を難解にするだけでなく、同時にあなた自身の本番環境でのAPIのデバッグを困難にしてしまう可能性があります。単純に、 <a href="https://en.wikipedia.org/wiki/Security_through_obscurity" class="external-link" target="_blank">秘匿によるセキュリティ</a> の一つの形態として考えられるでしょう。
ドキュメンテーションを非表示にするのは、単にあなたのAPIへのアクセス方法を難解にするだけでなく、同時にあなた自身の本番環境でのAPIのデバッグを困難にしてしまう可能性があります。単純に、[秘匿によるセキュリティ](https://en.wikipedia.org/wiki/Security_through_obscurity) の一つの形態として考えられるでしょう。
もしあなたのAPIのセキュリティを強化したいなら、いくつかのよりよい方法があります。例を示すと、

4
docs/ja/docs/how-to/configure-swagger-ui.md

@ -1,6 +1,6 @@
# Swagger UI の設定 { #configure-swagger-ui }
いくつかの追加の <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/" class="external-link" target="_blank">Swagger UI パラメータ</a>を設定できます。
いくつかの追加の [Swagger UI パラメータ](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)を設定できます。
設定するには、`FastAPI()` のアプリオブジェクトを作成するとき、または `get_swagger_ui_html()` 関数に `swagger_ui_parameters` 引数を渡します。
@ -50,7 +50,7 @@ FastAPI には、多くのユースケースに適した既定の設定パラメ
## その他の Swagger UI パラメータ { #other-swagger-ui-parameters }
利用可能な他のすべての設定については、公式の <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/" class="external-link" target="_blank">Swagger UI パラメータのドキュメント</a>を参照してください。
利用可能な他のすべての設定については、公式の [Swagger UI パラメータのドキュメント](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)を参照してください。
## JavaScript 専用の設定 { #javascript-only-settings }

12
docs/ja/docs/how-to/custom-docs-ui-assets.md

@ -54,7 +54,7 @@ Swagger UI がこの処理を裏側で行いますが、そのためにこの「
### テスト { #test-it }
これで、<a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> にアクセスしてページを再読み込みすると、新しい CDN からそれらのアセットが読み込まれるはずです。
これで、[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) にアクセスしてページを再読み込みすると、新しい CDN からそれらのアセットが読み込まれるはずです。
## ドキュメント用 JavaScript と CSS のセルフホスティング { #self-hosting-javascript-and-css-for-docs }
@ -93,12 +93,12 @@ Swagger UI がこの処理を裏側で行いますが、そのためにこの「
**Swagger UI** では次のファイルを使用します:
- <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js" class="external-link" target="_blank">`swagger-ui-bundle.js`</a>
- <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css" class="external-link" target="_blank">`swagger-ui.css`</a>
- [`swagger-ui-bundle.js`](https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js)
- [`swagger-ui.css`](https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css)
そして **ReDoc** では次のファイルを使用します:
- <a href="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
- [`redoc.standalone.js`](https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js)
その後、ファイル構成は次のようになります:
@ -122,7 +122,7 @@ Swagger UI がこの処理を裏側で行いますが、そのためにこの「
### 静的ファイルのテスト { #test-the-static-files }
アプリケーションを起動し、<a href="http://127.0.0.1:8000/static/redoc.standalone.js" class="external-link" target="_blank">http://127.0.0.1:8000/static/redoc.standalone.js</a> にアクセスします。
アプリケーションを起動し、[http://127.0.0.1:8000/static/redoc.standalone.js](http://127.0.0.1:8000/static/redoc.standalone.js) にアクセスします。
**ReDoc** 用の非常に長い JavaScript ファイルが表示されるはずです。
@ -180,6 +180,6 @@ Swagger UI がこの処理を裏側で行いますが、そのためにこの「
### 静的ファイル UI のテスト { #test-static-files-ui }
これで、WiFi を切断して <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> にアクセスし、ページを再読み込みできるはずです。
これで、WiFi を切断して [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs) にアクセスし、ページを再読み込みできるはずです。
インターネットに接続していなくても、API のドキュメントを表示し、API と対話できます。

4
docs/ja/docs/how-to/extending-openapi.md

@ -37,7 +37,7 @@
上記の情報を使って、同じユーティリティ関数で OpenAPI スキーマを生成し、必要な部分を上書きできます。
たとえば、<a href="https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md#x-logo" class="external-link" target="_blank">カスタムロゴを含めるための ReDoc の OpenAPI 拡張</a>を追加してみましょう。
たとえば、[カスタムロゴを含めるための ReDoc の OpenAPI 拡張](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md#x-logo)を追加してみましょう。
### 通常の **FastAPI** { #normal-fastapi }
@ -75,6 +75,6 @@ OpenAPI スキーマの `info`「オブジェクト」にカスタムの `x-logo
### 確認 { #check-it }
<a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> にアクセスすると、カスタムロゴ(この例では **FastAPI** のロゴ)が使われていることが確認できます:
[http://127.0.0.1:8000/redoc](http://127.0.0.1:8000/redoc) にアクセスすると、カスタムロゴ(この例では **FastAPI** のロゴ)が使われていることが確認できます:
<img src="/img/tutorial/extending-openapi/image01.png">

4
docs/ja/docs/how-to/general.md

@ -6,6 +6,10 @@
返すべき以上のデータを返さないようにするには、[チュートリアル - レスポンスモデル - 戻り値の型](../tutorial/response-model.md){.internal-link target=_blank} を参照してください。
## レスポンス性能の最適化 - レスポンスモデル - 戻り値の型 { #optimize-response-performance-response-model-return-type }
JSON データを返す際の性能を最適化するには、戻り値の型またはレスポンスモデルを使用してください。そうすることで、Pydantic が Python を経由せずに Rust 側で JSON へのシリアライズを処理します。詳細は [チュートリアル - レスポンスモデル - 戻り値の型](../tutorial/response-model.md){.internal-link target=_blank} を参照してください。
## ドキュメントのタグ - OpenAPI { #documentation-tags-openapi }
*path operations* にタグを追加し、ドキュメント UI でグループ化するには、[チュートリアル - path operation の設定 - タグ](../tutorial/path-operation-configuration.md#tags){.internal-link target=_blank} を参照してください。

30
docs/ja/docs/how-to/graphql.md

@ -18,18 +18,18 @@
**ASGI** をサポートする **GraphQL** ライブラリの一部を以下に示します。**FastAPI** と組み合わせて使用できます:
* <a href="https://strawberry.rocks/" class="external-link" target="_blank">Strawberry</a> 🍓
* <a href="https://strawberry.rocks/docs/integrations/fastapi" class="external-link" target="_blank">FastAPI 向けドキュメント</a>あり
* <a href="https://ariadnegraphql.org/" class="external-link" target="_blank">Ariadne</a>
* <a href="https://ariadnegraphql.org/docs/fastapi-integration" class="external-link" target="_blank">FastAPI 向けドキュメント</a>あり
* <a href="https://tartiflette.io/" class="external-link" target="_blank">Tartiflette</a>
* ASGI 連携用の <a href="https://tartiflette.github.io/tartiflette-asgi/" class="external-link" target="_blank">Tartiflette ASGI</a> あり
* <a href="https://graphene-python.org/" class="external-link" target="_blank">Graphene</a>
* <a href="https://github.com/ciscorn/starlette-graphene3" class="external-link" target="_blank">starlette-graphene3</a> あり
* [Strawberry](https://strawberry.rocks/) 🍓
* [FastAPI 向けドキュメント](https://strawberry.rocks/docs/integrations/fastapi)あり
* [Ariadne](https://ariadnegraphql.org/)
* [FastAPI 向けドキュメント](https://ariadnegraphql.org/docs/fastapi-integration)あり
* [Tartiflette](https://tartiflette.io/)
* ASGI 連携用の [Tartiflette ASGI](https://tartiflette.github.io/tartiflette-asgi/) あり
* [Graphene](https://graphene-python.org/)
* [starlette-graphene3](https://github.com/ciscorn/starlette-graphene3) あり
## Strawberry で GraphQL { #graphql-with-strawberry }
**GraphQL** が必要、または利用したい場合は、<a href="https://strawberry.rocks/" class="external-link" target="_blank">**Strawberry**</a> を**推奨**します。**FastAPI** の設計に最も近く、すべてが**型アノテーション**に基づいています。
**GraphQL** が必要、または利用したい場合は、[**Strawberry**](https://strawberry.rocks/) を**推奨**します。**FastAPI** の設計に最も近く、すべてが**型アノテーション**に基づいています。
ユースケースによっては他のライブラリを選ぶ方がよい場合もありますが、私に尋ねられれば、おそらく **Strawberry** を試すことを勧めるでしょう。
@ -37,24 +37,24 @@ FastAPI と Strawberry を統合する方法の簡単なプレビューです:
{* ../../docs_src/graphql_/tutorial001_py310.py hl[3,22,25] *}
詳細は <a href="https://strawberry.rocks/" class="external-link" target="_blank">Strawberry のドキュメント</a>をご覧ください。
詳細は [Strawberry のドキュメント](https://strawberry.rocks/)をご覧ください。
また、<a href="https://strawberry.rocks/docs/integrations/fastapi" class="external-link" target="_blank">Strawberry と FastAPI</a> の連携に関するドキュメントもあります。
また、[Strawberry と FastAPI](https://strawberry.rocks/docs/integrations/fastapi) の連携に関するドキュメントもあります。
## Starlette の旧 `GraphQLApp` { #older-graphqlapp-from-starlette }
以前の Starlette には、<a href="https://graphene-python.org/" class="external-link" target="_blank">Graphene</a> と統合するための `GraphQLApp` クラスが含まれていました。
以前の Starlette には、[Graphene](https://graphene-python.org/) と統合するための `GraphQLApp` クラスが含まれていました。
これは Starlette からは非推奨になりましたが、もしそれを使用しているコードがある場合は、同じユースケースをカバーし、**ほぼ同一のインターフェース**を持つ <a href="https://github.com/ciscorn/starlette-graphene3" class="external-link" target="_blank">starlette-graphene3</a> へ容易に**移行**できます。
これは Starlette からは非推奨になりましたが、もしそれを使用しているコードがある場合は、同じユースケースをカバーし、**ほぼ同一のインターフェース**を持つ [starlette-graphene3](https://github.com/ciscorn/starlette-graphene3) へ容易に**移行**できます。
/// tip | 豆知識
GraphQL が必要であれば、依然として <a href="https://strawberry.rocks/" class="external-link" target="_blank">Strawberry</a> の利用を推奨します。独自のクラスや型ではなく、型アノテーションに基づいているためです。
GraphQL が必要であれば、依然として [Strawberry](https://strawberry.rocks/) の利用を推奨します。独自のクラスや型ではなく、型アノテーションに基づいているためです。
///
## さらに学ぶ { #learn-more }
**GraphQL** については、<a href="https://graphql.org/" class="external-link" target="_blank">公式 GraphQL ドキュメント</a>でさらに学べます。
**GraphQL** については、[公式 GraphQL ドキュメント](https://graphql.org/)でさらに学べます。
上記の各ライブラリについては、リンク先のドキュメントをご参照ください。

2
docs/ja/docs/how-to/index.md

@ -8,6 +8,6 @@
/// tip | 豆知識
**FastAPI を学ぶ**ことを体系的に進めたい場合(推奨)、代わりに [チュートリアル - ユーザーガイド](../tutorial/index.md){.internal-link target=_blank} を章ごとに読んでください。
**FastAPI を学ぶ**ことを体系的に進めたい場合(推奨)、代わりに [チュートリアル - ユーザーガイド](../tutorial/index.md) を章ごとに読んでください。
///

8
docs/ja/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md

@ -22,7 +22,7 @@ Python の最新機能を使いたい場合は、Pydantic v2 を使用してい
## 公式ガイド { #official-guide }
Pydantic には v1 から v2 への公式の <a href="https://docs.pydantic.dev/latest/migration/" class="external-link" target="_blank">移行ガイド</a> があります。
Pydantic には v1 から v2 への公式の [移行ガイド](https://docs.pydantic.dev/latest/migration/) があります。
変更点、検証がより正確で厳密になった点、注意事項などが含まれます。
@ -30,7 +30,7 @@ Pydantic には v1 から v2 への公式の <a href="https://docs.pydantic.dev/
## テスト { #tests }
アプリに対する[テスト](../tutorial/testing.md){.internal-link target=_blank}を用意し、継続的インテグレーション(CI)で実行するようにしてください。
アプリに対する[テスト](../tutorial/testing.md)を用意し、継続的インテグレーション(CI)で実行するようにしてください。
これにより、アップグレード後も期待どおり動作していることを確認できます。
@ -38,7 +38,7 @@ Pydantic には v1 から v2 への公式の <a href="https://docs.pydantic.dev/
多くの場合、カスタマイズのない通常の Pydantic モデルを使っていれば、v1 から v2 への移行作業の大半を自動化できます。
同じ Pydantic チームが提供する <a href="https://github.com/pydantic/bump-pydantic" class="external-link" target="_blank">`bump-pydantic`</a> を使用できます。
同じ Pydantic チームが提供する [`bump-pydantic`](https://github.com/pydantic/bump-pydantic) を使用できます。
このツールは必要なコード変更のほとんどを自動で行います。
@ -88,7 +88,7 @@ graph TB
style V2Field fill:#f9fff3
```
...but, you can have separated models using Pydantic v1 and v2 in the same app.
...しかし、同じアプリ内で Pydantic v1 と v2 を別々のモデルとして分けて使うことは可能です。
```mermaid
graph TB

6
docs/ja/docs/how-to/testing-database.md

@ -1,7 +1,7 @@
# データベースのテスト { #testing-a-database }
データベース、SQL、SQLModel については、<a href="https://sqlmodel.tiangolo.com/" class="external-link" target="_blank">SQLModel ドキュメント</a>で学べます。🤓
データベース、SQL、SQLModel については、[SQLModel ドキュメント](https://sqlmodel.tiangolo.com/)で学べます。🤓
FastAPI と一緒に SQLModel を使うためのミニ <a href="https://sqlmodel.tiangolo.com/tutorial/fastapi/" class="external-link" target="_blank">チュートリアル</a>があります。✨
FastAPI と一緒に SQLModel を使うためのミニ [チュートリアル](https://sqlmodel.tiangolo.com/tutorial/fastapi/)があります。✨
そのチュートリアルには、<a href="https://sqlmodel.tiangolo.com/tutorial/fastapi/tests/" class="external-link" target="_blank">SQL データベースのテスト</a>に関するセクションも含まれています。😎
そのチュートリアルには、[SQL データベースのテスト](https://sqlmodel.tiangolo.com/tutorial/fastapi/tests/)に関するセクションも含まれています。😎

Loading…
Cancel
Save