Files
fastapi/docs/ja/docs/tutorial/dependencies/global-dependencies.md
Sebastián Ramírez 311ce1cfa5 🌐 Update translations for ja (update-outdated) (#15171)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com>
2026-03-20 15:07:17 +01:00

1.2 KiB
Raw Blame History

グローバルな依存関係

アプリケーションの種類によっては、アプリ全体に依存関係を追加したい場合があります。

dependencies を path operation のデコレータに追加できるのと同様に、FastAPI アプリケーション自体にも追加できます。

その場合、アプリケーション内のすべての path operation に適用されます:

{* ../../docs_src/dependencies/tutorial012_an_py310.py hl[17] *}

また、dependencies を path operation のデコレータに追加する節で説明した考え方はすべて引き続き当てはまりますが、この場合はアプリ内のすべての path operation に対して適用されます。

path operation のグループに対する依存関係

後で、複数ファイルを含む大規模アプリケーションの構成方法(大規模アプリケーション - 複数ファイルを読むと、path operation のグループに対して 1 つの dependencies パラメータを宣言する方法を学びます。