diff --git a/.github/actions/people/app/main.py b/.github/actions/people/app/main.py
index cb6b229e8..9f2b9369d 100644
--- a/.github/actions/people/app/main.py
+++ b/.github/actions/people/app/main.py
@@ -58,38 +58,6 @@ query Q($after: String, $category_id: ID) {
}
"""
-issues_query = """
-query Q($after: String) {
- repository(name: "fastapi", owner: "tiangolo") {
- issues(first: 100, after: $after) {
- edges {
- cursor
- node {
- number
- author {
- login
- avatarUrl
- url
- }
- title
- createdAt
- state
- comments(first: 100) {
- nodes {
- createdAt
- author {
- login
- avatarUrl
- url
- }
- }
- }
- }
- }
- }
- }
-}
-"""
prs_query = """
query Q($after: String) {
@@ -176,7 +144,7 @@ class Author(BaseModel):
url: str
-# Issues and Discussions
+# Discussions
class CommentsNode(BaseModel):
@@ -200,15 +168,6 @@ class DiscussionsComments(BaseModel):
nodes: List[DiscussionsCommentsNode]
-class IssuesNode(BaseModel):
- number: int
- author: Union[Author, None] = None
- title: str
- createdAt: datetime
- state: str
- comments: Comments
-
-
class DiscussionsNode(BaseModel):
number: int
author: Union[Author, None] = None
@@ -217,44 +176,23 @@ class DiscussionsNode(BaseModel):
comments: DiscussionsComments
-class IssuesEdge(BaseModel):
- cursor: str
- node: IssuesNode
-
-
class DiscussionsEdge(BaseModel):
cursor: str
node: DiscussionsNode
-class Issues(BaseModel):
- edges: List[IssuesEdge]
-
-
class Discussions(BaseModel):
edges: List[DiscussionsEdge]
-class IssuesRepository(BaseModel):
- issues: Issues
-
-
class DiscussionsRepository(BaseModel):
discussions: Discussions
-class IssuesResponseData(BaseModel):
- repository: IssuesRepository
-
-
class DiscussionsResponseData(BaseModel):
repository: DiscussionsRepository
-class IssuesResponse(BaseModel):
- data: IssuesResponseData
-
-
class DiscussionsResponse(BaseModel):
data: DiscussionsResponseData
@@ -389,12 +327,6 @@ def get_graphql_response(
return data
-def get_graphql_issue_edges(*, settings: Settings, after: Union[str, None] = None):
- data = get_graphql_response(settings=settings, query=issues_query, after=after)
- graphql_response = IssuesResponse.model_validate(data)
- return graphql_response.data.repository.issues.edges
-
-
def get_graphql_question_discussion_edges(
*,
settings: Settings,
@@ -422,43 +354,16 @@ def get_graphql_sponsor_edges(*, settings: Settings, after: Union[str, None] = N
return graphql_response.data.user.sponsorshipsAsMaintainer.edges
-def get_issues_experts(settings: Settings):
- issue_nodes: List[IssuesNode] = []
- issue_edges = get_graphql_issue_edges(settings=settings)
-
- while issue_edges:
- for edge in issue_edges:
- issue_nodes.append(edge.node)
- last_edge = issue_edges[-1]
- issue_edges = get_graphql_issue_edges(settings=settings, after=last_edge.cursor)
-
- commentors = Counter()
- last_month_commentors = Counter()
- authors: Dict[str, Author] = {}
-
- now = datetime.now(tz=timezone.utc)
- one_month_ago = now - timedelta(days=30)
-
- for issue in issue_nodes:
- issue_author_name = None
- if issue.author:
- authors[issue.author.login] = issue.author
- issue_author_name = issue.author.login
- issue_commentors = set()
- for comment in issue.comments.nodes:
- if comment.author:
- authors[comment.author.login] = comment.author
- if comment.author.login != issue_author_name:
- issue_commentors.add(comment.author.login)
- for author_name in issue_commentors:
- commentors[author_name] += 1
- if issue.createdAt > one_month_ago:
- last_month_commentors[author_name] += 1
-
- return commentors, last_month_commentors, authors
+class DiscussionExpertsResults(BaseModel):
+ commenters: Counter
+ last_month_commenters: Counter
+ three_months_commenters: Counter
+ six_months_commenters: Counter
+ one_year_commenters: Counter
+ authors: Dict[str, Author]
-def get_discussions_experts(settings: Settings):
+def get_discussion_nodes(settings: Settings) -> List[DiscussionsNode]:
discussion_nodes: List[DiscussionsNode] = []
discussion_edges = get_graphql_question_discussion_edges(settings=settings)
@@ -469,61 +374,73 @@ def get_discussions_experts(settings: Settings):
discussion_edges = get_graphql_question_discussion_edges(
settings=settings, after=last_edge.cursor
)
+ return discussion_nodes
- commentors = Counter()
- last_month_commentors = Counter()
+
+def get_discussions_experts(
+ discussion_nodes: List[DiscussionsNode],
+) -> DiscussionExpertsResults:
+ commenters = Counter()
+ last_month_commenters = Counter()
+ three_months_commenters = Counter()
+ six_months_commenters = Counter()
+ one_year_commenters = Counter()
authors: Dict[str, Author] = {}
now = datetime.now(tz=timezone.utc)
one_month_ago = now - timedelta(days=30)
+ three_months_ago = now - timedelta(days=90)
+ six_months_ago = now - timedelta(days=180)
+ one_year_ago = now - timedelta(days=365)
for discussion in discussion_nodes:
discussion_author_name = None
if discussion.author:
authors[discussion.author.login] = discussion.author
discussion_author_name = discussion.author.login
- discussion_commentors = set()
+ discussion_commentors: dict[str, datetime] = {}
for comment in discussion.comments.nodes:
if comment.author:
authors[comment.author.login] = comment.author
if comment.author.login != discussion_author_name:
- discussion_commentors.add(comment.author.login)
+ author_time = discussion_commentors.get(
+ comment.author.login, comment.createdAt
+ )
+ discussion_commentors[comment.author.login] = max(
+ author_time, comment.createdAt
+ )
for reply in comment.replies.nodes:
if reply.author:
authors[reply.author.login] = reply.author
if reply.author.login != discussion_author_name:
- discussion_commentors.add(reply.author.login)
- for author_name in discussion_commentors:
- commentors[author_name] += 1
- if discussion.createdAt > one_month_ago:
- last_month_commentors[author_name] += 1
- return commentors, last_month_commentors, authors
+ author_time = discussion_commentors.get(
+ reply.author.login, reply.createdAt
+ )
+ discussion_commentors[reply.author.login] = max(
+ author_time, reply.createdAt
+ )
+ for author_name, author_time in discussion_commentors.items():
+ commenters[author_name] += 1
+ if author_time > one_month_ago:
+ last_month_commenters[author_name] += 1
+ if author_time > three_months_ago:
+ three_months_commenters[author_name] += 1
+ if author_time > six_months_ago:
+ six_months_commenters[author_name] += 1
+ if author_time > one_year_ago:
+ one_year_commenters[author_name] += 1
+ discussion_experts_results = DiscussionExpertsResults(
+ authors=authors,
+ commenters=commenters,
+ last_month_commenters=last_month_commenters,
+ three_months_commenters=three_months_commenters,
+ six_months_commenters=six_months_commenters,
+ one_year_commenters=one_year_commenters,
+ )
+ return discussion_experts_results
-def get_experts(settings: Settings):
- # Migrated to only use GitHub Discussions
- # (
- # issues_commentors,
- # issues_last_month_commentors,
- # issues_authors,
- # ) = get_issues_experts(settings=settings)
- (
- discussions_commentors,
- discussions_last_month_commentors,
- discussions_authors,
- ) = get_discussions_experts(settings=settings)
- # commentors = issues_commentors + discussions_commentors
- commentors = discussions_commentors
- # last_month_commentors = (
- # issues_last_month_commentors + discussions_last_month_commentors
- # )
- last_month_commentors = discussions_last_month_commentors
- # authors = {**issues_authors, **discussions_authors}
- authors = {**discussions_authors}
- return commentors, last_month_commentors, authors
-
-
-def get_contributors(settings: Settings):
+def get_pr_nodes(settings: Settings) -> List[PullRequestNode]:
pr_nodes: List[PullRequestNode] = []
pr_edges = get_graphql_pr_edges(settings=settings)
@@ -532,10 +449,22 @@ def get_contributors(settings: Settings):
pr_nodes.append(edge.node)
last_edge = pr_edges[-1]
pr_edges = get_graphql_pr_edges(settings=settings, after=last_edge.cursor)
+ return pr_nodes
+
+class ContributorsResults(BaseModel):
+ contributors: Counter
+ commenters: Counter
+ reviewers: Counter
+ translation_reviewers: Counter
+ authors: Dict[str, Author]
+
+
+def get_contributors(pr_nodes: List[PullRequestNode]) -> ContributorsResults:
contributors = Counter()
- commentors = Counter()
+ commenters = Counter()
reviewers = Counter()
+ translation_reviewers = Counter()
authors: Dict[str, Author] = {}
for pr in pr_nodes:
@@ -552,16 +481,26 @@ def get_contributors(settings: Settings):
continue
pr_commentors.add(comment.author.login)
for author_name in pr_commentors:
- commentors[author_name] += 1
+ commenters[author_name] += 1
for review in pr.reviews.nodes:
if review.author:
authors[review.author.login] = review.author
pr_reviewers.add(review.author.login)
+ for label in pr.labels.nodes:
+ if label.name == "lang-all":
+ translation_reviewers[review.author.login] += 1
+ break
for reviewer in pr_reviewers:
reviewers[reviewer] += 1
if pr.state == "MERGED" and pr.author:
contributors[pr.author.login] += 1
- return contributors, commentors, reviewers, authors
+ return ContributorsResults(
+ contributors=contributors,
+ commenters=commenters,
+ reviewers=reviewers,
+ translation_reviewers=translation_reviewers,
+ authors=authors,
+ )
def get_individual_sponsors(settings: Settings):
@@ -585,19 +524,19 @@ def get_individual_sponsors(settings: Settings):
def get_top_users(
*,
counter: Counter,
- min_count: int,
authors: Dict[str, Author],
skip_users: Container[str],
+ min_count: int = 2,
):
users = []
- for commentor, count in counter.most_common(50):
- if commentor in skip_users:
+ for commenter, count in counter.most_common(50):
+ if commenter in skip_users:
continue
if count >= min_count:
- author = authors[commentor]
+ author = authors[commenter]
users.append(
{
- "login": commentor,
+ "login": commenter,
"count": count,
"avatarUrl": author.avatarUrl,
"url": author.url,
@@ -612,13 +551,11 @@ if __name__ == "__main__":
logging.info(f"Using config: {settings.model_dump_json()}")
g = Github(settings.input_token.get_secret_value())
repo = g.get_repo(settings.github_repository)
- question_commentors, question_last_month_commentors, question_authors = get_experts(
- settings=settings
- )
- contributors, pr_commentors, reviewers, pr_authors = get_contributors(
- settings=settings
- )
- authors = {**question_authors, **pr_authors}
+ discussion_nodes = get_discussion_nodes(settings=settings)
+ experts_results = get_discussions_experts(discussion_nodes=discussion_nodes)
+ pr_nodes = get_pr_nodes(settings=settings)
+ contributors_results = get_contributors(pr_nodes=pr_nodes)
+ authors = {**experts_results.authors, **contributors_results.authors}
maintainers_logins = {"tiangolo"}
bot_names = {"codecov", "github-actions", "pre-commit-ci", "dependabot"}
maintainers = []
@@ -627,39 +564,51 @@ if __name__ == "__main__":
maintainers.append(
{
"login": login,
- "answers": question_commentors[login],
- "prs": contributors[login],
+ "answers": experts_results.commenters[login],
+ "prs": contributors_results.contributors[login],
"avatarUrl": user.avatarUrl,
"url": user.url,
}
)
- min_count_expert = 10
- min_count_last_month = 3
- min_count_contributor = 4
- min_count_reviewer = 4
skip_users = maintainers_logins | bot_names
experts = get_top_users(
- counter=question_commentors,
- min_count=min_count_expert,
+ counter=experts_results.commenters,
authors=authors,
skip_users=skip_users,
)
- last_month_active = get_top_users(
- counter=question_last_month_commentors,
- min_count=min_count_last_month,
+ last_month_experts = get_top_users(
+ counter=experts_results.last_month_commenters,
+ authors=authors,
+ skip_users=skip_users,
+ )
+ three_months_experts = get_top_users(
+ counter=experts_results.three_months_commenters,
+ authors=authors,
+ skip_users=skip_users,
+ )
+ six_months_experts = get_top_users(
+ counter=experts_results.six_months_commenters,
+ authors=authors,
+ skip_users=skip_users,
+ )
+ one_year_experts = get_top_users(
+ counter=experts_results.one_year_commenters,
authors=authors,
skip_users=skip_users,
)
top_contributors = get_top_users(
- counter=contributors,
- min_count=min_count_contributor,
+ counter=contributors_results.contributors,
authors=authors,
skip_users=skip_users,
)
top_reviewers = get_top_users(
- counter=reviewers,
- min_count=min_count_reviewer,
+ counter=contributors_results.reviewers,
+ authors=authors,
+ skip_users=skip_users,
+ )
+ top_translations_reviewers = get_top_users(
+ counter=contributors_results.translation_reviewers,
authors=authors,
skip_users=skip_users,
)
@@ -679,13 +628,19 @@ if __name__ == "__main__":
people = {
"maintainers": maintainers,
"experts": experts,
- "last_month_active": last_month_active,
+ "last_month_experts": last_month_experts,
+ "three_months_experts": three_months_experts,
+ "six_months_experts": six_months_experts,
+ "one_year_experts": one_year_experts,
"top_contributors": top_contributors,
"top_reviewers": top_reviewers,
+ "top_translations_reviewers": top_translations_reviewers,
}
github_sponsors = {
"sponsors": sponsors,
}
+ # For local development
+ # people_path = Path("../../../../docs/en/data/people.yml")
people_path = Path("./docs/en/data/people.yml")
github_sponsors_path = Path("./docs/en/data/github_sponsors.yml")
people_old_content = people_path.read_text(encoding="utf-8")
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 0a59adbd6..8979aabf8 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -12,9 +12,5 @@ updates:
directory: "/"
schedule:
interval: "monthly"
- groups:
- python-packages:
- patterns:
- - "*"
commit-message:
prefix: ⬆
diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index abf2b90f6..4ff5e26cb 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code but for master it is
- - uses: dorny/paths-filter@v2
+ - uses: dorny/paths-filter@v3
id: filter
with:
filters: |
@@ -28,6 +28,9 @@ jobs:
- docs/**
- docs_src/**
- requirements-docs.txt
+ - pyproject.toml
+ - mkdocs.yml
+ - mkdocs.insiders.yml
- .github/workflows/build-docs.yml
- .github/workflows/deploy-docs.yml
langs:
@@ -42,11 +45,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- - uses: actions/cache@v3
+ - uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
- key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-tests.txt') }}-v06
+ key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-tests.txt') }}-v07
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
@@ -57,8 +60,8 @@ jobs:
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
- - name: Verify README
- run: python ./scripts/docs.py verify-readme
+ - name: Verify Docs
+ run: python ./scripts/docs.py verify-docs
- name: Export Language Codes
id: show-langs
run: |
@@ -83,23 +86,23 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- - uses: actions/cache@v3
+ - uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
- key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-tests.txt') }}-v06
+ key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-tests.txt') }}-v08
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
- name: Install Material for MkDocs Insiders
- if: ( github.event_name != 'pull_request' || github.secret_source != 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
+ if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: |
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
- name: Update Languages
run: python ./scripts/docs.py update-languages
- - uses: actions/cache@v3
+ - uses: actions/cache@v4
with:
key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }}
path: docs/${{ matrix.lang }}/.cache
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
index 2bec6682c..b8dbb7dc5 100644
--- a/.github/workflows/deploy-docs.yml
+++ b/.github/workflows/deploy-docs.yml
@@ -21,7 +21,7 @@ jobs:
mkdir ./site
- name: Download Artifact Docs
id: download
- uses: dawidd6/action-download-artifact@v3.0.0
+ uses: dawidd6/action-download-artifact@v3.1.4
with:
if_no_artifact_found: ignore
github_token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml
index bb967fa11..0f564d721 100644
--- a/.github/workflows/issue-manager.yml
+++ b/.github/workflows/issue-manager.yml
@@ -23,7 +23,7 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- - uses: tiangolo/issue-manager@0.4.0
+ - uses: tiangolo/issue-manager@0.5.0
with:
token: ${{ secrets.FASTAPI_ISSUE_MANAGER }}
config: >
@@ -31,5 +31,9 @@ jobs:
"answered": {
"delay": 864000,
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
+ },
+ "changes-requested": {
+ "delay": 2628000,
+ "message": "As this PR had requested changes to be applied but has been inactive for a while, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
}
}
diff --git a/.github/workflows/label-approved.yml b/.github/workflows/label-approved.yml
index 62daf2608..51be2413d 100644
--- a/.github/workflows/label-approved.yml
+++ b/.github/workflows/label-approved.yml
@@ -17,3 +17,11 @@ jobs:
- uses: docker://tiangolo/label-approved:0.0.4
with:
token: ${{ secrets.FASTAPI_LABEL_APPROVED }}
+ config: >
+ {
+ "approved-1":
+ {
+ "number": 1,
+ "await_label": "awaiting-review"
+ }
+ }
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 8ebb28a80..a5cbf6da4 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -20,19 +20,18 @@ jobs:
python-version: "3.10"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
- cache-dependency-path: pyproject.toml
- - uses: actions/cache@v3
+ # cache-dependency-path: pyproject.toml
+ - uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install build dependencies
- if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
- uses: pypa/gh-action-pypi-publish@v1.8.11
+ uses: pypa/gh-action-pypi-publish@v1.8.14
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
diff --git a/.github/workflows/smokeshow.yml b/.github/workflows/smokeshow.yml
index 10bff67ae..c4043cc6a 100644
--- a/.github/workflows/smokeshow.yml
+++ b/.github/workflows/smokeshow.yml
@@ -24,7 +24,7 @@ jobs:
- run: pip install smokeshow
- - uses: dawidd6/action-download-artifact@v3.0.0
+ - uses: dawidd6/action-download-artifact@v3.1.4
with:
github_token: ${{ secrets.FASTAPI_SMOKESHOW_DOWNLOAD_ARTIFACTS }}
workflow: test.yml
diff --git a/.github/workflows/test-redistribute.yml b/.github/workflows/test-redistribute.yml
new file mode 100644
index 000000000..c2e05013b
--- /dev/null
+++ b/.github/workflows/test-redistribute.yml
@@ -0,0 +1,51 @@
+name: Test Redistribute
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ types:
+ - opened
+ - synchronize
+
+jobs:
+ test-redistribute:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Dump GitHub context
+ env:
+ GITHUB_CONTEXT: ${{ toJson(github) }}
+ run: echo "$GITHUB_CONTEXT"
+ - uses: actions/checkout@v4
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.10"
+ # Issue ref: https://github.com/actions/setup-python/issues/436
+ # cache: "pip"
+ # cache-dependency-path: pyproject.toml
+ - name: Install build dependencies
+ run: pip install build
+ - name: Build source distribution
+ run: python -m build --sdist
+ - name: Decompress source distribution
+ run: |
+ cd dist
+ tar xvf fastapi*.tar.gz
+ - name: Install test dependencies
+ run: |
+ cd dist/fastapi-*/
+ pip install -r requirements-tests.txt
+ - name: Run source distribution tests
+ run: |
+ cd dist/fastapi-*/
+ bash scripts/test.sh
+ - name: Build wheel distribution
+ run: |
+ cd dist
+ pip wheel --no-deps fastapi-*.tar.gz
+ - name: Dump GitHub context
+ env:
+ GITHUB_CONTEXT: ${{ toJson(github) }}
+ run: echo "$GITHUB_CONTEXT"
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b6b173685..fe1e419d6 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -8,6 +8,9 @@ on:
types:
- opened
- synchronize
+ schedule:
+ # cron every week on monday
+ - cron: "0 0 * * 1"
jobs:
lint:
@@ -25,11 +28,11 @@ jobs:
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- - uses: actions/cache@v3
+ - uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
- key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v07
+ key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v08
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
@@ -63,11 +66,11 @@ jobs:
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- - uses: actions/cache@v3
+ - uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
- key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v07
+ key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v08
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a7f2fb3f2..4d49845d6 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -14,7 +14,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.1.2
+ rev: v0.2.0
hooks:
- id: ruff
args:
diff --git a/README.md b/README.md
index 2df5cba0b..bcb18ac66 100644
--- a/README.md
+++ b/README.md
@@ -53,11 +53,10 @@ The key features are:
-
-
-
+
+
+
-
@@ -128,7 +127,7 @@ Python 3.8+
FastAPI stands on the shoulders of giants:
* Starlette for the web parts.
-* Pydantic for the data parts.
+* Pydantic for the data parts.
## Installation
@@ -461,15 +460,15 @@ Used by Starlette:
*
httpx - Required if you want to use the `TestClient`.
* jinja2 - Required if you want to use the default template configuration.
-* python-multipart - Required if you want to support form "parsing", with `request.form()`.
+* 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).
-* ujson - Required if you want to use `UJSONResponse`.
Used by FastAPI / Starlette:
* uvicorn - for the server that loads and serves your application.
* orjson - Required if you want to use `ORJSONResponse`.
+* ujson - Required if you want to use `UJSONResponse`.
You can install all of these with `pip install "fastapi[all]"`.
diff --git a/docs/az/docs/fastapi-people.md b/docs/az/docs/fastapi-people.md
new file mode 100644
index 000000000..60494f191
--- /dev/null
+++ b/docs/az/docs/fastapi-people.md
@@ -0,0 +1,185 @@
+---
+hide:
+ - navigation
+---
+
+# FastAPI İnsanlar
+
+FastAPI-ın bütün mənşəli insanları qəbul edən heyrətamiz icması var.
+
+
+
+## Yaradıcı - İcraçı
+
+Salam! 👋
+
+Bu mənəm:
+
+{% if people %}
+
+ FastAPI framework, yüksək məshuldarlı, öyrənməsi asan, çevik kodlama, istifadəyə hazırdır +
+ + +--- + +**Sənədlər**: https://fastapi.tiangolo.com + +**Qaynaq Kodu**: https://github.com/tiangolo/fastapi + +--- + +FastAPI Python 3.8+ ilə API yaratmaq üçün standart Python tip məsləhətlərinə əsaslanan, müasir, sürətli (yüksək performanslı) framework-dür. + +Əsas xüsusiyyətləri bunlardır: + +* **Sürətli**: Çox yüksək performans, **NodeJS** və **Go** səviyyəsində (Starlette və Pydantic-ə təşəkkürlər). [Ən sürətli Python frameworklərindən biridir](#performans). +* **Çevik kodlama**: Funksiyanallıqları inkişaf etdirmək sürətini təxminən 200%-dən 300%-ə qədər artırın. * +* **Daha az xəta**: İnsan (developer) tərəfindən törədilən səhvlərin təxminən 40% -ni azaldın. * +* **İntuitiv**: Əla redaktor dəstəyi. Hər yerdə otomatik tamamlama. Xətaları müəyyənləşdirməyə daha az vaxt sərf edəcəksiniz. +* **Asan**: İstifadəsi və öyrənilməsi asan olması üçün nəzərdə tutulmuşdur. Sənədləri oxumaq üçün daha az vaxt ayıracaqsınız. +* **Qısa**: Kod təkrarlanmasını minimuma endirin. Hər bir parametr tərifində birdən çox xüsusiyyət ilə və daha az səhvlə qarşılaşacaqsınız. +* **Güclü**: Avtomatik və interaktiv sənədlərlə birlikdə istifadəyə hazır kod əldə edə bilərsiniz. +* **Standartlara əsaslanan**: API-lar üçün açıq standartlara əsaslanır (və tam uyğun gəlir): OpenAPI (əvvəlki adı ilə Swagger) və JSON Schema. + +* Bu fikirlər daxili development komandasının hazırladıqları məhsulların sınaqlarına əsaslanır. + +## Sponsorlar + + + +{% if sponsors %} +{% for sponsor in sponsors.gold -%} +async def...uvicorn main:app --reload əmri haqqında...email_validator - e-poçtun yoxlanılması üçün.
+* pydantic-settings - parametrlərin idarə edilməsi üçün.
+* pydantic-extra-types - Pydantic ilə istifadə edilə bilən əlavə tiplər üçün.
+
+Starlette tərəfindən istifadə olunanlar:
+
+* httpx - Əgər `TestClient` strukturundan istifadə edəcəksinizsə, tələb olunur.
+* jinja2 - Standart şablon konfiqurasiyasından istifadə etmək istəyirsinizsə, tələb olunur.
+* python-multipart - `request.form()` ilə forma "çevirmə" dəstəyindən istifadə etmək istəyirsinizsə, tələb olunur.
+* itsdangerous - `SessionMiddleware` dəstəyi üçün tələb olunur.
+* pyyaml - `SchemaGenerator` dəstəyi üçün tələb olunur (Çox güman ki, FastAPI istifadə edərkən buna ehtiyacınız olmayacaq).
+* ujson - `UJSONResponse` istifadə etmək istəyirsinizsə, tələb olunur.
+
+Həm FastAPI, həm də Starlette tərəfindən istifadə olunur:
+
+* uvicorn - Yaratdığımız proqramı servis edəcək veb server kimi fəaliyyət göstərir.
+* orjson - `ORJSONResponse` istifadə edəcəksinizsə tələb olunur.
+
+Bütün bunları `pip install fastapi[all]` ilə quraşdıra bilərsiniz.
+
+## Lisenziya
+
+Bu layihə MIT lisenziyasının şərtlərinə əsasən lisenziyalaşdırılıb.
diff --git a/docs/az/docs/learn/index.md b/docs/az/docs/learn/index.md
new file mode 100644
index 000000000..cc32108bf
--- /dev/null
+++ b/docs/az/docs/learn/index.md
@@ -0,0 +1,5 @@
+# Öyrən
+
+Burada **FastAPI** öyrənmək üçün giriş bölmələri və dərsliklər yer alır.
+
+Siz bunu kitab, kurs, FastAPI öyrənmək üçün rəsmi və tövsiyə olunan üsul hesab edə bilərsiniz. 😎
diff --git a/docs/az/mkdocs.yml b/docs/az/mkdocs.yml
new file mode 100644
index 000000000..de18856f4
--- /dev/null
+++ b/docs/az/mkdocs.yml
@@ -0,0 +1 @@
+INHERIT: ../en/mkdocs.yml
diff --git a/docs/bn/docs/index.md b/docs/bn/docs/index.md
index 4f778e873..bbc3e9a3a 100644
--- a/docs/bn/docs/index.md
+++ b/docs/bn/docs/index.md
@@ -112,7 +112,7 @@ Python 3.7+
FastAPI কিছু দানবেদের কাঁধে দাঁড়িয়ে আছে:
- Starlette ওয়েব অংশের জন্য.
-- Pydantic ডেটা অংশগুলির জন্য.
+- Pydantic ডেটা অংশগুলির জন্য.
## ইনস্টলেশন প্রক্রিয়া
@@ -439,23 +439,22 @@ item: Item
Pydantic দ্বারা ব্যবহৃত:
-- ujson - দ্রুত JSON এর জন্য "parsing".
- email_validator - ইমেল যাচাইকরণের জন্য।
স্টারলেট দ্বারা ব্যবহৃত:
- httpx - আপনি যদি `TestClient` ব্যবহার করতে চান তাহলে আবশ্যক।
- jinja2 - আপনি যদি প্রদত্ত টেমপ্লেট রূপরেখা ব্যবহার করতে চান তাহলে প্রয়োজন।
-- python-multipart - আপনি যদি ফর্ম সহায়তা করতে চান তাহলে প্রয়োজন "parsing", `request.form()` সহ।
+- python-multipart - আপনি যদি ফর্ম সহায়তা করতে চান তাহলে প্রয়োজন "parsing", `request.form()` সহ।
- itsdangerous - `SessionMiddleware` সহায়তার জন্য প্রয়োজন।
- pyyaml - স্টারলেটের SchemaGenerator সাপোর্ট এর জন্য প্রয়োজন (আপনার সম্ভাবত FastAPI প্রয়োজন নেই)।
- graphene - `GraphQLApp` সহায়তার জন্য প্রয়োজন।
-- ujson - আপনি `UJSONResponse` ব্যবহার করতে চাইলে প্রয়োজন।
FastAPI / Starlette দ্বারা ব্যবহৃত:
- uvicorn - সার্ভারের জন্য যা আপনার অ্যাপ্লিকেশন লোড করে এবং পরিবেশন করে।
- orjson - আপনি `ORJSONResponse` ব্যবহার করতে চাইলে প্রয়োজন।
+- ujson - আপনি `UJSONResponse` ব্যবহার করতে চাইলে প্রয়োজন।
আপনি এই সব ইনস্টল করতে পারেন `pip install fastapi[all]` দিয়ে.
diff --git a/docs/bn/docs/learn/index.md b/docs/bn/docs/learn/index.md
new file mode 100644
index 000000000..4e4c62038
--- /dev/null
+++ b/docs/bn/docs/learn/index.md
@@ -0,0 +1,5 @@
+# শিখুন
+
+এখানে **FastAPI** শিখার জন্য প্রাথমিক বিভাগগুলি এবং টিউটোরিয়ালগুলি রয়েছে।
+
+আপনি এটিকে একটি **বই**, একটি **কোর্স**, এবং FastAPI শিখার **অফিসিয়াল** এবং প্রস্তাবিত উপায় বিবেচনা করতে পারেন। 😎
diff --git a/docs/bn/docs/python-types.md b/docs/bn/docs/python-types.md
new file mode 100644
index 000000000..6923363dd
--- /dev/null
+++ b/docs/bn/docs/python-types.md
@@ -0,0 +1,537 @@
+# পাইথন এর টাইপ্স পরিচিতি
+
+Python-এ ঐচ্ছিক "টাইপ হিন্ট" (যা "টাইপ অ্যানোটেশন" নামেও পরিচিত) এর জন্য সাপোর্ট রয়েছে।
+
+এই **"টাইপ হিন্ট"** বা অ্যানোটেশনগুলি এক ধরণের বিশেষ সিনট্যাক্স যা একটি ভেরিয়েবলের টাইপ ঘোষণা করতে দেয়।
+
+ভেরিয়েবলগুলির জন্য টাইপ ঘোষণা করলে, এডিটর এবং টুলগুলি আপনাকে আরও ভালো সাপোর্ট দিতে পারে।
+
+এটি পাইথন টাইপ হিন্ট সম্পর্কে একটি দ্রুত **টিউটোরিয়াল / রিফ্রেশার** মাত্র। এটি **FastAPI** এর সাথে ব্যবহার করার জন্য শুধুমাত্র ন্যূনতম প্রয়োজনীয়তা কভার করে... যা আসলে খুব একটা বেশি না।
+
+**FastAPI** এই টাইপ হিন্টগুলির উপর ভিত্তি করে নির্মিত, যা এটিকে অনেক সুবিধা এবং লাভ প্রদান করে।
+
+তবে, আপনি যদি কখনো **FastAPI** ব্যবহার নাও করেন, তবুও এগুলি সম্পর্কে একটু শেখা আপনার উপকারে আসবে।
+
+!!! Note
+ যদি আপনি একজন Python বিশেষজ্ঞ হন, এবং টাইপ হিন্ট সম্পর্কে সবকিছু জানেন, তাহলে পরবর্তী অধ্যায়ে চলে যান।
+
+## প্রেরণা
+
+চলুন একটি সাধারণ উদাহরণ দিয়ে শুরু করি:
+
+```Python
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+এই প্রোগ্রামটি কল করলে আউটপুট হয়:
+
+```
+John Doe
+```
+
+ফাংশনটি নিম্নলিখিত কাজ করে:
+
+* `first_name` এবং `last_name` নেয়।
+* প্রতিটির প্রথম অক্ষরকে `title()` ব্যবহার করে বড় হাতের অক্ষরে রূপান্তর করে।
+* তাদেরকে মাঝখানে একটি স্পেস দিয়ে concatenate করে।
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+### এটি সম্পাদনা করুন
+
+এটি একটি খুব সাধারণ প্রোগ্রাম।
+
+কিন্তু এখন কল্পনা করুন যে আপনি এটি শুরু থেকে লিখছিলেন।
+
+এক পর্যায়ে আপনি ফাংশনের সংজ্ঞা শুরু করেছিলেন, আপনার প্যারামিটারগুলি প্রস্তুত ছিল...
+
+কিন্তু তারপর আপনাকে "সেই method কল করতে হবে যা প্রথম অক্ষরকে বড় হাতের অক্ষরে রূপান্তর করে"।
+
+এটা কি `upper` ছিল? নাকি `uppercase`? `first_uppercase`? `capitalize`?
+
+তারপর, আপনি পুরোনো প্রোগ্রামারের বন্ধু, এডিটর অটোকমপ্লিশনের সাহায্যে নেওয়ার চেষ্টা করেন।
+
+আপনি ফাংশনের প্রথম প্যারামিটার `first_name` টাইপ করেন, তারপর একটি ডট (`.`) টাইপ করেন এবং `Ctrl+Space` চাপেন অটোকমপ্লিশন ট্রিগার করার জন্য।
+
+কিন্তু, দুর্ভাগ্যবশত, আপনি কিছুই উপযোগী পান না:
+
+
+
+### টাইপ যোগ করুন
+
+আসুন আগের সংস্করণ থেকে একটি লাইন পরিবর্তন করি।
+
+আমরা ঠিক এই অংশটি পরিবর্তন করব অর্থাৎ ফাংশনের প্যারামিটারগুলি, এইগুলি:
+
+```Python
+ first_name, last_name
+```
+
+থেকে এইগুলি:
+
+```Python
+ first_name: str, last_name: str
+```
+
+ব্যাস।
+
+এগুলিই "টাইপ হিন্ট":
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial002.py!}
+```
+
+এটি ডিফল্ট ভ্যালু ঘোষণা করার মত নয় যেমন:
+
+```Python
+ first_name="john", last_name="doe"
+```
+
+এটি একটি ভিন্ন জিনিস।
+
+আমরা সমান (`=`) নয়, কোলন (`:`) ব্যবহার করছি।
+
+এবং টাইপ হিন্ট যোগ করা সাধারণত তেমন কিছু পরিবর্তন করে না যা টাইপ হিন্ট ছাড়াই ঘটত।
+
+কিন্তু এখন, কল্পনা করুন আপনি আবার সেই ফাংশন তৈরির মাঝখানে আছেন, কিন্তু টাইপ হিন্ট সহ।
+
+একই পর্যায়ে, আপনি অটোকমপ্লিট ট্রিগার করতে `Ctrl+Space` চাপেন এবং আপনি দেখতে পান:
+
+
+
+এর সাথে, আপনি অপশনগুলি দেখে, স্ক্রল করতে পারেন, যতক্ষণ না আপনি এমন একটি অপশন খুঁজে পান যা কিছু মনে পরিয়ে দেয়:
+
+
+
+## আরও প্রেরণা
+
+এই ফাংশনটি দেখুন, এটিতে ইতিমধ্যে টাইপ হিন্ট রয়েছে:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial003.py!}
+```
+
+এডিটর ভেরিয়েবলগুলির টাইপ জানার কারণে, আপনি শুধুমাত্র অটোকমপ্লিশনই পান না, আপনি এরর চেকও পান:
+
+
+
+এখন আপনি জানেন যে আপনাকে এটি ঠিক করতে হবে, `age`-কে একটি স্ট্রিং হিসেবে রূপান্তর করতে `str(age)` ব্যবহার করতে হবে:
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial004.py!}
+```
+
+## টাইপ ঘোষণা
+
+আপনি এতক্ষন টাইপ হিন্ট ঘোষণা করার মূল স্থানটি দেখে ফেলেছেন-- ফাংশন প্যারামিটার হিসেবে।
+
+সাধারণত এটি **FastAPI** এর ক্ষেত্রেও একই।
+
+### সিম্পল টাইপ
+
+আপনি `str` ছাড়াও সমস্ত স্ট্যান্ডার্ড পাইথন টাইপ ঘোষণা করতে পারেন।
+
+উদাহরণস্বরূপ, আপনি এগুলো ব্যবহার করতে পারেন:
+
+* `int`
+* `float`
+* `bool`
+* `bytes`
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial005.py!}
+```
+
+### টাইপ প্যারামিটার সহ জেনেরিক টাইপ
+
+কিছু ডাটা স্ট্রাকচার অন্যান্য মান ধারণ করতে পারে, যেমন `dict`, `list`, `set` এবং `tuple`। এবং অভ্যন্তরীণ মানগুলোরও নিজেদের টাইপ থাকতে পারে।
+
+এই ধরনের টাইপগুলিকে বলা হয় "**জেনেরিক**" টাইপ এবং এগুলিকে তাদের অভ্যন্তরীণ টাইপগুলি সহ ঘোষণা করা সম্ভব।
+
+এই টাইপগুলি এবং অভ্যন্তরীণ টাইপগুলি ঘোষণা করতে, আপনি Python মডিউল `typing` ব্যবহার করতে পারেন। এটি বিশেষভাবে এই টাইপ হিন্টগুলি সমর্থন করার জন্য রয়েছে।
+
+#### Python এর নতুন সংস্করণ
+
+`typing` ব্যবহার করা সিনট্যাক্সটি Python 3.6 থেকে সর্বশেষ সংস্করণগুলি পর্যন্ত, অর্থাৎ Python 3.9, Python 3.10 ইত্যাদি সহ সকল সংস্করণের সাথে **সামঞ্জস্যপূর্ণ**।
+
+Python যত এগিয়ে যাচ্ছে, **নতুন সংস্করণগুলি** এই টাইপ অ্যানোটেশনগুলির জন্য তত উন্নত সাপোর্ট নিয়ে আসছে এবং অনেক ক্ষেত্রে আপনাকে টাইপ অ্যানোটেশন ঘোষণা করতে `typing` মডিউল ইম্পোর্ট এবং ব্যবহার করার প্রয়োজন হবে না।
+
+যদি আপনি আপনার প্রজেক্টের জন্য Python-এর আরও সাম্প্রতিক সংস্করণ নির্বাচন করতে পারেন, তাহলে আপনি সেই অতিরিক্ত সরলতা থেকে সুবিধা নিতে পারবেন।
+
+ডক্সে রয়েছে Python-এর প্রতিটি সংস্করণের সাথে সামঞ্জস্যপূর্ণ উদাহরণগুলি (যখন পার্থক্য আছে)।
+
+উদাহরণস্বরূপ, "**Python 3.6+**" মানে এটি Python 3.6 বা তার উপরে সামঞ্জস্যপূর্ণ (যার মধ্যে 3.7, 3.8, 3.9, 3.10, ইত্যাদি অন্তর্ভুক্ত)। এবং "**Python 3.9+**" মানে এটি Python 3.9 বা তার উপরে সামঞ্জস্যপূর্ণ (যার মধ্যে 3.10, ইত্যাদি অন্তর্ভুক্ত)।
+
+যদি আপনি Python-এর **সর্বশেষ সংস্করণগুলি ব্যবহার করতে পারেন**, তাহলে সর্বশেষ সংস্করণের জন্য উদাহরণগুলি ব্যবহার করুন, সেগুলি আপনাকে **সর্বোত্তম এবং সহজতম সিনট্যাক্স** প্রদান করবে, যেমন, "**Python 3.10+**"।
+
+#### লিস্ট
+
+উদাহরণস্বরূপ, একটি ভেরিয়েবলকে `str`-এর একটি `list` হিসেবে সংজ্ঞায়িত করা যাক।
+
+=== "Python 3.9+"
+
+ ভেরিয়েবলটি ঘোষণা করুন, একই কোলন (`:`) সিনট্যাক্স ব্যবহার করে।
+
+ টাইপ হিসেবে, `list` ব্যবহার করুন।
+
+ যেহেতু লিস্ট এমন একটি টাইপ যা অভ্যন্তরীণ টাইপগুলি ধারণ করে, আপনি তাদের স্কোয়ার ব্রাকেটের ভিতরে ব্যবহার করুন:
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial006_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ `typing` থেকে `List` (বড় হাতের `L` দিয়ে) ইমপোর্ট করুন:
+
+ ``` Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial006.py!}
+ ```
+
+ ভেরিয়েবলটি ঘোষণা করুন, একই কোলন (`:`) সিনট্যাক্স ব্যবহার করে।
+
+ টাইপ হিসেবে, `typing` থেকে আপনার ইম্পোর্ট করা `List` ব্যবহার করুন।
+
+ যেহেতু লিস্ট এমন একটি টাইপ যা অভ্যন্তরীণ টাইপগুলি ধারণ করে, আপনি তাদের স্কোয়ার ব্রাকেটের ভিতরে করুন:
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/python_types/tutorial006.py!}
+ ```
+
+!!! Info
+ স্কোয়ার ব্রাকেট এর ভিতরে ব্যবহৃত এইসব অভন্তরীন টাইপগুলোকে "ইন্টারনাল টাইপ" বলে।
+
+ এই উদাহরণে, এটি হচ্ছে `List`(অথবা পাইথন ৩.৯ বা তার উপরের সংস্করণের ক্ষেত্রে `list`) এ পাস করা টাইপ প্যারামিটার।
+
+এর অর্থ হচ্ছে: "ভেরিয়েবল `items` একটি `list`, এবং এই লিস্টের প্রতিটি আইটেম একটি `str`।"
+
+!!! Tip
+ যদি আপনি Python 3.9 বা তার উপরে ব্যবহার করেন, আপনার `typing` থেকে `List` আমদানি করতে হবে না, আপনি সাধারণ `list` ওই টাইপের পরিবর্তে ব্যবহার করতে পারেন।
+
+এর মাধ্যমে, আপনার এডিটর লিস্ট থেকে আইটেম প্রসেস করার সময় সাপোর্ট প্রদান করতে পারবে:
+
+
+
+টাইপগুলি ছাড়া, এটি করা প্রায় অসম্ভব।
+
+লক্ষ্য করুন যে ভেরিয়েবল `item` হল `items` লিস্টের একটি এলিমেন্ট।
+
+তবুও, এডিটর জানে যে এটি একটি `str`, এবং তার জন্য সাপোর্ট প্রদান করে।
+
+#### টাপল এবং সেট
+
+আপনি `tuple` এবং `set` ঘোষণা করার জন্য একই প্রক্রিয়া অনুসরণ করবেন:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial007_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial007.py!}
+ ```
+
+এর মানে হল:
+
+* ভেরিয়েবল `items_t` হল একটি `tuple` যা ৩টি আইটেম ধারণ করে, একটি `int`, অন্য একটি `int`, এবং একটি `str`।
+* ভেরিয়েবল `items_s` হল একটি `set`, এবং এর প্রতিটি আইটেম হল `bytes` টাইপের।
+
+#### ডিক্ট
+
+একটি `dict` সংজ্ঞায়িত করতে, আপনি ২টি টাইপ প্যারামিটার কমা দ্বারা পৃথক করে দেবেন।
+
+প্রথম টাইপ প্যারামিটারটি হল `dict`-এর কীগুলির জন্য।
+
+দ্বিতীয় টাইপ প্যারামিটারটি হল `dict`-এর মানগুলির জন্য:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial008_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial008.py!}
+ ```
+
+
+এর মানে হল:
+
+* ভেরিয়েবল `prices` হল একটি `dict`:
+ * এই `dict`-এর কীগুলি হল `str` টাইপের (ধরা যাক, প্রতিটি আইটেমের নাম)।
+ * এই `dict`-এর মানগুলি হল `float` টাইপের (ধরা যাক, প্রতিটি আইটেমের দাম)।
+
+#### ইউনিয়ন
+
+আপনি একটি ভেরিয়েবলকে এমনভাবে ঘোষণা করতে পারেন যেন তা **একাধিক টাইপের** হয়, উদাহরণস্বরূপ, একটি `int` অথবা `str`।
+
+Python 3.6 এবং তার উপরের সংস্করণগুলিতে (Python 3.10 অন্তর্ভুক্ত) আপনি `typing` থেকে `Union` টাইপ ব্যবহার করতে পারেন এবং স্কোয়ার ব্র্যাকেটের মধ্যে গ্রহণযোগ্য টাইপগুলি রাখতে পারেন।
+
+Python 3.10-এ একটি **নতুন সিনট্যাক্স** আছে যেখানে আপনি সম্ভাব্য টাইপগুলিকে একটি ভার্টিকাল বার (`|`) দ্বারা পৃথক করতে পারেন।
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial008b_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial008b.py!}
+ ```
+
+উভয় ক্ষেত্রেই এর মানে হল যে `item` হতে পারে একটি `int` অথবা `str`।
+
+#### সম্ভবত `None`
+
+আপনি এমনভাবে ঘোষণা করতে পারেন যে একটি মান হতে পারে এক টাইপের, যেমন `str`, আবার এটি `None`-ও হতে পারে।
+
+Python 3.6 এবং তার উপরের সংস্করণগুলিতে (Python 3.10 অনতর্ভুক্ত) আপনি `typing` মডিউল থেকে `Optional` ইমপোর্ট করে এটি ঘোষণা এবং ব্যবহার করতে পারেন।
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009.py!}
+```
+
+`Optional[str]` ব্যবহার করা মানে হল শুধু `str` নয়, এটি হতে পারে `None`-ও, যা আপনার এডিটরকে সেই ত্রুটিগুলি শনাক্ত করতে সাহায্য করবে যেখানে আপনি ধরে নিচ্ছেন যে একটি মান সবসময় `str` হবে, অথচ এটি `None`-ও হতে পারেও।
+
+`Optional[Something]` মূলত `Union[Something, None]`-এর একটি শর্টকাট, এবং তারা সমতুল্য।
+
+এর মানে হল, Python 3.10-এ, আপনি টাইপগুলির ইউনিয়ন ঘোষণা করতে `Something | None` ব্যবহার করতে পারেন:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial009_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial009.py!}
+ ```
+
+=== "Python 3.8+ বিকল্প"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial009b.py!}
+ ```
+
+#### `Union` বা `Optional` ব্যবহার
+
+যদি আপনি Python 3.10-এর নীচের সংস্করণ ব্যবহার করেন, তবে এখানে আমার খুবই **ব্যক্তিগত** দৃষ্টিভঙ্গি থেকে একটি টিপস:
+
+* 🚨 `Optional[SomeType]` ব্যবহার এড়িয়ে চলুন।
+* এর পরিবর্তে ✨ **`Union[SomeType, None]` ব্যবহার করুন** ✨।
+
+উভয়ই সমতুল্য এবং মূলে একই, কিন্তু আমি `Union`-এর পক্ষে সুপারিশ করব কারণ "**অপশনাল**" শব্দটি মনে হতে পারে যে মানটি ঐচ্ছিক,অথচ এটি আসলে মানে "এটি হতে পারে `None`", এমনকি যদি এটি ঐচ্ছিক না হয়েও আবশ্যিক হয়।
+
+আমি মনে করি `Union[SomeType, None]` এর অর্থ আরও স্পষ্টভাবে প্রকাশ করে।
+
+এটি কেবল শব্দ এবং নামের ব্যাপার। কিন্তু সেই শব্দগুলি আপনি এবং আপনার সহকর্মীরা কোড সম্পর্কে কীভাবে চিন্তা করেন তা প্রভাবিত করতে পারে।
+
+একটি উদাহরণ হিসেবে, এই ফাংশনটি নিন:
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009c.py!}
+```
+
+`name` প্যারামিটারটি `Optional[str]` হিসেবে সংজ্ঞায়িত হয়েছে, কিন্তু এটি **অপশনাল নয়**, আপনি প্যারামিটার ছাড়া ফাংশনটি কল করতে পারবেন না:
+
+```Python
+say_hi() # ওহ না, এটি একটি ত্রুটি নিক্ষেপ করবে! 😱
+```
+
+`name` প্যারামিটারটি **এখনও আবশ্যিক** (নন-অপশনাল) কারণ এটির কোনো ডিফল্ট মান নেই। তবুও, `name` এর মান হিসেবে `None` গ্রহণযোগ্য:
+
+```Python
+say_hi(name=None) # এটি কাজ করে, None বৈধ 🎉
+```
+
+সুখবর হল, একবার আপনি Python 3.10 ব্যবহার করা শুরু করলে, আপনাকে এগুলোর ব্যাপারে আর চিন্তা করতে হবে না, যেহুতু আপনি | ব্যবহার করেই ইউনিয়ন ঘোষণা করতে পারবেন:
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009c_py310.py!}
+```
+
+এবং তারপর আপনাকে নামগুলি যেমন `Optional` এবং `Union` নিয়ে আর চিন্তা করতে হবে না। 😎
+
+#### জেনেরিক টাইপস
+
+স্কোয়ার ব্র্যাকেটে টাইপ প্যারামিটার নেওয়া এই টাইপগুলিকে **জেনেরিক টাইপ** বা **জেনেরিকস** বলা হয়, যেমন:
+
+=== "Python 3.10+"
+ আপনি সেই একই বিল্টইন টাইপ জেনেরিক্স হিসেবে ব্যবহার করতে পারবেন(ভিতরে টাইপ সহ স্কয়ারে ব্রাকেট দিয়ে):
+
+ * `list`
+ * `tuple`
+ * `set`
+ * `dict`
+
+ এবং Python 3.8 এর মতোই, `typing` মডিউল থেকে:
+
+ * `Union`
+ * `Optional` (Python 3.8 এর মতোই)
+ * ...এবং অন্যান্য।
+
+ Python 3.10-এ, `Union` এবং `Optional` জেনেরিকস ব্যবহার করার বিকল্প হিসেবে, আপনি টাইপগুলির ইউনিয়ন ঘোষণা করতে ভার্টিকাল বার (`|`) ব্যবহার করতে পারেন, যা ওদের থেকে অনেক ভালো এবং সহজ।
+
+=== "Python 3.9+"
+
+ আপনি সেই একই বিল্টইন টাইপ জেনেরিক্স হিসেবে ব্যবহার করতে পারবেন(ভিতরে টাইপ সহ স্কয়ারে ব্রাকেট দিয়ে):
+
+ * `list`
+ * `tuple`
+ * `set`
+ * `dict`
+
+ এবং Python 3.8 এর মতোই, `typing` মডিউল থেকে:
+
+ * `Union`
+ * `Optional`
+ * ...এবং অন্যান্য।
+
+=== "Python 3.8+"
+
+ * `List`
+ * `Tuple`
+ * `Set`
+ * `Dict`
+ * `Union`
+ * `Optional`
+ * ...এবং অন্যান্য।
+
+### ক্লাস হিসেবে টাইপস
+
+আপনি একটি ভেরিয়েবলের টাইপ হিসেবে একটি ক্লাস ঘোষণা করতে পারেন।
+
+ধরুন আপনার কাছে `Person` নামে একটি ক্লাস আছে, যার একটি নাম আছে:
+
+```Python hl_lines="1-3"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+তারপর আপনি একটি ভেরিয়েবলকে `Person` টাইপের হিসেবে ঘোষণা করতে পারেন:
+
+```Python hl_lines="6"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+এবং তারপর, আবার, আপনি এডিটর সাপোর্ট পেয়ে যাবেন:
+
+
+
+লক্ষ্য করুন যে এর মানে হল "`one_person` হল ক্লাস `Person`-এর একটি **ইন্সট্যান্স**।"
+
+এর মানে এটি নয় যে "`one_person` হল **ক্লাস** যাকে বলা হয় `Person`।"
+
+## Pydantic মডেল
+
+[Pydantic](https://docs.pydantic.dev/) হল একটি Python লাইব্রেরি যা ডাটা ভ্যালিডেশন সম্পাদন করে।
+
+আপনি ডাটার "আকার" এট্রিবিউট সহ ক্লাস হিসেবে ঘোষণা করেন।
+
+এবং প্রতিটি এট্রিবিউট এর একটি টাইপ থাকে।
+
+তারপর আপনি যদি কিছু মান দিয়ে সেই ক্লাসের একটি ইন্সট্যান্স তৈরি করেন-- এটি মানগুলিকে ভ্যালিডেট করবে, প্রয়োজন অনুযায়ী তাদেরকে উপযুক্ত টাইপে রূপান্তর করবে এবং আপনাকে সমস্ত ডাটা সহ একটি অবজেক্ট প্রদান করবে।
+
+এবং আপনি সেই ফলাফল অবজেক্টের সাথে এডিটর সাপোর্ট পাবেন।
+
+অফিসিয়াল Pydantic ডক্স থেকে একটি উদাহরণ:
+
+=== "Python 3.10+"
+
+ ```Python
+ {!> ../../../docs_src/python_types/tutorial011_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python
+ {!> ../../../docs_src/python_types/tutorial011_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ {!> ../../../docs_src/python_types/tutorial011.py!}
+ ```
+
+!!! Info
+ [Pydantic সম্পর্কে আরও জানতে, এর ডকুমেন্টেশন দেখুন](https://docs.pydantic.dev/)।
+
+**FastAPI** মূলত Pydantic-এর উপর নির্মিত।
+
+আপনি এই সমস্ত কিছুর অনেক বাস্তবসম্মত উদাহরণ পাবেন [টিউটোরিয়াল - ইউজার গাইডে](https://fastapi.tiangolo.com/tutorial/)।
+
+!!! Tip
+ যখন আপনি `Optional` বা `Union[Something, None]` ব্যবহার করেন এবং কোনো ডিফল্ট মান না থাকে, Pydantic-এর একটি বিশেষ আচরণ রয়েছে, আপনি Pydantic ডকুমেন্টেশনে [Required Optional fields](https://docs.pydantic.dev/latest/concepts/models/#required-optional-fields) সম্পর্কে আরও পড়তে পারেন।
+
+## মেটাডাটা অ্যানোটেশন সহ টাইপ হিন্টস
+
+Python-এ এমন একটি ফিচার আছে যা `Annotated` ব্যবহার করে এই টাইপ হিন্টগুলিতে **অতিরিক্ত মেটাডাটা** রাখতে দেয়।
+
+=== "Python 3.9+"
+
+ Python 3.9-এ, `Annotated` স্ট্যান্ডার্ড লাইব্রেরিতে অন্তর্ভুক্ত, তাই আপনি এটি `typing` থেকে ইমপোর্ট করতে পারেন।
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial013_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ Python 3.9-এর নীচের সংস্করণগুলিতে, আপনি `Annotated`-কে `typing_extensions` থেকে ইমপোর্ট করেন।
+
+ এটি **FastAPI** এর সাথে ইতিমদ্ধে ইনস্টল হয়ে থাকবে।
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial013.py!}
+ ```
+
+Python নিজে এই `Annotated` দিয়ে কিছুই করে না। এবং এডিটর এবং অন্যান্য টুলগুলির জন্য, টাইপটি এখনও `str`।
+
+কিন্তু আপনি এই `Annotated` এর মধ্যকার জায়গাটির মধ্যে **FastAPI**-এ কীভাবে আপনার অ্যাপ্লিকেশন আচরণ করুক তা সম্পর্কে অতিরিক্ত মেটাডাটা প্রদান করার জন্য ব্যবহার করতে পারেন।
+
+মনে রাখার গুরুত্বপূর্ণ বিষয় হল যে **প্রথম *টাইপ প্যারামিটার*** আপনি `Annotated`-এ পাস করেন সেটি হল **আসল টাইপ**। বাকি শুধুমাত্র অন্যান্য টুলগুলির জন্য মেটাডাটা।
+
+এখন আপনার কেবল জানা প্রয়োজন যে `Annotated` বিদ্যমান, এবং এটি স্ট্যান্ডার্ড Python। 😎
+
+পরবর্তীতে আপনি দেখবেন এটি কতটা **শক্তিশালী** হতে পারে।
+
+!!! Tip
+ এটি **স্ট্যান্ডার্ড Python** হওয়ার মানে হল আপনি আপনার এডিটরে, আপনি যে টুলগুলি কোড বিশ্লেষণ এবং রিফ্যাক্টর করার জন্য ব্যবহার করেন তাতে **সেরা সম্ভাব্য ডেভেলপার এক্সপেরিয়েন্স** পাবেন। ✨
+
+ এবং এছাড়াও আপনার কোড অন্যান্য অনেক Python টুল এবং লাইব্রেরিগুলির সাথে খুব সামঞ্জস্যপূর্ণ হবে। 🚀
+
+## **FastAPI**-এ টাইপ হিন্টস
+
+**FastAPI** এই টাইপ হিন্টগুলি ব্যবহার করে বেশ কিছু জিনিস করে।
+
+**FastAPI**-এ আপনি টাইপ হিন্টগুলি সহ প্যারামিটার ঘোষণা করেন এবং আপনি পান:
+
+* **এডিটর সাপোর্ট**।
+* **টাইপচেক**।
+
+...এবং **FastAPI** একই ঘোষণাগুলি ব্যবহার করে:
+
+* **রিকুইরেমেন্টস সংজ্ঞায়িত করে**: রিকোয়েস্ট পাথ প্যারামিটার, কুয়েরি প্যারামিটার, হেডার, বডি, ডিপেন্ডেন্সিস, ইত্যাদি থেকে।
+* **ডেটা রূপান্তর করে**: রিকোয়েস্ট থেকে প্রয়োজনীয় টাইপে ডেটা।
+* **ডেটা যাচাই করে**: প্রতিটি রিকোয়েস্ট থেকে আসা ডেটা:
+ * যখন ডেটা অবৈধ হয় তখন **স্বয়ংক্রিয় ত্রুটি** গ্রাহকের কাছে ফেরত পাঠানো।
+* **API ডকুমেন্টেশন তৈরি করে**: OpenAPI ব্যবহার করে:
+ * যা স্বয়ংক্রিয় ইন্টার্যাক্টিভ ডকুমেন্টেশন ইউজার ইন্টারফেস দ্বারা ব্যবহৃত হয়।
+
+এই সব কিছু আপনার কাছে অস্পষ্ট মনে হতে পারে। চিন্তা করবেন না। আপনি [টিউটোরিয়াল - ইউজার গাইড](https://fastapi.tiangolo.com/tutorial/) এ এই সব কিছু প্র্যাকটিসে দেখতে পাবেন।
+
+গুরুত্বপূর্ণ বিষয় হল, আপনি যদি স্ট্যান্ডার্ড Python টাইপগুলি ব্যবহার করেন, তবে আরও বেশি ক্লাস, ডেকোরেটর ইত্যাদি যোগ না করেই একই স্থানে **FastAPI** আপনার অনেক কাজ করে দিবে।
+
+!!! Info
+ যদি আপনি টিউটোরিয়ালের সমস্ত বিষয় পড়ে ফেলে থাকেন এবং টাইপ সম্পর্কে আরও জানতে চান, তবে একটি ভালো রিসোর্স হল [mypy এর "cheat sheet"](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html)। এই "cheat sheet" এ আপনি Python টাইপ হিন্ট সম্পর্কে বেসিক থেকে উন্নত লেভেলের ধারণা পেতে পারেন, যা আপনার কোডে টাইপ সেফটি এবং স্পষ্টতা বাড়াতে সাহায্য করবে।
diff --git a/docs/de/docs/about/index.md b/docs/de/docs/about/index.md
new file mode 100644
index 000000000..4c309e02a
--- /dev/null
+++ b/docs/de/docs/about/index.md
@@ -0,0 +1,3 @@
+# Über
+
+Über FastAPI, sein Design, seine Inspiration und mehr. 🤓
diff --git a/docs/de/docs/advanced/additional-responses.md b/docs/de/docs/advanced/additional-responses.md
new file mode 100644
index 000000000..2bfcfab33
--- /dev/null
+++ b/docs/de/docs/advanced/additional-responses.md
@@ -0,0 +1,240 @@
+# Zusätzliche Responses in OpenAPI
+
+!!! warning "Achtung"
+ Dies ist ein eher fortgeschrittenes Thema.
+
+ Wenn Sie mit **FastAPI** beginnen, benötigen Sie dies möglicherweise nicht.
+
+Sie können zusätzliche Responses mit zusätzlichen Statuscodes, Medientypen, Beschreibungen, usw. deklarieren.
+
+Diese zusätzlichen Responses werden in das OpenAPI-Schema aufgenommen, sodass sie auch in der API-Dokumentation erscheinen.
+
+Für diese zusätzlichen Responses müssen Sie jedoch sicherstellen, dass Sie eine `Response`, wie etwa `JSONResponse`, direkt zurückgeben, mit Ihrem Statuscode und Inhalt.
+
+## Zusätzliche Response mit `model`
+
+Sie können Ihren *Pfadoperation-Dekoratoren* einen Parameter `responses` übergeben.
+
+Der nimmt ein `dict` entgegen, die Schlüssel sind Statuscodes für jede Response, wie etwa `200`, und die Werte sind andere `dict`s mit den Informationen für jede Response.
+
+Jedes dieser Response-`dict`s kann einen Schlüssel `model` haben, welcher ein Pydantic-Modell enthält, genau wie `response_model`.
+
+**FastAPI** nimmt dieses Modell, generiert dessen JSON-Schema und fügt es an der richtigen Stelle in OpenAPI ein.
+
+Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, können Sie schreiben:
+
+```Python hl_lines="18 22"
+{!../../../docs_src/additional_responses/tutorial001.py!}
+```
+
+!!! note "Hinweis"
+ Beachten Sie, dass Sie die `JSONResponse` direkt zurückgeben müssen.
+
+!!! info
+ Der `model`-Schlüssel ist nicht Teil von OpenAPI.
+
+ **FastAPI** nimmt das Pydantic-Modell von dort, generiert das JSON-Schema und fügt es an der richtigen Stelle ein.
+
+ Die richtige Stelle ist:
+
+ * Im Schlüssel `content`, der als Wert ein weiteres JSON-Objekt (`dict`) hat, welches Folgendes enthält:
+ * Ein Schlüssel mit dem Medientyp, z. B. `application/json`, der als Wert ein weiteres JSON-Objekt hat, welches Folgendes enthält:
+ * Ein Schlüssel `schema`, der als Wert das JSON-Schema aus dem Modell hat, hier ist die richtige Stelle.
+ * **FastAPI** fügt hier eine Referenz auf die globalen JSON-Schemas an einer anderen Stelle in Ihrer OpenAPI hinzu, anstatt es direkt einzubinden. Auf diese Weise können andere Anwendungen und Clients diese JSON-Schemas direkt verwenden, bessere Tools zur Codegenerierung bereitstellen, usw.
+
+Die generierten Responses in der OpenAPI für diese *Pfadoperation* lauten:
+
+```JSON hl_lines="3-12"
+{
+ "responses": {
+ "404": {
+ "description": "Additional Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Message"
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Item"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+Die Schemas werden von einer anderen Stelle innerhalb des OpenAPI-Schemas referenziert:
+
+```JSON hl_lines="4-16"
+{
+ "components": {
+ "schemas": {
+ "Message": {
+ "title": "Message",
+ "required": [
+ "message"
+ ],
+ "type": "object",
+ "properties": {
+ "message": {
+ "title": "Message",
+ "type": "string"
+ }
+ }
+ },
+ "Item": {
+ "title": "Item",
+ "required": [
+ "id",
+ "value"
+ ],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "type": "string"
+ },
+ "value": {
+ "title": "Value",
+ "type": "string"
+ }
+ }
+ },
+ "ValidationError": {
+ "title": "ValidationError",
+ "required": [
+ "loc",
+ "msg",
+ "type"
+ ],
+ "type": "object",
+ "properties": {
+ "loc": {
+ "title": "Location",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "msg": {
+ "title": "Message",
+ "type": "string"
+ },
+ "type": {
+ "title": "Error Type",
+ "type": "string"
+ }
+ }
+ },
+ "HTTPValidationError": {
+ "title": "HTTPValidationError",
+ "type": "object",
+ "properties": {
+ "detail": {
+ "title": "Detail",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ValidationError"
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+## Zusätzliche Medientypen für die Haupt-Response
+
+Sie können denselben `responses`-Parameter verwenden, um verschiedene Medientypen für dieselbe Haupt-Response hinzuzufügen.
+
+Sie können beispielsweise einen zusätzlichen Medientyp `image/png` hinzufügen und damit deklarieren, dass Ihre *Pfadoperation* ein JSON-Objekt (mit dem Medientyp `application/json`) oder ein PNG-Bild zurückgeben kann:
+
+```Python hl_lines="19-24 28"
+{!../../../docs_src/additional_responses/tutorial002.py!}
+```
+
+!!! note "Hinweis"
+ Beachten Sie, dass Sie das Bild direkt mit einer `FileResponse` zurückgeben müssen.
+
+!!! info
+ Sofern Sie in Ihrem Parameter `responses` nicht explizit einen anderen Medientyp angeben, geht FastAPI davon aus, dass die Response denselben Medientyp wie die Haupt-Response-Klasse hat (Standardmäßig `application/json`).
+
+ Wenn Sie jedoch eine benutzerdefinierte Response-Klasse mit `None` als Medientyp angegeben haben, verwendet FastAPI `application/json` für jede zusätzliche Response, die über ein zugehöriges Modell verfügt.
+
+## Informationen kombinieren
+
+Sie können auch Response-Informationen von mehreren Stellen kombinieren, einschließlich der Parameter `response_model`, `status_code` und `responses`.
+
+Sie können ein `response_model` deklarieren, indem Sie den Standardstatuscode `200` (oder bei Bedarf einen benutzerdefinierten) verwenden und dann zusätzliche Informationen für dieselbe Response in `responses` direkt im OpenAPI-Schema deklarieren.
+
+**FastAPI** behält die zusätzlichen Informationen aus `responses` und kombiniert sie mit dem JSON-Schema aus Ihrem Modell.
+
+Sie können beispielsweise eine Response mit dem Statuscode `404` deklarieren, die ein Pydantic-Modell verwendet und über eine benutzerdefinierte Beschreibung (`description`) verfügt.
+
+Und eine Response mit dem Statuscode `200`, die Ihr `response_model` verwendet, aber ein benutzerdefiniertes Beispiel (`example`) enthält:
+
+```Python hl_lines="20-31"
+{!../../../docs_src/additional_responses/tutorial003.py!}
+```
+
+Es wird alles kombiniert und in Ihre OpenAPI eingebunden und in der API-Dokumentation angezeigt:
+
+
+
+## Vordefinierte und benutzerdefinierte Responses kombinieren
+
+Möglicherweise möchten Sie einige vordefinierte Responses haben, die für viele *Pfadoperationen* gelten, Sie möchten diese jedoch mit benutzerdefinierten Responses kombinieren, die für jede *Pfadoperation* erforderlich sind.
+
+In diesen Fällen können Sie die Python-Technik zum „Entpacken“ eines `dict`s mit `**dict_to_unpack` verwenden:
+
+```Python
+old_dict = {
+ "old key": "old value",
+ "second old key": "second old value",
+}
+new_dict = {**old_dict, "new key": "new value"}
+```
+
+Hier wird `new_dict` alle Schlüssel-Wert-Paare von `old_dict` plus das neue Schlüssel-Wert-Paar enthalten:
+
+```Python
+{
+ "old key": "old value",
+ "second old key": "second old value",
+ "new key": "new value",
+}
+```
+
+Mit dieser Technik können Sie einige vordefinierte Responses in Ihren *Pfadoperationen* wiederverwenden und sie mit zusätzlichen benutzerdefinierten Responses kombinieren.
+
+Zum Beispiel:
+
+```Python hl_lines="13-17 26"
+{!../../../docs_src/additional_responses/tutorial004.py!}
+```
+
+## Weitere Informationen zu OpenAPI-Responses
+
+Um zu sehen, was genau Sie in die Responses aufnehmen können, können Sie die folgenden Abschnitte in der OpenAPI-Spezifikation überprüfen:
+
+* OpenAPI Responses Object, enthält das `Response Object`.
+* OpenAPI Response Object, Sie können alles davon direkt in jede Response innerhalb Ihres `responses`-Parameter einfügen. Einschließlich `description`, `headers`, `content` (darin deklarieren Sie verschiedene Medientypen und JSON-Schemas) und `links`.
diff --git a/docs/de/docs/advanced/additional-status-codes.md b/docs/de/docs/advanced/additional-status-codes.md
new file mode 100644
index 000000000..e9de267cf
--- /dev/null
+++ b/docs/de/docs/advanced/additional-status-codes.md
@@ -0,0 +1,69 @@
+# Zusätzliche Statuscodes
+
+Standardmäßig liefert **FastAPI** die Rückgabewerte (Responses) als `JSONResponse` zurück und fügt den Inhalt der jeweiligen *Pfadoperation* in das `JSONResponse` Objekt ein.
+
+Es wird der Default-Statuscode oder derjenige verwendet, den Sie in Ihrer *Pfadoperation* festgelegt haben.
+
+## Zusätzliche Statuscodes
+
+Wenn Sie neben dem Hauptstatuscode weitere Statuscodes zurückgeben möchten, können Sie dies tun, indem Sie direkt eine `Response` zurückgeben, wie etwa eine `JSONResponse`, und den zusätzlichen Statuscode direkt festlegen.
+
+Angenommen, Sie möchten eine *Pfadoperation* haben, die das Aktualisieren von Artikeln ermöglicht und bei Erfolg den HTTP-Statuscode 200 „OK“ zurückgibt.
+
+Sie möchten aber auch, dass sie neue Artikel akzeptiert. Und wenn die Elemente vorher nicht vorhanden waren, werden diese Elemente erstellt und der HTTP-Statuscode 201 „Created“ zurückgegeben.
+
+Um dies zu erreichen, importieren Sie `JSONResponse`, und geben Sie Ihren Inhalt direkt zurück, indem Sie den gewünschten `status_code` setzen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4 25"
+ {!> ../../../docs_src/additional_status_codes/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4 25"
+ {!> ../../../docs_src/additional_status_codes/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4 26"
+ {!> ../../../docs_src/additional_status_codes/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="2 23"
+ {!> ../../../docs_src/additional_status_codes/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="4 25"
+ {!> ../../../docs_src/additional_status_codes/tutorial001.py!}
+ ```
+
+!!! warning "Achtung"
+ Wenn Sie eine `Response` direkt zurückgeben, wie im obigen Beispiel, wird sie direkt zurückgegeben.
+
+ Sie wird nicht mit einem Modell usw. serialisiert.
+
+ Stellen Sie sicher, dass sie die gewünschten Daten enthält und dass die Werte gültiges JSON sind (wenn Sie `JSONResponse` verwenden).
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import JSONResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette. Das Gleiche gilt für `status`.
+
+## OpenAPI- und API-Dokumentation
+
+Wenn Sie zusätzliche Statuscodes und Responses direkt zurückgeben, werden diese nicht in das OpenAPI-Schema (die API-Dokumentation) aufgenommen, da FastAPI keine Möglichkeit hat, im Voraus zu wissen, was Sie zurückgeben werden.
+
+Sie können das jedoch in Ihrem Code dokumentieren, indem Sie Folgendes verwenden: [Zusätzliche Responses](additional-responses.md){.internal-link target=_blank}.
diff --git a/docs/de/docs/advanced/advanced-dependencies.md b/docs/de/docs/advanced/advanced-dependencies.md
new file mode 100644
index 000000000..33b93b332
--- /dev/null
+++ b/docs/de/docs/advanced/advanced-dependencies.md
@@ -0,0 +1,138 @@
+# Fortgeschrittene Abhängigkeiten
+
+## Parametrisierte Abhängigkeiten
+
+Alle Abhängigkeiten, die wir bisher gesehen haben, waren festgelegte Funktionen oder Klassen.
+
+Es kann jedoch Fälle geben, in denen Sie Parameter für eine Abhängigkeit festlegen möchten, ohne viele verschiedene Funktionen oder Klassen zu deklarieren.
+
+Stellen wir uns vor, wir möchten eine Abhängigkeit haben, die prüft, ob ein Query-Parameter `q` einen vordefinierten Inhalt hat.
+
+Aber wir wollen diesen vordefinierten Inhalt per Parameter festlegen können.
+
+## Eine „aufrufbare“ Instanz
+
+In Python gibt es eine Möglichkeit, eine Instanz einer Klasse „aufrufbar“ („callable“) zu machen.
+
+Nicht die Klasse selbst (die bereits aufrufbar ist), sondern eine Instanz dieser Klasse.
+
+Dazu deklarieren wir eine Methode `__call__`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/dependencies/tutorial011_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/dependencies/tutorial011.py!}
+ ```
+
+In diesem Fall ist dieses `__call__` das, was **FastAPI** verwendet, um nach zusätzlichen Parametern und Unterabhängigkeiten zu suchen, und das ist es auch, was später aufgerufen wird, um einen Wert an den Parameter in Ihrer *Pfadoperation-Funktion* zu übergeben.
+
+## Die Instanz parametrisieren
+
+Und jetzt können wir `__init__` verwenden, um die Parameter der Instanz zu deklarieren, die wir zum `Parametrisieren` der Abhängigkeit verwenden können:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/dependencies/tutorial011_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/dependencies/tutorial011.py!}
+ ```
+
+In diesem Fall wird **FastAPI** `__init__` nie berühren oder sich darum kümmern, wir werden es direkt in unserem Code verwenden.
+
+## Eine Instanz erstellen
+
+Wir könnten eine Instanz dieser Klasse erstellen mit:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial011_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/dependencies/tutorial011.py!}
+ ```
+
+Und auf diese Weise können wir unsere Abhängigkeit „parametrisieren“, die jetzt `"bar"` enthält, als das Attribut `checker.fixed_content`.
+
+## Die Instanz als Abhängigkeit verwenden
+
+Dann könnten wir diesen `checker` in einem `Depends(checker)` anstelle von `Depends(FixedContentQueryChecker)` verwenden, da die Abhängigkeit die Instanz `checker` und nicht die Klasse selbst ist.
+
+Und beim Auflösen der Abhängigkeit ruft **FastAPI** diesen `checker` wie folgt auf:
+
+```Python
+checker(q="somequery")
+```
+
+... und übergibt, was immer das als Wert dieser Abhängigkeit in unserer *Pfadoperation-Funktion* zurückgibt, als den Parameter `fixed_content_included`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="21"
+ {!> ../../../docs_src/dependencies/tutorial011_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/dependencies/tutorial011.py!}
+ ```
+
+!!! tip "Tipp"
+ Das alles mag gekünstelt wirken. Und es ist möglicherweise noch nicht ganz klar, welchen Nutzen das hat.
+
+ Diese Beispiele sind bewusst einfach gehalten, zeigen aber, wie alles funktioniert.
+
+ In den Kapiteln zum Thema Sicherheit gibt es Hilfsfunktionen, die auf die gleiche Weise implementiert werden.
+
+ Wenn Sie das hier alles verstanden haben, wissen Sie bereits, wie diese Sicherheits-Hilfswerkzeuge unter der Haube funktionieren.
diff --git a/docs/de/docs/advanced/async-tests.md b/docs/de/docs/advanced/async-tests.md
new file mode 100644
index 000000000..2e2c22210
--- /dev/null
+++ b/docs/de/docs/advanced/async-tests.md
@@ -0,0 +1,95 @@
+# Asynchrone Tests
+
+Sie haben bereits gesehen, wie Sie Ihre **FastAPI**-Anwendungen mit dem bereitgestellten `TestClient` testen. Bisher haben Sie nur gesehen, wie man synchrone Tests schreibt, ohne `async`hrone Funktionen zu verwenden.
+
+Die Möglichkeit, in Ihren Tests asynchrone Funktionen zu verwenden, könnte beispielsweise nützlich sein, wenn Sie Ihre Datenbank asynchron abfragen. Stellen Sie sich vor, Sie möchten das Senden von Requests an Ihre FastAPI-Anwendung testen und dann überprüfen, ob Ihr Backend die richtigen Daten erfolgreich in die Datenbank geschrieben hat, während Sie eine asynchrone Datenbankbibliothek verwenden.
+
+Schauen wir uns an, wie wir das machen können.
+
+## pytest.mark.anyio
+
+Wenn wir in unseren Tests asynchrone Funktionen aufrufen möchten, müssen unsere Testfunktionen asynchron sein. AnyIO stellt hierfür ein nettes Plugin zur Verfügung, mit dem wir festlegen können, dass einige Testfunktionen asynchron aufgerufen werden sollen.
+
+## HTTPX
+
+Auch wenn Ihre **FastAPI**-Anwendung normale `def`-Funktionen anstelle von `async def` verwendet, handelt es sich darunter immer noch um eine `async`hrone Anwendung.
+
+Der `TestClient` macht unter der Haube magisches, um die asynchrone FastAPI-Anwendung in Ihren normalen `def`-Testfunktionen, mithilfe von Standard-Pytest aufzurufen. Aber diese Magie funktioniert nicht mehr, wenn wir sie in asynchronen Funktionen verwenden. Durch die asynchrone Ausführung unserer Tests können wir den `TestClient` nicht mehr in unseren Testfunktionen verwenden.
+
+Der `TestClient` basiert auf HTTPX und glücklicherweise können wir ihn direkt verwenden, um die API zu testen.
+
+## Beispiel
+
+Betrachten wir als einfaches Beispiel eine Dateistruktur ähnlich der in [Größere Anwendungen](../tutorial/bigger-applications.md){.internal-link target=_blank} und [Testen](../tutorial/testing.md){.internal-link target=_blank}:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+│ └── test_main.py
+```
+
+Die Datei `main.py` hätte als Inhalt:
+
+```Python
+{!../../../docs_src/async_tests/main.py!}
+```
+
+Die Datei `test_main.py` hätte die Tests für `main.py`, das könnte jetzt so aussehen:
+
+```Python
+{!../../../docs_src/async_tests/test_main.py!}
+```
+
+## Es ausführen
+
+Sie können Ihre Tests wie gewohnt ausführen mit:
+
+
+
+Wenn wir jedoch unter der „offiziellen“ URL, über den Proxy mit Port `9999`, unter `/api/v1/docs`, auf die Dokumentationsoberfläche zugreifen, funktioniert es ordnungsgemäß! 🎉
+
+Sie können das unter http://127.0.0.1:9999/api/v1/docs testen:
+
+
+
+Genau so, wie wir es wollten. ✔️
+
+Dies liegt daran, dass FastAPI diesen `root_path` verwendet, um den Default-`server` in OpenAPI mit der von `root_path` bereitgestellten URL zu erstellen.
+
+## Zusätzliche Server
+
+!!! warning "Achtung"
+ Dies ist ein fortgeschrittener Anwendungsfall. Überspringen Sie das gerne.
+
+Standardmäßig erstellt **FastAPI** einen `server` im OpenAPI-Schema mit der URL für den `root_path`.
+
+Sie können aber auch andere alternative `server` bereitstellen, beispielsweise wenn Sie möchten, dass *dieselbe* Dokumentationsoberfläche mit einer Staging- und Produktionsumgebung interagiert.
+
+Wenn Sie eine benutzerdefinierte Liste von Servern (`servers`) übergeben und es einen `root_path` gibt (da Ihre API hinter einem Proxy läuft), fügt **FastAPI** einen „Server“ mit diesem `root_path` am Anfang der Liste ein.
+
+Zum Beispiel:
+
+```Python hl_lines="4-7"
+{!../../../docs_src/behind_a_proxy/tutorial003.py!}
+```
+
+Erzeugt ein OpenAPI-Schema, wie:
+
+```JSON hl_lines="5-7"
+{
+ "openapi": "3.1.0",
+ // Hier mehr Einstellungen
+ "servers": [
+ {
+ "url": "/api/v1"
+ },
+ {
+ "url": "https://stag.example.com",
+ "description": "Staging environment"
+ },
+ {
+ "url": "https://prod.example.com",
+ "description": "Production environment"
+ }
+ ],
+ "paths": {
+ // Hier mehr Einstellungen
+ }
+}
+```
+
+!!! tip "Tipp"
+ Beachten Sie den automatisch generierten Server mit dem `URL`-Wert `/api/v1`, welcher vom `root_path` stammt.
+
+In der Dokumentationsoberfläche unter http://127.0.0.1:9999/api/v1/docs würde es so aussehen:
+
+
+
+!!! tip "Tipp"
+ Die Dokumentationsoberfläche interagiert mit dem von Ihnen ausgewählten Server.
+
+### Den automatischen Server von `root_path` deaktivieren
+
+Wenn Sie nicht möchten, dass **FastAPI** einen automatischen Server inkludiert, welcher `root_path` verwendet, können Sie den Parameter `root_path_in_servers=False` verwenden:
+
+```Python hl_lines="9"
+{!../../../docs_src/behind_a_proxy/tutorial004.py!}
+```
+
+Dann wird er nicht in das OpenAPI-Schema aufgenommen.
+
+## Mounten einer Unteranwendung
+
+Wenn Sie gleichzeitig eine Unteranwendung mounten (wie beschrieben in [Unteranwendungen – Mounts](sub-applications.md){.internal-link target=_blank}) und einen Proxy mit `root_path` verwenden wollen, können Sie das normal tun, wie Sie es erwarten würden.
+
+FastAPI verwendet intern den `root_path` auf intelligente Weise, sodass es einfach funktioniert. ✨
diff --git a/docs/de/docs/advanced/custom-response.md b/docs/de/docs/advanced/custom-response.md
new file mode 100644
index 000000000..68c037ad7
--- /dev/null
+++ b/docs/de/docs/advanced/custom-response.md
@@ -0,0 +1,300 @@
+# Benutzerdefinierte Response – HTML, Stream, Datei, andere
+
+Standardmäßig gibt **FastAPI** die Responses mittels `JSONResponse` zurück.
+
+Sie können das überschreiben, indem Sie direkt eine `Response` zurückgeben, wie in [Eine Response direkt zurückgeben](response-directly.md){.internal-link target=_blank} gezeigt.
+
+Wenn Sie jedoch direkt eine `Response` zurückgeben, werden die Daten nicht automatisch konvertiert und die Dokumentation wird nicht automatisch generiert (zum Beispiel wird der spezifische „Medientyp“, der im HTTP-Header `Content-Type` angegeben ist, nicht Teil der generierten OpenAPI).
+
+Sie können aber auch die `Response`, die Sie verwenden möchten, im *Pfadoperation-Dekorator* deklarieren.
+
+Der Inhalt, den Sie von Ihrer *Pfadoperation-Funktion* zurückgeben, wird in diese `Response` eingefügt.
+
+Und wenn diese `Response` einen JSON-Medientyp (`application/json`) hat, wie es bei `JSONResponse` und `UJSONResponse` der Fall ist, werden die von Ihnen zurückgegebenen Daten automatisch mit jedem Pydantic `response_model` konvertiert (und gefiltert), das Sie im *Pfadoperation-Dekorator* deklariert haben.
+
+!!! note "Hinweis"
+ Wenn Sie eine Response-Klasse ohne Medientyp verwenden, erwartet FastAPI, dass Ihre Response keinen Inhalt hat, und dokumentiert daher das Format der Response nicht in deren generierter OpenAPI-Dokumentation.
+
+## `ORJSONResponse` verwenden
+
+Um beispielsweise noch etwas Leistung herauszuholen, können Sie `orjson` installieren und verwenden, und die Response als `ORJSONResponse` deklarieren.
+
+Importieren Sie die `Response`-Klasse (-Unterklasse), die Sie verwenden möchten, und deklarieren Sie sie im *Pfadoperation-Dekorator*.
+
+Bei umfangreichen Responses ist die direkte Rückgabe einer `Response` viel schneller als ein Dictionary zurückzugeben.
+
+Das liegt daran, dass FastAPI standardmäßig jedes enthaltene Element überprüft und sicherstellt, dass es als JSON serialisierbar ist, und zwar unter Verwendung desselben [JSON-kompatiblen Encoders](../tutorial/encoder.md){.internal-link target=_blank}, der im Tutorial erläutert wurde. Dadurch können Sie **beliebige Objekte** zurückgeben, zum Beispiel Datenbankmodelle.
+
+Wenn Sie jedoch sicher sind, dass der von Ihnen zurückgegebene Inhalt **mit JSON serialisierbar** ist, können Sie ihn direkt an die Response-Klasse übergeben und die zusätzliche Arbeit vermeiden, die FastAPI hätte, indem es Ihren zurückgegebenen Inhalt durch den `jsonable_encoder` leitet, bevor es ihn an die Response-Klasse übergibt.
+
+```Python hl_lines="2 7"
+{!../../../docs_src/custom_response/tutorial001b.py!}
+```
+
+!!! info
+ Der Parameter `response_class` wird auch verwendet, um den „Medientyp“ der Response zu definieren.
+
+ In diesem Fall wird der HTTP-Header `Content-Type` auf `application/json` gesetzt.
+
+ Und er wird als solcher in OpenAPI dokumentiert.
+
+!!! tip "Tipp"
+ Die `ORJSONResponse` ist derzeit nur in FastAPI verfügbar, nicht in Starlette.
+
+## HTML-Response
+
+Um eine Response mit HTML direkt von **FastAPI** zurückzugeben, verwenden Sie `HTMLResponse`.
+
+* Importieren Sie `HTMLResponse`.
+* Übergeben Sie `HTMLResponse` als den Parameter `response_class` Ihres *Pfadoperation-Dekorators*.
+
+```Python hl_lines="2 7"
+{!../../../docs_src/custom_response/tutorial002.py!}
+```
+
+!!! info
+ Der Parameter `response_class` wird auch verwendet, um den „Medientyp“ der Response zu definieren.
+
+ In diesem Fall wird der HTTP-Header `Content-Type` auf `text/html` gesetzt.
+
+ Und er wird als solcher in OpenAPI dokumentiert.
+
+### Eine `Response` zurückgeben
+
+Wie in [Eine Response direkt zurückgeben](response-directly.md){.internal-link target=_blank} gezeigt, können Sie die Response auch direkt in Ihrer *Pfadoperation* überschreiben, indem Sie diese zurückgeben.
+
+Das gleiche Beispiel von oben, das eine `HTMLResponse` zurückgibt, könnte so aussehen:
+
+```Python hl_lines="2 7 19"
+{!../../../docs_src/custom_response/tutorial003.py!}
+```
+
+!!! warning "Achtung"
+ Eine `Response`, die direkt von Ihrer *Pfadoperation-Funktion* zurückgegeben wird, wird in OpenAPI nicht dokumentiert (zum Beispiel wird der `Content-Type` nicht dokumentiert) und ist in der automatischen interaktiven Dokumentation nicht sichtbar.
+
+!!! info
+ Natürlich stammen der eigentliche `Content-Type`-Header, der Statuscode, usw., aus dem `Response`-Objekt, das Sie zurückgegeben haben.
+
+### In OpenAPI dokumentieren und `Response` überschreiben
+
+Wenn Sie die Response innerhalb der Funktion überschreiben und gleichzeitig den „Medientyp“ in OpenAPI dokumentieren möchten, können Sie den `response_class`-Parameter verwenden UND ein `Response`-Objekt zurückgeben.
+
+Die `response_class` wird dann nur zur Dokumentation der OpenAPI-Pfadoperation* verwendet, Ihre `Response` wird jedoch unverändert verwendet.
+
+#### Eine `HTMLResponse` direkt zurückgeben
+
+Es könnte zum Beispiel so etwas sein:
+
+```Python hl_lines="7 21 23"
+{!../../../docs_src/custom_response/tutorial004.py!}
+```
+
+In diesem Beispiel generiert die Funktion `generate_html_response()` bereits eine `Response` und gibt sie zurück, anstatt das HTML in einem `str` zurückzugeben.
+
+Indem Sie das Ergebnis des Aufrufs von `generate_html_response()` zurückgeben, geben Sie bereits eine `Response` zurück, die das Standardverhalten von **FastAPI** überschreibt.
+
+Aber da Sie die `HTMLResponse` auch in der `response_class` übergeben haben, weiß **FastAPI**, dass sie in OpenAPI und der interaktiven Dokumentation als HTML mit `text/html` zu dokumentieren ist:
+
+
+
+## Verfügbare Responses
+
+Hier sind einige der verfügbaren Responses.
+
+Bedenken Sie, dass Sie `Response` verwenden können, um alles andere zurückzugeben, oder sogar eine benutzerdefinierte Unterklasse zu erstellen.
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import HTMLResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
+
+### `Response`
+
+Die Hauptklasse `Response`, alle anderen Responses erben von ihr.
+
+Sie können sie direkt zurückgeben.
+
+Sie akzeptiert die folgenden Parameter:
+
+* `content` – Ein `str` oder `bytes`.
+* `status_code` – Ein `int`-HTTP-Statuscode.
+* `headers` – Ein `dict` von Strings.
+* `media_type` – Ein `str`, der den Medientyp angibt. Z. B. `"text/html"`.
+
+FastAPI (eigentlich Starlette) fügt automatisch einen Content-Length-Header ein. Außerdem wird es einen Content-Type-Header einfügen, der auf dem media_type basiert, und für Texttypen einen Zeichensatz (charset) anfügen.
+
+```Python hl_lines="1 18"
+{!../../../docs_src/response_directly/tutorial002.py!}
+```
+
+### `HTMLResponse`
+
+Nimmt Text oder Bytes entgegen und gibt eine HTML-Response zurück, wie Sie oben gelesen haben.
+
+### `PlainTextResponse`
+
+Nimmt Text oder Bytes entgegen und gibt eine Plain-Text-Response zurück.
+
+```Python hl_lines="2 7 9"
+{!../../../docs_src/custom_response/tutorial005.py!}
+```
+
+### `JSONResponse`
+
+Nimmt einige Daten entgegen und gibt eine `application/json`-codierte Response zurück.
+
+Dies ist die Standard-Response, die in **FastAPI** verwendet wird, wie Sie oben gelesen haben.
+
+### `ORJSONResponse`
+
+Eine schnelle alternative JSON-Response mit `orjson`, wie Sie oben gelesen haben.
+
+### `UJSONResponse`
+
+Eine alternative JSON-Response mit `ujson`.
+
+!!! warning "Achtung"
+ `ujson` ist bei der Behandlung einiger Sonderfälle weniger sorgfältig als Pythons eingebaute Implementierung.
+
+```Python hl_lines="2 7"
+{!../../../docs_src/custom_response/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Möglicherweise ist `ORJSONResponse` eine schnellere Alternative.
+
+### `RedirectResponse`
+
+Gibt eine HTTP-Weiterleitung (HTTP-Redirect) zurück. Verwendet standardmäßig den Statuscode 307 – Temporäre Weiterleitung (Temporary Redirect).
+
+Sie können eine `RedirectResponse` direkt zurückgeben:
+
+```Python hl_lines="2 9"
+{!../../../docs_src/custom_response/tutorial006.py!}
+```
+
+---
+
+Oder Sie können sie im Parameter `response_class` verwenden:
+
+
+```Python hl_lines="2 7 9"
+{!../../../docs_src/custom_response/tutorial006b.py!}
+```
+
+Wenn Sie das tun, können Sie die URL direkt von Ihrer *Pfadoperation*-Funktion zurückgeben.
+
+In diesem Fall ist der verwendete `status_code` der Standardcode für die `RedirectResponse`, also `307`.
+
+---
+
+Sie können den Parameter `status_code` auch in Kombination mit dem Parameter `response_class` verwenden:
+
+```Python hl_lines="2 7 9"
+{!../../../docs_src/custom_response/tutorial006c.py!}
+```
+
+### `StreamingResponse`
+
+Nimmt einen asynchronen Generator oder einen normalen Generator/Iterator und streamt den Responsebody.
+
+```Python hl_lines="2 14"
+{!../../../docs_src/custom_response/tutorial007.py!}
+```
+
+#### Verwendung von `StreamingResponse` mit dateiähnlichen Objekten
+
+Wenn Sie ein dateiähnliches (file-like) Objekt haben (z. B. das von `open()` zurückgegebene Objekt), können Sie eine Generatorfunktion erstellen, um über dieses dateiähnliche Objekt zu iterieren.
+
+Auf diese Weise müssen Sie nicht alles zuerst in den Arbeitsspeicher lesen und können diese Generatorfunktion an `StreamingResponse` übergeben und zurückgeben.
+
+Das umfasst viele Bibliotheken zur Interaktion mit Cloud-Speicher, Videoverarbeitung und anderen.
+
+```{ .python .annotate hl_lines="2 10-12 14" }
+{!../../../docs_src/custom_response/tutorial008.py!}
+```
+
+1. Das ist die Generatorfunktion. Es handelt sich um eine „Generatorfunktion“, da sie `yield`-Anweisungen enthält.
+2. Durch die Verwendung eines `with`-Blocks stellen wir sicher, dass das dateiähnliche Objekt geschlossen wird, nachdem die Generatorfunktion fertig ist. Also, nachdem sie mit dem Senden der Response fertig ist.
+3. Dieses `yield from` weist die Funktion an, über das Ding namens `file_like` zu iterieren. Und dann für jeden iterierten Teil, diesen Teil so zurückzugeben, als wenn er aus dieser Generatorfunktion (`iterfile`) stammen würde.
+
+ Es handelt sich also hier um eine Generatorfunktion, die die „generierende“ Arbeit intern auf etwas anderes überträgt.
+
+ Auf diese Weise können wir das Ganze in einen `with`-Block einfügen und so sicherstellen, dass das dateiartige Objekt nach Abschluss geschlossen wird.
+
+!!! tip "Tipp"
+ Beachten Sie, dass wir, da wir Standard-`open()` verwenden, welches `async` und `await` nicht unterstützt, hier die Pfadoperation mit normalen `def` deklarieren.
+
+### `FileResponse`
+
+Streamt eine Datei asynchron als Response.
+
+Nimmt zur Instanziierung einen anderen Satz von Argumenten entgegen als die anderen Response-Typen:
+
+* `path` – Der Dateipfad zur Datei, die gestreamt werden soll.
+* `headers` – Alle benutzerdefinierten Header, die inkludiert werden sollen, als Dictionary.
+* `media_type` – Ein String, der den Medientyp angibt. Wenn nicht gesetzt, wird der Dateiname oder Pfad verwendet, um auf einen Medientyp zu schließen.
+* `filename` – Wenn gesetzt, wird das in der `Content-Disposition` der Response eingefügt.
+
+Datei-Responses enthalten die entsprechenden `Content-Length`-, `Last-Modified`- und `ETag`-Header.
+
+```Python hl_lines="2 10"
+{!../../../docs_src/custom_response/tutorial009.py!}
+```
+
+Sie können auch den Parameter `response_class` verwenden:
+
+```Python hl_lines="2 8 10"
+{!../../../docs_src/custom_response/tutorial009b.py!}
+```
+
+In diesem Fall können Sie den Dateipfad direkt von Ihrer *Pfadoperation*-Funktion zurückgeben.
+
+## Benutzerdefinierte Response-Klasse
+
+Sie können Ihre eigene benutzerdefinierte Response-Klasse erstellen, die von `Response` erbt und diese verwendet.
+
+Nehmen wir zum Beispiel an, dass Sie `orjson` verwenden möchten, aber mit einigen benutzerdefinierten Einstellungen, die in der enthaltenen `ORJSONResponse`-Klasse nicht verwendet werden.
+
+Sie möchten etwa, dass Ihre Response eingerücktes und formatiertes JSON zurückgibt. Dafür möchten Sie die orjson-Option `orjson.OPT_INDENT_2` verwenden.
+
+Sie könnten eine `CustomORJSONResponse` erstellen. Das Wichtigste, was Sie tun müssen, ist, eine `Response.render(content)`-Methode zu erstellen, die den Inhalt als `bytes` zurückgibt:
+
+```Python hl_lines="9-14 17"
+{!../../../docs_src/custom_response/tutorial009c.py!}
+```
+
+Statt:
+
+```json
+{"message": "Hello World"}
+```
+
+... wird die Response jetzt Folgendes zurückgeben:
+
+```json
+{
+ "message": "Hello World"
+}
+```
+
+Natürlich werden Sie wahrscheinlich viel bessere Möglichkeiten finden, Vorteil daraus zu ziehen, als JSON zu formatieren. 😉
+
+## Standard-Response-Klasse
+
+Beim Erstellen einer **FastAPI**-Klasseninstanz oder eines `APIRouter`s können Sie angeben, welche Response-Klasse standardmäßig verwendet werden soll.
+
+Der Parameter, der das definiert, ist `default_response_class`.
+
+Im folgenden Beispiel verwendet **FastAPI** standardmäßig `ORJSONResponse` in allen *Pfadoperationen*, anstelle von `JSONResponse`.
+
+```Python hl_lines="2 4"
+{!../../../docs_src/custom_response/tutorial010.py!}
+```
+
+!!! tip "Tipp"
+ Sie können dennoch weiterhin `response_class` in *Pfadoperationen* überschreiben, wie bisher.
+
+## Zusätzliche Dokumentation
+
+Sie können auch den Medientyp und viele andere Details in OpenAPI mit `responses` deklarieren: [Zusätzliche Responses in OpenAPI](additional-responses.md){.internal-link target=_blank}.
diff --git a/docs/de/docs/advanced/dataclasses.md b/docs/de/docs/advanced/dataclasses.md
new file mode 100644
index 000000000..c78a6d3dd
--- /dev/null
+++ b/docs/de/docs/advanced/dataclasses.md
@@ -0,0 +1,98 @@
+# Verwendung von Datenklassen
+
+FastAPI basiert auf **Pydantic** und ich habe Ihnen gezeigt, wie Sie Pydantic-Modelle verwenden können, um Requests und Responses zu deklarieren.
+
+Aber FastAPI unterstützt auf die gleiche Weise auch die Verwendung von `dataclasses`:
+
+```Python hl_lines="1 7-12 19-20"
+{!../../../docs_src/dataclasses/tutorial001.py!}
+```
+
+Das ist dank **Pydantic** ebenfalls möglich, da es `dataclasses` intern unterstützt.
+
+Auch wenn im obige Code Pydantic nicht explizit vorkommt, verwendet FastAPI Pydantic, um diese Standard-Datenklassen in Pydantics eigene Variante von Datenklassen zu konvertieren.
+
+Und natürlich wird das gleiche unterstützt:
+
+* Validierung der Daten
+* Serialisierung der Daten
+* Dokumentation der Daten, usw.
+
+Das funktioniert genauso wie mit Pydantic-Modellen. Und tatsächlich wird es unter der Haube mittels Pydantic auf die gleiche Weise bewerkstelligt.
+
+!!! info
+ Bedenken Sie, dass Datenklassen nicht alles können, was Pydantic-Modelle können.
+
+ Daher müssen Sie möglicherweise weiterhin Pydantic-Modelle verwenden.
+
+ Wenn Sie jedoch eine Menge Datenklassen herumliegen haben, ist dies ein guter Trick, um sie für eine Web-API mithilfe von FastAPI zu verwenden. 🤓
+
+## Datenklassen als `response_model`
+
+Sie können `dataclasses` auch im Parameter `response_model` verwenden:
+
+```Python hl_lines="1 7-13 19"
+{!../../../docs_src/dataclasses/tutorial002.py!}
+```
+
+Die Datenklasse wird automatisch in eine Pydantic-Datenklasse konvertiert.
+
+Auf diese Weise wird deren Schema in der Benutzeroberfläche der API-Dokumentation angezeigt:
+
+
+
+## Datenklassen in verschachtelten Datenstrukturen
+
+Sie können `dataclasses` auch mit anderen Typannotationen kombinieren, um verschachtelte Datenstrukturen zu erstellen.
+
+In einigen Fällen müssen Sie möglicherweise immer noch Pydantics Version von `dataclasses` verwenden. Zum Beispiel, wenn Sie Fehler in der automatisch generierten API-Dokumentation haben.
+
+In diesem Fall können Sie einfach die Standard-`dataclasses` durch `pydantic.dataclasses` ersetzen, was einen direkten Ersatz darstellt:
+
+```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" }
+{!../../../docs_src/dataclasses/tutorial003.py!}
+```
+
+1. Wir importieren `field` weiterhin von Standard-`dataclasses`.
+
+2. `pydantic.dataclasses` ist ein direkter Ersatz für `dataclasses`.
+
+3. Die Datenklasse `Author` enthält eine Liste von `Item`-Datenklassen.
+
+4. Die Datenklasse `Author` wird im `response_model`-Parameter verwendet.
+
+5. Sie können andere Standard-Typannotationen mit Datenklassen als Requestbody verwenden.
+
+ In diesem Fall handelt es sich um eine Liste von `Item`-Datenklassen.
+
+6. Hier geben wir ein Dictionary zurück, das `items` enthält, welches eine Liste von Datenklassen ist.
+
+ FastAPI ist weiterhin in der Lage, die Daten nach JSON zu serialisieren.
+
+7. Hier verwendet das `response_model` als Typannotation eine Liste von `Author`-Datenklassen.
+
+ Auch hier können Sie `dataclasses` mit Standard-Typannotationen kombinieren.
+
+8. Beachten Sie, dass diese *Pfadoperation-Funktion* reguläres `def` anstelle von `async def` verwendet.
+
+ Wie immer können Sie in FastAPI `def` und `async def` beliebig kombinieren.
+
+ Wenn Sie eine Auffrischung darüber benötigen, wann welche Anwendung sinnvoll ist, lesen Sie den Abschnitt „In Eile?“ in der Dokumentation zu [`async` und `await`](../async.md#in-eile){.internal-link target=_blank}.
+
+9. Diese *Pfadoperation-Funktion* gibt keine Datenklassen zurück (obwohl dies möglich wäre), sondern eine Liste von Dictionarys mit internen Daten.
+
+ FastAPI verwendet den Parameter `response_model` (der Datenklassen enthält), um die Response zu konvertieren.
+
+Sie können `dataclasses` mit anderen Typannotationen auf vielfältige Weise kombinieren, um komplexe Datenstrukturen zu bilden.
+
+Weitere Einzelheiten finden Sie in den Bemerkungen im Quellcode oben.
+
+## Mehr erfahren
+
+Sie können `dataclasses` auch mit anderen Pydantic-Modellen kombinieren, von ihnen erben, sie in Ihre eigenen Modelle einbinden, usw.
+
+Weitere Informationen finden Sie in der Pydantic-Dokumentation zu Datenklassen.
+
+## Version
+
+Dies ist verfügbar seit FastAPI-Version `0.67.0`. 🔖
diff --git a/docs/de/docs/advanced/events.md b/docs/de/docs/advanced/events.md
new file mode 100644
index 000000000..e29f61ab9
--- /dev/null
+++ b/docs/de/docs/advanced/events.md
@@ -0,0 +1,162 @@
+# Lifespan-Events
+
+Sie können Logik (Code) definieren, die ausgeführt werden soll, bevor die Anwendung **hochfährt**. Dies bedeutet, dass dieser Code **einmal** ausgeführt wird, **bevor** die Anwendung **beginnt, Requests entgegenzunehmen**.
+
+Auf die gleiche Weise können Sie Logik (Code) definieren, die ausgeführt werden soll, wenn die Anwendung **heruntergefahren** wird. In diesem Fall wird dieser Code **einmal** ausgeführt, **nachdem** möglicherweise **viele Requests** bearbeitet wurden.
+
+Da dieser Code ausgeführt wird, bevor die Anwendung **beginnt**, Requests entgegenzunehmen, und unmittelbar, nachdem sie die Bearbeitung von Requests **abgeschlossen hat**, deckt er die gesamte **Lebensdauer – „Lifespan“** – der Anwendung ab (das Wort „Lifespan“ wird gleich wichtig sein 😉).
+
+Dies kann sehr nützlich sein, um **Ressourcen** einzurichten, die Sie in der gesamten Anwendung verwenden wollen und die von Requests **gemeinsam genutzt** werden und/oder die Sie anschließend **aufräumen** müssen. Zum Beispiel ein Pool von Datenbankverbindungen oder das Laden eines gemeinsam genutzten Modells für maschinelles Lernen.
+
+## Anwendungsfall
+
+Beginnen wir mit einem Beispiel-**Anwendungsfall** und schauen uns dann an, wie wir ihn mit dieser Methode implementieren können.
+
+Stellen wir uns vor, Sie verfügen über einige **Modelle für maschinelles Lernen**, die Sie zur Bearbeitung von Requests verwenden möchten. 🤖
+
+Die gleichen Modelle werden von den Requests gemeinsam genutzt, es handelt sich also nicht um ein Modell pro Request, pro Benutzer, oder ähnliches.
+
+Stellen wir uns vor, dass das Laden des Modells **eine ganze Weile dauern** kann, da viele **Daten von der Festplatte** gelesen werden müssen. Sie möchten das also nicht für jeden Request tun.
+
+Sie könnten das auf der obersten Ebene des Moduls/der Datei machen, aber das würde auch bedeuten, dass **das Modell geladen wird**, selbst wenn Sie nur einen einfachen automatisierten Test ausführen, dann wäre dieser Test **langsam**, weil er warten müsste, bis das Modell geladen ist, bevor er einen davon unabhängigen Teil des Codes ausführen könnte.
+
+Das wollen wir besser machen: Laden wir das Modell, bevor die Requests bearbeitet werden, aber unmittelbar bevor die Anwendung beginnt, Requests zu empfangen, und nicht, während der Code geladen wird.
+
+## Lifespan
+
+Sie können diese Logik beim *Hochfahren* und *Herunterfahren* mithilfe des `lifespan`-Parameters der `FastAPI`-App und eines „Kontextmanagers“ definieren (ich zeige Ihnen gleich, was das ist).
+
+Beginnen wir mit einem Beispiel und sehen es uns dann im Detail an.
+
+Wir erstellen eine asynchrone Funktion `lifespan()` mit `yield` wie folgt:
+
+```Python hl_lines="16 19"
+{!../../../docs_src/events/tutorial003.py!}
+```
+
+Hier simulieren wir das langsame *Hochfahren*, das Laden des Modells, indem wir die (Fake-)Modellfunktion vor dem `yield` in das Dictionary mit Modellen für maschinelles Lernen einfügen. Dieser Code wird ausgeführt, **bevor** die Anwendung **beginnt, Requests entgegenzunehmen**, während des *Hochfahrens*.
+
+Und dann, direkt nach dem `yield`, entladen wir das Modell. Dieser Code wird unmittelbar vor dem *Herunterfahren* ausgeführt, **nachdem** die Anwendung **die Bearbeitung von Requests abgeschlossen hat**. Dadurch könnten beispielsweise Ressourcen wie Arbeitsspeicher oder eine GPU freigegeben werden.
+
+!!! tip "Tipp"
+ Das *Herunterfahren* würde erfolgen, wenn Sie die Anwendung **stoppen**.
+
+ Möglicherweise müssen Sie eine neue Version starten, oder Sie haben es einfach satt, sie auszuführen. 🤷
+
+### Lifespan-Funktion
+
+Das Erste, was auffällt, ist, dass wir eine asynchrone Funktion mit `yield` definieren. Das ist sehr ähnlich zu Abhängigkeiten mit `yield`.
+
+```Python hl_lines="14-19"
+{!../../../docs_src/events/tutorial003.py!}
+```
+
+Der erste Teil der Funktion, vor dem `yield`, wird ausgeführt **bevor** die Anwendung startet.
+
+Und der Teil nach `yield` wird ausgeführt, **nachdem** die Anwendung beendet ist.
+
+### Asynchroner Kontextmanager
+
+Wie Sie sehen, ist die Funktion mit einem `@asynccontextmanager` versehen.
+
+Dadurch wird die Funktion in einen sogenannten „**asynchronen Kontextmanager**“ umgewandelt.
+
+```Python hl_lines="1 13"
+{!../../../docs_src/events/tutorial003.py!}
+```
+
+Ein **Kontextmanager** in Python ist etwas, das Sie in einer `with`-Anweisung verwenden können, zum Beispiel kann `open()` als Kontextmanager verwendet werden:
+
+```Python
+with open("file.txt") as file:
+ file.read()
+```
+
+In neueren Versionen von Python gibt es auch einen **asynchronen Kontextmanager**. Sie würden ihn mit `async with` verwenden:
+
+```Python
+async with lifespan(app):
+ await do_stuff()
+```
+
+Wenn Sie wie oben einen Kontextmanager oder einen asynchronen Kontextmanager erstellen, führt dieser vor dem Betreten des `with`-Blocks den Code vor dem `yield` aus, und nach dem Verlassen des `with`-Blocks wird er den Code nach dem `yield` ausführen.
+
+In unserem obigen Codebeispiel verwenden wir ihn nicht direkt, sondern übergeben ihn an FastAPI, damit es ihn verwenden kann.
+
+Der Parameter `lifespan` der `FastAPI`-App benötigt einen **asynchronen Kontextmanager**, wir können ihm also unseren neuen asynchronen Kontextmanager `lifespan` übergeben.
+
+```Python hl_lines="22"
+{!../../../docs_src/events/tutorial003.py!}
+```
+
+## Alternative Events (deprecated)
+
+!!! warning "Achtung"
+ Der empfohlene Weg, das *Hochfahren* und *Herunterfahren* zu handhaben, ist die Verwendung des `lifespan`-Parameters der `FastAPI`-App, wie oben beschrieben. Wenn Sie einen `lifespan`-Parameter übergeben, werden die `startup`- und `shutdown`-Eventhandler nicht mehr aufgerufen. Es ist entweder alles `lifespan` oder alles Events, nicht beides.
+
+ Sie können diesen Teil wahrscheinlich überspringen.
+
+Es gibt eine alternative Möglichkeit, diese Logik zu definieren, sodass sie beim *Hochfahren* und beim *Herunterfahren* ausgeführt wird.
+
+Sie können Eventhandler (Funktionen) definieren, die ausgeführt werden sollen, bevor die Anwendung hochgefahren wird oder wenn die Anwendung heruntergefahren wird.
+
+Diese Funktionen können mit `async def` oder normalem `def` deklariert werden.
+
+### `startup`-Event
+
+Um eine Funktion hinzuzufügen, die vor dem Start der Anwendung ausgeführt werden soll, deklarieren Sie diese mit dem Event `startup`:
+
+```Python hl_lines="8"
+{!../../../docs_src/events/tutorial001.py!}
+```
+
+In diesem Fall initialisiert die Eventhandler-Funktion `startup` die „Datenbank“ der Items (nur ein `dict`) mit einigen Werten.
+
+Sie können mehr als eine Eventhandler-Funktion hinzufügen.
+
+Und Ihre Anwendung empfängt erst dann Anfragen, wenn alle `startup`-Eventhandler abgeschlossen sind.
+
+### `shutdown`-Event
+
+Um eine Funktion hinzuzufügen, die beim Herunterfahren der Anwendung ausgeführt werden soll, deklarieren Sie sie mit dem Event `shutdown`:
+
+```Python hl_lines="6"
+{!../../../docs_src/events/tutorial002.py!}
+```
+
+Hier schreibt die `shutdown`-Eventhandler-Funktion eine Textzeile `"Application shutdown"` in eine Datei `log.txt`.
+
+!!! info
+ In der Funktion `open()` bedeutet `mode="a"` „append“ („anhängen“), sodass die Zeile nach dem, was sich in dieser Datei befindet, hinzugefügt wird, ohne den vorherigen Inhalt zu überschreiben.
+
+!!! tip "Tipp"
+ Beachten Sie, dass wir in diesem Fall eine Standard-Python-Funktion `open()` verwenden, die mit einer Datei interagiert.
+
+ Es handelt sich also um I/O (Input/Output), welches „Warten“ erfordert, bis Dinge auf die Festplatte geschrieben werden.
+
+ Aber `open()` verwendet nicht `async` und `await`.
+
+ Daher deklarieren wir die Eventhandler-Funktion mit Standard-`def` statt mit `async def`.
+
+### `startup` und `shutdown` zusammen
+
+Es besteht eine hohe Wahrscheinlichkeit, dass die Logik für Ihr *Hochfahren* und *Herunterfahren* miteinander verknüpft ist. Vielleicht möchten Sie etwas beginnen und es dann beenden, eine Ressource laden und sie dann freigeben usw.
+
+Bei getrennten Funktionen, die keine gemeinsame Logik oder Variablen haben, ist dies schwieriger, da Sie Werte in globalen Variablen speichern oder ähnliche Tricks verwenden müssen.
+
+Aus diesem Grund wird jetzt empfohlen, stattdessen `lifespan` wie oben erläutert zu verwenden.
+
+## Technische Details
+
+Nur ein technisches Detail für die neugierigen Nerds. 🤓
+
+In der technischen ASGI-Spezifikation ist dies Teil des Lifespan Protokolls und definiert Events namens `startup` und `shutdown`.
+
+!!! info
+ Weitere Informationen zu Starlettes `lifespan`-Handlern finden Sie in Starlettes Lifespan-Dokumentation.
+
+ Einschließlich, wie man Lifespan-Zustand handhabt, der in anderen Bereichen Ihres Codes verwendet werden kann.
+
+## Unteranwendungen
+
+🚨 Beachten Sie, dass diese Lifespan-Events (Hochfahren und Herunterfahren) nur für die Hauptanwendung ausgeführt werden, nicht für [Unteranwendungen – Mounts](sub-applications.md){.internal-link target=_blank}.
diff --git a/docs/de/docs/advanced/generate-clients.md b/docs/de/docs/advanced/generate-clients.md
new file mode 100644
index 000000000..7d1d69353
--- /dev/null
+++ b/docs/de/docs/advanced/generate-clients.md
@@ -0,0 +1,286 @@
+# Clients generieren
+
+Da **FastAPI** auf der OpenAPI-Spezifikation basiert, erhalten Sie automatische Kompatibilität mit vielen Tools, einschließlich der automatischen API-Dokumentation (bereitgestellt von Swagger UI).
+
+Ein besonderer Vorteil, der nicht unbedingt offensichtlich ist, besteht darin, dass Sie für Ihre API **Clients generieren** können (manchmal auch **SDKs** genannt), für viele verschiedene **Programmiersprachen**.
+
+## OpenAPI-Client-Generatoren
+
+Es gibt viele Tools zum Generieren von Clients aus **OpenAPI**.
+
+Ein gängiges Tool ist OpenAPI Generator.
+
+Wenn Sie ein **Frontend** erstellen, ist openapi-ts eine sehr interessante Alternative.
+
+## Client- und SDK-Generatoren – Sponsor
+
+Es gibt auch einige **vom Unternehmen entwickelte** Client- und SDK-Generatoren, die auf OpenAPI (FastAPI) basieren. In einigen Fällen können diese Ihnen **weitere Funktionalität** zusätzlich zu qualitativ hochwertigen generierten SDKs/Clients bieten.
+
+Einige von diesen ✨ [**sponsern FastAPI**](../help-fastapi.md#den-autor-sponsern){.internal-link target=_blank} ✨, das gewährleistet die kontinuierliche und gesunde **Entwicklung** von FastAPI und seinem **Ökosystem**.
+
+Und es zeigt deren wahres Engagement für FastAPI und seine **Community** (Sie), da diese Ihnen nicht nur einen **guten Service** bieten möchten, sondern auch sicherstellen möchten, dass Sie über ein **gutes und gesundes Framework** verfügen, FastAPI. 🙇
+
+Beispielsweise könnten Sie Speakeasy ausprobieren.
+
+Es gibt auch mehrere andere Unternehmen, welche ähnliche Dienste anbieten und die Sie online suchen und finden können. 🤓
+
+## Einen TypeScript-Frontend-Client generieren
+
+Beginnen wir mit einer einfachen FastAPI-Anwendung:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="7-9 12-13 16-17 21"
+ {!> ../../../docs_src/generate_clients/tutorial001_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-11 14-15 18 19 23"
+ {!> ../../../docs_src/generate_clients/tutorial001.py!}
+ ```
+
+Beachten Sie, dass die *Pfadoperationen* die Modelle definieren, welche diese für die Request- und Response-Payload verwenden, indem sie die Modelle `Item` und `ResponseMessage` verwenden.
+
+### API-Dokumentation
+
+Wenn Sie zur API-Dokumentation gehen, werden Sie sehen, dass diese die **Schemas** für die Daten enthält, welche in Requests gesendet und in Responses empfangen werden:
+
+
+
+Sie können diese Schemas sehen, da sie mit den Modellen in der Anwendung deklariert wurden.
+
+Diese Informationen sind im **OpenAPI-Schema** der Anwendung verfügbar und werden dann in der API-Dokumentation angezeigt (von Swagger UI).
+
+Und dieselben Informationen aus den Modellen, die in OpenAPI enthalten sind, können zum **Generieren des Client-Codes** verwendet werden.
+
+### Einen TypeScript-Client generieren
+
+Nachdem wir nun die Anwendung mit den Modellen haben, können wir den Client-Code für das Frontend generieren.
+
+#### `openapi-ts` installieren
+
+Sie können `openapi-ts` in Ihrem Frontend-Code installieren mit:
+
+
+
+Sie erhalten außerdem automatische Vervollständigung für die zu sendende Payload:
+
+
+
+!!! tip "Tipp"
+ Beachten Sie die automatische Vervollständigung für `name` und `price`, welche in der FastAPI-Anwendung im `Item`-Modell definiert wurden.
+
+Sie erhalten Inline-Fehlerberichte für die von Ihnen gesendeten Daten:
+
+
+
+Das Response-Objekt hat auch automatische Vervollständigung:
+
+
+
+## FastAPI-Anwendung mit Tags
+
+In vielen Fällen wird Ihre FastAPI-Anwendung größer sein und Sie werden wahrscheinlich Tags verwenden, um verschiedene Gruppen von *Pfadoperationen* zu separieren.
+
+Beispielsweise könnten Sie einen Abschnitt für **Items (Artikel)** und einen weiteren Abschnitt für **Users (Benutzer)** haben, und diese könnten durch Tags getrennt sein:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="21 26 34"
+ {!> ../../../docs_src/generate_clients/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="23 28 36"
+ {!> ../../../docs_src/generate_clients/tutorial002.py!}
+ ```
+
+### Einen TypeScript-Client mit Tags generieren
+
+Wenn Sie unter Verwendung von Tags einen Client für eine FastAPI-Anwendung generieren, wird normalerweise auch der Client-Code anhand der Tags getrennt.
+
+Auf diese Weise können Sie die Dinge für den Client-Code richtig ordnen und gruppieren:
+
+
+
+In diesem Fall haben Sie:
+
+* `ItemsService`
+* `UsersService`
+
+### Client-Methodennamen
+
+Im Moment sehen die generierten Methodennamen wie `createItemItemsPost` nicht sehr sauber aus:
+
+```TypeScript
+ItemsService.createItemItemsPost({name: "Plumbus", price: 5})
+```
+
+... das liegt daran, dass der Client-Generator für jede *Pfadoperation* die OpenAPI-interne **Operation-ID** verwendet.
+
+OpenAPI erfordert, dass jede Operation-ID innerhalb aller *Pfadoperationen* eindeutig ist. Daher verwendet FastAPI den **Funktionsnamen**, den **Pfad** und die **HTTP-Methode/-Operation**, um diese Operation-ID zu generieren. Denn so kann sichergestellt werden, dass die Operation-IDs eindeutig sind.
+
+Aber ich zeige Ihnen als nächstes, wie Sie das verbessern können. 🤓
+
+## Benutzerdefinierte Operation-IDs und bessere Methodennamen
+
+Sie können die Art und Weise, wie diese Operation-IDs **generiert** werden, **ändern**, um sie einfacher zu machen und **einfachere Methodennamen** in den Clients zu haben.
+
+In diesem Fall müssen Sie auf andere Weise sicherstellen, dass jede Operation-ID **eindeutig** ist.
+
+Sie könnten beispielsweise sicherstellen, dass jede *Pfadoperation* einen Tag hat, und dann die Operation-ID basierend auf dem **Tag** und dem **Namen** der *Pfadoperation* (dem Funktionsnamen) generieren.
+
+### Funktion zum Generieren einer eindeutigen ID erstellen
+
+FastAPI verwendet eine **eindeutige ID** für jede *Pfadoperation*, diese wird für die **Operation-ID** und auch für die Namen aller benötigten benutzerdefinierten Modelle für Requests oder Responses verwendet.
+
+Sie können diese Funktion anpassen. Sie nimmt eine `APIRoute` und gibt einen String zurück.
+
+Hier verwendet sie beispielsweise den ersten Tag (Sie werden wahrscheinlich nur einen Tag haben) und den Namen der *Pfadoperation* (den Funktionsnamen).
+
+Anschließend können Sie diese benutzerdefinierte Funktion als Parameter `generate_unique_id_function` an **FastAPI** übergeben:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="6-7 10"
+ {!> ../../../docs_src/generate_clients/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8-9 12"
+ {!> ../../../docs_src/generate_clients/tutorial003.py!}
+ ```
+
+### Einen TypeScript-Client mit benutzerdefinierten Operation-IDs generieren
+
+Wenn Sie nun den Client erneut generieren, werden Sie feststellen, dass er über die verbesserten Methodennamen verfügt:
+
+
+
+Wie Sie sehen, haben die Methodennamen jetzt den Tag und dann den Funktionsnamen, aber keine Informationen aus dem URL-Pfad und der HTTP-Operation.
+
+### Vorab-Modifikation der OpenAPI-Spezifikation für den Client-Generator
+
+Der generierte Code enthält immer noch etwas **verdoppelte Information**.
+
+Wir wissen bereits, dass diese Methode mit den **Items** zusammenhängt, da sich dieses Wort in `ItemsService` befindet (vom Tag übernommen), aber wir haben auch immer noch den Tagnamen im Methodennamen vorangestellt. 😕
+
+Wir werden das wahrscheinlich weiterhin für OpenAPI im Allgemeinen beibehalten wollen, da dadurch sichergestellt wird, dass die Operation-IDs **eindeutig** sind.
+
+Aber für den generierten Client könnten wir die OpenAPI-Operation-IDs direkt vor der Generierung der Clients **modifizieren**, um diese Methodennamen schöner und **sauberer** zu machen.
+
+Wir könnten das OpenAPI-JSON in eine Datei `openapi.json` herunterladen und dann mit einem Skript wie dem folgenden **den vorangestellten Tag entfernen**:
+
+=== "Python"
+
+ ```Python
+ {!> ../../../docs_src/generate_clients/tutorial004.py!}
+ ```
+
+=== "Node.js"
+
+ ```Javascript
+ {!> ../../../docs_src/generate_clients/tutorial004.js!}
+ ```
+
+Damit würden die Operation-IDs von Dingen wie `items-get_items` in `get_items` umbenannt, sodass der Client-Generator einfachere Methodennamen generieren kann.
+
+### Einen TypeScript-Client mit der modifizierten OpenAPI generieren
+
+Da das Endergebnis nun in einer Datei `openapi.json` vorliegt, würden Sie die `package.json` ändern, um diese lokale Datei zu verwenden, zum Beispiel:
+
+```JSON hl_lines="7"
+{
+ "name": "frontend-app",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.js",
+ "scripts": {
+ "generate-client": "openapi-ts --input ./openapi.json --output ./src/client --client axios"
+ },
+ "author": "",
+ "license": "",
+ "devDependencies": {
+ "@hey-api/openapi-ts": "^0.27.38",
+ "typescript": "^4.6.2"
+ }
+}
+```
+
+Nach der Generierung des neuen Clients hätten Sie nun **saubere Methodennamen** mit allen **Autovervollständigungen**, **Inline-Fehlerberichten**, usw.:
+
+
+
+## Vorteile
+
+Wenn Sie die automatisch generierten Clients verwenden, erhalten Sie **automatische Codevervollständigung** für:
+
+* Methoden.
+* Request-Payloads im Body, Query-Parameter, usw.
+* Response-Payloads.
+
+Außerdem erhalten Sie für alles **Inline-Fehlerberichte**.
+
+Und wann immer Sie den Backend-Code aktualisieren und das Frontend **neu generieren**, stehen alle neuen *Pfadoperationen* als Methoden zur Verfügung, die alten werden entfernt und alle anderen Änderungen werden im generierten Code reflektiert. 🤓
+
+Das bedeutet auch, dass, wenn sich etwas ändert, dies automatisch im Client-Code **reflektiert** wird. Und wenn Sie den Client **erstellen**, kommt es zu einer Fehlermeldung, wenn die verwendeten Daten **nicht übereinstimmen**.
+
+Sie würden also sehr früh im Entwicklungszyklus **viele Fehler erkennen**, anstatt darauf warten zu müssen, dass die Fehler Ihren Endbenutzern in der Produktion angezeigt werden, und dann zu versuchen, zu debuggen, wo das Problem liegt. ✨
diff --git a/docs/de/docs/advanced/index.md b/docs/de/docs/advanced/index.md
new file mode 100644
index 000000000..048e31e06
--- /dev/null
+++ b/docs/de/docs/advanced/index.md
@@ -0,0 +1,33 @@
+# Handbuch für fortgeschrittene Benutzer
+
+## Zusatzfunktionen
+
+Das Haupt-[Tutorial – Benutzerhandbuch](../tutorial/index.md){.internal-link target=_blank} sollte ausreichen, um Ihnen einen Überblick über alle Hauptfunktionen von **FastAPI** zu geben.
+
+In den nächsten Abschnitten sehen Sie weitere Optionen, Konfigurationen und zusätzliche Funktionen.
+
+!!! tip "Tipp"
+ Die nächsten Abschnitte sind **nicht unbedingt „fortgeschritten“**.
+
+ Und es ist möglich, dass für Ihren Anwendungsfall die Lösung in einem davon liegt.
+
+## Lesen Sie zuerst das Tutorial
+
+Sie können immer noch die meisten Funktionen in **FastAPI** mit den Kenntnissen aus dem Haupt-[Tutorial – Benutzerhandbuch](../tutorial/index.md){.internal-link target=_blank} nutzen.
+
+Und in den nächsten Abschnitten wird davon ausgegangen, dass Sie es bereits gelesen haben und dass Sie diese Haupt-Ideen kennen.
+
+## Externe Kurse
+
+Obwohl das [Tutorial – Benutzerhandbuch](../tutorial/index.md){.internal-link target=_blank} und dieses **Handbuch für fortgeschrittene Benutzer** als geführtes Tutorial (wie ein Buch) geschrieben sind und für Sie ausreichen sollten, um **FastAPI zu lernen**, möchten Sie sie vielleicht durch zusätzliche Kurse ergänzen.
+
+Oder Sie belegen einfach lieber andere Kurse, weil diese besser zu Ihrem Lernstil passen.
+
+Einige Kursanbieter ✨ [**sponsern FastAPI**](../help-fastapi.md#den-autor-sponsern){.internal-link target=_blank} ✨, dies gewährleistet die kontinuierliche und gesunde **Entwicklung** von FastAPI und seinem **Ökosystem**.
+
+Und es zeigt deren wahres Engagement für FastAPI und seine **Gemeinschaft** (Sie), da diese Ihnen nicht nur eine **gute Lernerfahrung** bieten möchten, sondern auch sicherstellen möchten, dass Sie über ein **gutes und gesundes Framework verfügen **, FastAPI. 🙇
+
+Vielleicht möchten Sie ihre Kurse ausprobieren:
+
+* Talk Python Training
+* Test-Driven Development
diff --git a/docs/de/docs/advanced/middleware.md b/docs/de/docs/advanced/middleware.md
new file mode 100644
index 000000000..2c4e8542a
--- /dev/null
+++ b/docs/de/docs/advanced/middleware.md
@@ -0,0 +1,99 @@
+# Fortgeschrittene Middleware
+
+Im Haupttutorial haben Sie gelesen, wie Sie Ihrer Anwendung [benutzerdefinierte Middleware](../tutorial/middleware.md){.internal-link target=_blank} hinzufügen können.
+
+Und dann auch, wie man [CORS mittels der `CORSMiddleware`](../tutorial/cors.md){.internal-link target=_blank} handhabt.
+
+In diesem Abschnitt werden wir sehen, wie man andere Middlewares verwendet.
+
+## ASGI-Middleware hinzufügen
+
+Da **FastAPI** auf Starlette basiert und die ASGI-Spezifikation implementiert, können Sie jede ASGI-Middleware verwenden.
+
+Eine Middleware muss nicht speziell für FastAPI oder Starlette gemacht sein, um zu funktionieren, solange sie der ASGI-Spezifikation genügt.
+
+Im Allgemeinen handelt es sich bei ASGI-Middleware um Klassen, die als erstes Argument eine ASGI-Anwendung erwarten.
+
+In der Dokumentation für ASGI-Middlewares von Drittanbietern wird Ihnen wahrscheinlich gesagt, etwa Folgendes zu tun:
+
+```Python
+from unicorn import UnicornMiddleware
+
+app = SomeASGIApp()
+
+new_app = UnicornMiddleware(app, some_config="rainbow")
+```
+
+Aber FastAPI (eigentlich Starlette) bietet eine einfachere Möglichkeit, welche sicherstellt, dass die internen Middlewares zur Behandlung von Serverfehlern und benutzerdefinierten Exceptionhandlern ordnungsgemäß funktionieren.
+
+Dazu verwenden Sie `app.add_middleware()` (wie schon im Beispiel für CORS gesehen).
+
+```Python
+from fastapi import FastAPI
+from unicorn import UnicornMiddleware
+
+app = FastAPI()
+
+app.add_middleware(UnicornMiddleware, some_config="rainbow")
+```
+
+`app.add_middleware()` empfängt eine Middleware-Klasse als erstes Argument und dann alle weiteren Argumente, die an die Middleware übergeben werden sollen.
+
+## Integrierte Middleware
+
+**FastAPI** enthält mehrere Middlewares für gängige Anwendungsfälle. Wir werden als Nächstes sehen, wie man sie verwendet.
+
+!!! note "Technische Details"
+ Für die nächsten Beispiele könnten Sie auch `from starlette.middleware.something import SomethingMiddleware` verwenden.
+
+ **FastAPI** bietet mehrere Middlewares via `fastapi.middleware` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Middlewares kommen aber direkt von Starlette.
+
+## `HTTPSRedirectMiddleware`
+
+Erzwingt, dass alle eingehenden Requests entweder `https` oder `wss` sein müssen.
+
+Alle eingehenden Requests an `http` oder `ws` werden stattdessen an das sichere Schema umgeleitet.
+
+```Python hl_lines="2 6"
+{!../../../docs_src/advanced_middleware/tutorial001.py!}
+```
+
+## `TrustedHostMiddleware`
+
+Erzwingt, dass alle eingehenden Requests einen korrekt gesetzten `Host`-Header haben, um sich vor HTTP-Host-Header-Angriffen zu schützen.
+
+```Python hl_lines="2 6-8"
+{!../../../docs_src/advanced_middleware/tutorial002.py!}
+```
+
+Die folgenden Argumente werden unterstützt:
+
+* `allowed_hosts` – Eine Liste von Domain-Namen, die als Hostnamen zulässig sein sollten. Wildcard-Domains wie `*.example.com` werden unterstützt, um Subdomains zu matchen. Um jeden Hostnamen zu erlauben, verwenden Sie entweder `allowed_hosts=["*"]` oder lassen Sie diese Middleware weg.
+
+Wenn ein eingehender Request nicht korrekt validiert wird, wird eine „400“-Response gesendet.
+
+## `GZipMiddleware`
+
+Verarbeitet GZip-Responses für alle Requests, die `"gzip"` im `Accept-Encoding`-Header enthalten.
+
+Diese Middleware verarbeitet sowohl Standard- als auch Streaming-Responses.
+
+```Python hl_lines="2 6"
+{!../../../docs_src/advanced_middleware/tutorial003.py!}
+```
+
+Die folgenden Argumente werden unterstützt:
+
+* `minimum_size` – Antworten, die kleiner als diese Mindestgröße in Bytes sind, nicht per GZip komprimieren. Der Defaultwert ist `500`.
+
+## Andere Middlewares
+
+Es gibt viele andere ASGI-Middlewares.
+
+Zum Beispiel:
+
+* Sentry
+* Uvicorns `ProxyHeadersMiddleware`
+* MessagePack
+
+Um mehr über weitere verfügbare Middlewares herauszufinden, besuchen Sie Starlettes Middleware-Dokumentation und die ASGI Awesome List.
diff --git a/docs/de/docs/advanced/openapi-callbacks.md b/docs/de/docs/advanced/openapi-callbacks.md
new file mode 100644
index 000000000..026fdb4fe
--- /dev/null
+++ b/docs/de/docs/advanced/openapi-callbacks.md
@@ -0,0 +1,179 @@
+# OpenAPI-Callbacks
+
+Sie könnten eine API mit einer *Pfadoperation* erstellen, die einen Request an eine *externe API* auslösen könnte, welche von jemand anderem erstellt wurde (wahrscheinlich derselbe Entwickler, der Ihre API *verwenden* würde).
+
+Der Vorgang, der stattfindet, wenn Ihre API-Anwendung die *externe API* aufruft, wird als „Callback“ („Rückruf“) bezeichnet. Denn die Software, die der externe Entwickler geschrieben hat, sendet einen Request an Ihre API und dann *ruft Ihre API zurück* (*calls back*) und sendet einen Request an eine *externe API* (die wahrscheinlich vom selben Entwickler erstellt wurde).
+
+In diesem Fall möchten Sie möglicherweise dokumentieren, wie diese externe API aussehen *sollte*. Welche *Pfadoperation* sie haben sollte, welchen Body sie erwarten sollte, welche Response sie zurückgeben sollte, usw.
+
+## Eine Anwendung mit Callbacks
+
+Sehen wir uns das alles anhand eines Beispiels an.
+
+Stellen Sie sich vor, Sie entwickeln eine Anwendung, mit der Sie Rechnungen erstellen können.
+
+Diese Rechnungen haben eine `id`, einen optionalen `title`, einen `customer` (Kunde) und ein `total` (Gesamtsumme).
+
+Der Benutzer Ihrer API (ein externer Entwickler) erstellt mit einem POST-Request eine Rechnung in Ihrer API.
+
+Dann wird Ihre API (beispielsweise):
+
+* die Rechnung an einen Kunden des externen Entwicklers senden.
+* das Geld einsammeln.
+* eine Benachrichtigung an den API-Benutzer (den externen Entwickler) zurücksenden.
+ * Dies erfolgt durch Senden eines POST-Requests (von *Ihrer API*) an eine *externe API*, die von diesem externen Entwickler bereitgestellt wird (das ist der „Callback“).
+
+## Die normale **FastAPI**-Anwendung
+
+Sehen wir uns zunächst an, wie die normale API-Anwendung aussehen würde, bevor wir den Callback hinzufügen.
+
+Sie verfügt über eine *Pfadoperation*, die einen `Invoice`-Body empfängt, und einen Query-Parameter `callback_url`, der die URL für den Callback enthält.
+
+Dieser Teil ist ziemlich normal, der größte Teil des Codes ist Ihnen wahrscheinlich bereits bekannt:
+
+```Python hl_lines="9-13 36-53"
+{!../../../docs_src/openapi_callbacks/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Der Query-Parameter `callback_url` verwendet einen Pydantic-Url-Typ.
+
+Das einzig Neue ist `callbacks=invoices_callback_router.routes` als Argument für den *Pfadoperation-Dekorator*. Wir werden als Nächstes sehen, was das ist.
+
+## Dokumentation des Callbacks
+
+Der tatsächliche Callback-Code hängt stark von Ihrer eigenen API-Anwendung ab.
+
+Und er wird wahrscheinlich von Anwendung zu Anwendung sehr unterschiedlich sein.
+
+Es könnten nur eine oder zwei Codezeilen sein, wie zum Beispiel:
+
+```Python
+callback_url = "https://example.com/api/v1/invoices/events/"
+httpx.post(callback_url, json={"description": "Invoice paid", "paid": True})
+```
+
+Der möglicherweise wichtigste Teil des Callbacks besteht jedoch darin, sicherzustellen, dass Ihr API-Benutzer (der externe Entwickler) die *externe API* gemäß den Daten, die *Ihre API* im Requestbody des Callbacks senden wird, korrekt implementiert, usw.
+
+Als Nächstes fügen wir den Code hinzu, um zu dokumentieren, wie diese *externe API* aussehen sollte, um den Callback von *Ihrer API* zu empfangen.
+
+Diese Dokumentation wird in der Swagger-Oberfläche unter `/docs` in Ihrer API angezeigt und zeigt externen Entwicklern, wie diese die *externe API* erstellen sollten.
+
+In diesem Beispiel wird nicht der Callback selbst implementiert (das könnte nur eine Codezeile sein), sondern nur der Dokumentationsteil.
+
+!!! tip "Tipp"
+ Der eigentliche Callback ist nur ein HTTP-Request.
+
+ Wenn Sie den Callback selbst implementieren, können Sie beispielsweise HTTPX oder Requests verwenden.
+
+## Schreiben des Codes, der den Callback dokumentiert
+
+Dieser Code wird nicht in Ihrer Anwendung ausgeführt, wir benötigen ihn nur, um zu *dokumentieren*, wie diese *externe API* aussehen soll.
+
+Sie wissen jedoch bereits, wie Sie mit **FastAPI** ganz einfach eine automatische Dokumentation für eine API erstellen.
+
+Daher werden wir dasselbe Wissen nutzen, um zu dokumentieren, wie die *externe API* aussehen sollte ... indem wir die *Pfadoperation(en)* erstellen, welche die externe API implementieren soll (die, welche Ihre API aufruft).
+
+!!! tip "Tipp"
+ Wenn Sie den Code zum Dokumentieren eines Callbacks schreiben, kann es hilfreich sein, sich vorzustellen, dass Sie dieser *externe Entwickler* sind. Und dass Sie derzeit die *externe API* implementieren, nicht *Ihre API*.
+
+ Wenn Sie diese Sichtweise (des *externen Entwicklers*) vorübergehend übernehmen, wird es offensichtlicher, wo die Parameter, das Pydantic-Modell für den Body, die Response, usw. für diese *externe API* hingehören.
+
+### Einen Callback-`APIRouter` erstellen
+
+Erstellen Sie zunächst einen neuen `APIRouter`, der einen oder mehrere Callbacks enthält.
+
+```Python hl_lines="3 25"
+{!../../../docs_src/openapi_callbacks/tutorial001.py!}
+```
+
+### Die Callback-*Pfadoperation* erstellen
+
+Um die Callback-*Pfadoperation* zu erstellen, verwenden Sie denselben `APIRouter`, den Sie oben erstellt haben.
+
+Sie sollte wie eine normale FastAPI-*Pfadoperation* aussehen:
+
+* Sie sollte wahrscheinlich eine Deklaration des Bodys enthalten, die sie erhalten soll, z. B. `body: InvoiceEvent`.
+* Und sie könnte auch eine Deklaration der Response enthalten, die zurückgegeben werden soll, z. B. `response_model=InvoiceEventReceived`.
+
+```Python hl_lines="16-18 21-22 28-32"
+{!../../../docs_src/openapi_callbacks/tutorial001.py!}
+```
+
+Es gibt zwei Hauptunterschiede zu einer normalen *Pfadoperation*:
+
+* Es muss kein tatsächlicher Code vorhanden sein, da Ihre Anwendung diesen Code niemals aufruft. Sie wird nur zur Dokumentation der *externen API* verwendet. Die Funktion könnte also einfach `pass` enthalten.
+* Der *Pfad* kann einen OpenAPI-3-Ausdruck enthalten (mehr dazu weiter unten), wo er Variablen mit Parametern und Teilen des ursprünglichen Requests verwenden kann, der an *Ihre API* gesendet wurde.
+
+### Der Callback-Pfadausdruck
+
+Der Callback-*Pfad* kann einen OpenAPI-3-Ausdruck enthalten, welcher Teile des ursprünglichen Requests enthalten kann, der an *Ihre API* gesendet wurde.
+
+In diesem Fall ist es der `str`:
+
+```Python
+"{$callback_url}/invoices/{$request.body.id}"
+```
+
+Wenn Ihr API-Benutzer (der externe Entwickler) also einen Request an *Ihre API* sendet, via:
+
+```
+https://yourapi.com/invoices/?callback_url=https://www.external.org/events
+```
+
+mit einem JSON-Körper:
+
+```JSON
+{
+ "id": "2expen51ve",
+ "customer": "Mr. Richie Rich",
+ "total": "9999"
+}
+```
+
+dann verarbeitet *Ihre API* die Rechnung und sendet irgendwann später einen Callback-Request an die `callback_url` (die *externe API*):
+
+```
+https://www.external.org/events/invoices/2expen51ve
+```
+
+mit einem JSON-Body, der etwa Folgendes enthält:
+
+```JSON
+{
+ "description": "Payment celebration",
+ "paid": true
+}
+```
+
+und sie würde eine Response von dieser *externen API* mit einem JSON-Body wie dem folgenden erwarten:
+
+```JSON
+{
+ "ok": true
+}
+```
+
+!!! tip "Tipp"
+ Beachten Sie, dass die verwendete Callback-URL die URL enthält, die als Query-Parameter in `callback_url` (`https://www.external.org/events`) empfangen wurde, und auch die Rechnungs-`id` aus dem JSON-Body (`2expen51ve`).
+
+### Den Callback-Router hinzufügen
+
+An diesem Punkt haben Sie die benötigte(n) *Callback-Pfadoperation(en)* (diejenige(n), die der *externe Entwickler* in der *externen API* implementieren sollte) im Callback-Router, den Sie oben erstellt haben.
+
+Verwenden Sie nun den Parameter `callbacks` im *Pfadoperation-Dekorator Ihrer API*, um das Attribut `.routes` (das ist eigentlich nur eine `list`e von Routen/*Pfadoperationen*) dieses Callback-Routers zu übergeben:
+
+```Python hl_lines="35"
+{!../../../docs_src/openapi_callbacks/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Beachten Sie, dass Sie nicht den Router selbst (`invoices_callback_router`) an `callback=` übergeben, sondern das Attribut `.routes`, wie in `invoices_callback_router.routes`.
+
+### Es in der Dokumentation ansehen
+
+Jetzt können Sie Ihre Anwendung mit Uvicorn starten und auf http://127.0.0.1:8000/docs gehen.
+
+Sie sehen Ihre Dokumentation, einschließlich eines Abschnitts „Callbacks“ für Ihre *Pfadoperation*, der zeigt, wie die *externe API* aussehen sollte:
+
+
diff --git a/docs/de/docs/advanced/openapi-webhooks.md b/docs/de/docs/advanced/openapi-webhooks.md
new file mode 100644
index 000000000..339218080
--- /dev/null
+++ b/docs/de/docs/advanced/openapi-webhooks.md
@@ -0,0 +1,51 @@
+# OpenAPI-Webhooks
+
+Es gibt Fälle, in denen Sie Ihren API-Benutzern mitteilen möchten, dass Ihre Anwendung mit einigen Daten *deren* Anwendung aufrufen (ein Request senden) könnte, normalerweise um über ein bestimmtes **Event** zu **benachrichtigen**.
+
+Das bedeutet, dass anstelle des normalen Prozesses, bei dem Benutzer Requests an Ihre API senden, **Ihre API** (oder Ihre Anwendung) **Requests an deren System** (an deren API, deren Anwendung) senden könnte.
+
+Das wird normalerweise als **Webhook** bezeichnet.
+
+## Webhooks-Schritte
+
+Der Prozess besteht normalerweise darin, dass **Sie in Ihrem Code definieren**, welche Nachricht Sie senden möchten, den **Body des Requests**.
+
+Sie definieren auch auf irgendeine Weise, zu welchen **Momenten** Ihre Anwendung diese Requests oder Events sendet.
+
+Und **Ihre Benutzer** definieren auf irgendeine Weise (zum Beispiel irgendwo in einem Web-Dashboard) die **URL**, an die Ihre Anwendung diese Requests senden soll.
+
+Die gesamte **Logik** zur Registrierung der URLs für Webhooks und der Code zum tatsächlichen Senden dieser Requests liegt bei Ihnen. Sie schreiben es so, wie Sie möchten, in **Ihrem eigenen Code**.
+
+## Webhooks mit **FastAPI** und OpenAPI dokumentieren
+
+Mit **FastAPI** können Sie mithilfe von OpenAPI die Namen dieser Webhooks, die Arten von HTTP-Operationen, die Ihre Anwendung senden kann (z. B. `POST`, `PUT`, usw.) und die Request**bodys** definieren, die Ihre Anwendung senden würde.
+
+Dies kann es Ihren Benutzern viel einfacher machen, **deren APIs zu implementieren**, um Ihre **Webhook**-Requests zu empfangen. Möglicherweise können diese sogar einen Teil des eigenem API-Codes automatisch generieren.
+
+!!! info
+ Webhooks sind in OpenAPI 3.1.0 und höher verfügbar und werden von FastAPI `0.99.0` und höher unterstützt.
+
+## Eine Anwendung mit Webhooks
+
+Wenn Sie eine **FastAPI**-Anwendung erstellen, gibt es ein `webhooks`-Attribut, mit dem Sie *Webhooks* definieren können, genauso wie Sie *Pfadoperationen* definieren würden, zum Beispiel mit `@app.webhooks.post()`.
+
+```Python hl_lines="9-13 36-53"
+{!../../../docs_src/openapi_webhooks/tutorial001.py!}
+```
+
+Die von Ihnen definierten Webhooks landen im **OpenAPI**-Schema und der automatischen **Dokumentations-Oberfläche**.
+
+!!! info
+ Das `app.webhooks`-Objekt ist eigentlich nur ein `APIRouter`, derselbe Typ, den Sie verwenden würden, wenn Sie Ihre Anwendung mit mehreren Dateien strukturieren.
+
+Beachten Sie, dass Sie bei Webhooks tatsächlich keinen *Pfad* (wie `/items/`) deklarieren, sondern dass der Text, den Sie dort übergeben, lediglich eine **Kennzeichnung** des Webhooks (der Name des Events) ist. Zum Beispiel ist in `@app.webhooks.post("new-subscription")` der Webhook-Name `new-subscription`.
+
+Das liegt daran, dass erwartet wird, dass **Ihre Benutzer** den tatsächlichen **URL-Pfad**, an dem diese den Webhook-Request empfangen möchten, auf andere Weise definieren (z. B. über ein Web-Dashboard).
+
+### Es in der Dokumentation ansehen
+
+Jetzt können Sie Ihre Anwendung mit Uvicorn starten und auf http://127.0.0.1:8000/docs gehen.
+
+Sie werden sehen, dass Ihre Dokumentation die normalen *Pfadoperationen* und jetzt auch einige **Webhooks** enthält:
+
+
diff --git a/docs/de/docs/advanced/path-operation-advanced-configuration.md b/docs/de/docs/advanced/path-operation-advanced-configuration.md
new file mode 100644
index 000000000..406a08e9e
--- /dev/null
+++ b/docs/de/docs/advanced/path-operation-advanced-configuration.md
@@ -0,0 +1,192 @@
+# Fortgeschrittene Konfiguration der Pfadoperation
+
+## OpenAPI operationId
+
+!!! warning "Achtung"
+ Wenn Sie kein „Experte“ für OpenAPI sind, brauchen Sie dies wahrscheinlich nicht.
+
+Mit dem Parameter `operation_id` können Sie die OpenAPI `operationId` festlegen, die in Ihrer *Pfadoperation* verwendet werden soll.
+
+Sie müssten sicherstellen, dass sie für jede Operation eindeutig ist.
+
+```Python hl_lines="6"
+{!../../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
+```
+
+### Verwendung des Namens der *Pfadoperation-Funktion* als operationId
+
+Wenn Sie die Funktionsnamen Ihrer API als `operationId`s verwenden möchten, können Sie über alle iterieren und die `operation_id` jeder *Pfadoperation* mit deren `APIRoute.name` überschreiben.
+
+Sie sollten dies tun, nachdem Sie alle Ihre *Pfadoperationen* hinzugefügt haben.
+
+```Python hl_lines="2 12-21 24"
+{!../../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
+```
+
+!!! tip "Tipp"
+ Wenn Sie `app.openapi()` manuell aufrufen, sollten Sie vorher die `operationId`s aktualisiert haben.
+
+!!! warning "Achtung"
+ Wenn Sie dies tun, müssen Sie sicherstellen, dass jede Ihrer *Pfadoperation-Funktionen* einen eindeutigen Namen hat.
+
+ Auch wenn diese sich in unterschiedlichen Modulen (Python-Dateien) befinden.
+
+## Von OpenAPI ausschließen
+
+Um eine *Pfadoperation* aus dem generierten OpenAPI-Schema (und damit aus den automatischen Dokumentationssystemen) auszuschließen, verwenden Sie den Parameter `include_in_schema` und setzen Sie ihn auf `False`:
+
+```Python hl_lines="6"
+{!../../../docs_src/path_operation_advanced_configuration/tutorial003.py!}
+```
+
+## Fortgeschrittene Beschreibung mittels Docstring
+
+Sie können die verwendeten Zeilen aus dem Docstring einer *Pfadoperation-Funktion* einschränken, die für OpenAPI verwendet werden.
+
+Das Hinzufügen eines `\f` (ein maskiertes „Form Feed“-Zeichen) führt dazu, dass **FastAPI** die für OpenAPI verwendete Ausgabe an dieser Stelle abschneidet.
+
+Sie wird nicht in der Dokumentation angezeigt, aber andere Tools (z. B. Sphinx) können den Rest verwenden.
+
+```Python hl_lines="19-29"
+{!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
+```
+
+## Zusätzliche Responses
+
+Sie haben wahrscheinlich gesehen, wie man das `response_model` und den `status_code` für eine *Pfadoperation* deklariert.
+
+Das definiert die Metadaten der Haupt-Response einer *Pfadoperation*.
+
+Sie können auch zusätzliche Responses mit deren Modellen, Statuscodes usw. deklarieren.
+
+Es gibt hier in der Dokumentation ein ganzes Kapitel darüber, Sie können es unter [Zusätzliche Responses in OpenAPI](additional-responses.md){.internal-link target=_blank} lesen.
+
+## OpenAPI-Extra
+
+Wenn Sie in Ihrer Anwendung eine *Pfadoperation* deklarieren, generiert **FastAPI** automatisch die relevanten Metadaten dieser *Pfadoperation*, die in das OpenAPI-Schema aufgenommen werden sollen.
+
+!!! note "Technische Details"
+ In der OpenAPI-Spezifikation wird das Operationsobjekt genannt.
+
+Es hat alle Informationen zur *Pfadoperation* und wird zur Erstellung der automatischen Dokumentation verwendet.
+
+Es enthält `tags`, `parameters`, `requestBody`, `responses`, usw.
+
+Dieses *Pfadoperation*-spezifische OpenAPI-Schema wird normalerweise automatisch von **FastAPI** generiert, Sie können es aber auch erweitern.
+
+!!! tip "Tipp"
+ Dies ist ein Low-Level Erweiterungspunkt.
+
+ Wenn Sie nur zusätzliche Responses deklarieren müssen, können Sie dies bequemer mit [Zusätzliche Responses in OpenAPI](additional-responses.md){.internal-link target=_blank} tun.
+
+Sie können das OpenAPI-Schema für eine *Pfadoperation* erweitern, indem Sie den Parameter `openapi_extra` verwenden.
+
+### OpenAPI-Erweiterungen
+
+Dieses `openapi_extra` kann beispielsweise hilfreich sein, um OpenAPI-Erweiterungen zu deklarieren:
+
+```Python hl_lines="6"
+{!../../../docs_src/path_operation_advanced_configuration/tutorial005.py!}
+```
+
+Wenn Sie die automatische API-Dokumentation öffnen, wird Ihre Erweiterung am Ende der spezifischen *Pfadoperation* angezeigt.
+
+
+
+Und wenn Sie die resultierende OpenAPI sehen (unter `/openapi.json` in Ihrer API), sehen Sie Ihre Erweiterung auch als Teil der spezifischen *Pfadoperation*:
+
+```JSON hl_lines="22"
+{
+ "openapi": "3.1.0",
+ "info": {
+ "title": "FastAPI",
+ "version": "0.1.0"
+ },
+ "paths": {
+ "/items/": {
+ "get": {
+ "summary": "Read Items",
+ "operationId": "read_items_items__get",
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ }
+ },
+ "x-aperture-labs-portal": "blue"
+ }
+ }
+ }
+}
+```
+
+### Benutzerdefiniertes OpenAPI-*Pfadoperation*-Schema
+
+Das Dictionary in `openapi_extra` wird mit dem automatisch generierten OpenAPI-Schema für die *Pfadoperation* zusammengeführt (mittels Deep Merge).
+
+Sie können dem automatisch generierten Schema also zusätzliche Daten hinzufügen.
+
+Sie könnten sich beispielsweise dafür entscheiden, den Request mit Ihrem eigenen Code zu lesen und zu validieren, ohne die automatischen Funktionen von FastAPI mit Pydantic zu verwenden, aber Sie könnten den Request trotzdem im OpenAPI-Schema definieren wollen.
+
+Das könnte man mit `openapi_extra` machen:
+
+```Python hl_lines="20-37 39-40"
+{!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
+```
+
+In diesem Beispiel haben wir kein Pydantic-Modell deklariert. Tatsächlich wird der Requestbody nicht einmal als JSON geparst, sondern direkt als `bytes` gelesen und die Funktion `magic_data_reader ()` wäre dafür verantwortlich, ihn in irgendeiner Weise zu parsen.
+
+Dennoch können wir das zu erwartende Schema für den Requestbody deklarieren.
+
+### Benutzerdefinierter OpenAPI-Content-Type
+
+Mit demselben Trick könnten Sie ein Pydantic-Modell verwenden, um das JSON-Schema zu definieren, das dann im benutzerdefinierten Abschnitt des OpenAPI-Schemas für die *Pfadoperation* enthalten ist.
+
+Und Sie könnten dies auch tun, wenn der Datentyp in der Anfrage nicht JSON ist.
+
+In der folgenden Anwendung verwenden wir beispielsweise weder die integrierte Funktionalität von FastAPI zum Extrahieren des JSON-Schemas aus Pydantic-Modellen noch die automatische Validierung für JSON. Tatsächlich deklarieren wir den Request-Content-Type als YAML und nicht als JSON:
+
+=== "Pydantic v2"
+
+ ```Python hl_lines="17-22 24"
+ {!> ../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
+ ```
+
+=== "Pydantic v1"
+
+ ```Python hl_lines="17-22 24"
+ {!> ../../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py!}
+ ```
+
+!!! info
+ In Pydantic Version 1 hieß die Methode zum Abrufen des JSON-Schemas für ein Modell `Item.schema()`, in Pydantic Version 2 heißt die Methode `Item.model_json_schema()`.
+
+Obwohl wir nicht die standardmäßig integrierte Funktionalität verwenden, verwenden wir dennoch ein Pydantic-Modell, um das JSON-Schema für die Daten, die wir in YAML empfangen möchten, manuell zu generieren.
+
+Dann verwenden wir den Request direkt und extrahieren den Body als `bytes`. Das bedeutet, dass FastAPI nicht einmal versucht, den Request-Payload als JSON zu parsen.
+
+Und dann parsen wir in unserem Code diesen YAML-Inhalt direkt und verwenden dann wieder dasselbe Pydantic-Modell, um den YAML-Inhalt zu validieren:
+
+=== "Pydantic v2"
+
+ ```Python hl_lines="26-33"
+ {!> ../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
+ ```
+
+=== "Pydantic v1"
+
+ ```Python hl_lines="26-33"
+ {!> ../../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py!}
+ ```
+
+!!! info
+ In Pydantic Version 1 war die Methode zum Parsen und Validieren eines Objekts `Item.parse_obj()`, in Pydantic Version 2 heißt die Methode `Item.model_validate()`.
+
+!!! tip "Tipp"
+ Hier verwenden wir dasselbe Pydantic-Modell wieder.
+
+ Aber genauso hätten wir es auch auf andere Weise validieren können.
diff --git a/docs/de/docs/advanced/response-change-status-code.md b/docs/de/docs/advanced/response-change-status-code.md
new file mode 100644
index 000000000..bba908a3e
--- /dev/null
+++ b/docs/de/docs/advanced/response-change-status-code.md
@@ -0,0 +1,33 @@
+# Response – Statuscode ändern
+
+Sie haben wahrscheinlich schon vorher gelesen, dass Sie einen Standard-[Response-Statuscode](../tutorial/response-status-code.md){.internal-link target=_blank} festlegen können.
+
+In manchen Fällen müssen Sie jedoch einen anderen als den Standard-Statuscode zurückgeben.
+
+## Anwendungsfall
+
+Stellen Sie sich zum Beispiel vor, Sie möchten standardmäßig den HTTP-Statuscode „OK“ `200` zurückgeben.
+
+Wenn die Daten jedoch nicht vorhanden waren, möchten Sie diese erstellen und den HTTP-Statuscode „CREATED“ `201` zurückgeben.
+
+Sie möchten aber dennoch in der Lage sein, die von Ihnen zurückgegebenen Daten mit einem `response_model` zu filtern und zu konvertieren.
+
+In diesen Fällen können Sie einen `Response`-Parameter verwenden.
+
+## Einen `Response`-Parameter verwenden
+
+Sie können einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion* deklarieren (wie Sie es auch für Cookies und Header tun können).
+
+Anschließend können Sie den `status_code` in diesem *vorübergehenden* Response-Objekt festlegen.
+
+```Python hl_lines="1 9 12"
+{!../../../docs_src/response_change_status_code/tutorial001.py!}
+```
+
+Und dann können Sie wie gewohnt jedes benötigte Objekt zurückgeben (ein `dict`, ein Datenbankmodell usw.).
+
+Und wenn Sie ein `response_model` deklariert haben, wird es weiterhin zum Filtern und Konvertieren des von Ihnen zurückgegebenen Objekts verwendet.
+
+**FastAPI** verwendet diese *vorübergehende* Response, um den Statuscode (auch Cookies und Header) zu extrahieren und fügt diese in die endgültige Response ein, die den von Ihnen zurückgegebenen Wert enthält, gefiltert nach einem beliebigen `response_model`.
+
+Sie können den Parameter `Response` auch in Abhängigkeiten deklarieren und den Statuscode darin festlegen. Bedenken Sie jedoch, dass der gewinnt, welcher zuletzt gesetzt wird.
diff --git a/docs/de/docs/advanced/response-cookies.md b/docs/de/docs/advanced/response-cookies.md
new file mode 100644
index 000000000..0f09bd444
--- /dev/null
+++ b/docs/de/docs/advanced/response-cookies.md
@@ -0,0 +1,49 @@
+# Response-Cookies
+
+## Einen `Response`-Parameter verwenden
+
+Sie können einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion* deklarieren.
+
+Und dann können Sie Cookies in diesem *vorübergehenden* Response-Objekt setzen.
+
+```Python hl_lines="1 8-9"
+{!../../../docs_src/response_cookies/tutorial002.py!}
+```
+
+Anschließend können Sie wie gewohnt jedes gewünschte Objekt zurückgeben (ein `dict`, ein Datenbankmodell, usw.).
+
+Und wenn Sie ein `response_model` deklariert haben, wird es weiterhin zum Filtern und Konvertieren des von Ihnen zurückgegebenen Objekts verwendet.
+
+**FastAPI** verwendet diese *vorübergehende* Response, um die Cookies (auch Header und Statuscode) zu extrahieren und fügt diese in die endgültige Response ein, die den von Ihnen zurückgegebenen Wert enthält, gefiltert nach einem beliebigen `response_model`.
+
+Sie können den `Response`-Parameter auch in Abhängigkeiten deklarieren und darin Cookies (und Header) setzen.
+
+## Eine `Response` direkt zurückgeben
+
+Sie können Cookies auch erstellen, wenn Sie eine `Response` direkt in Ihrem Code zurückgeben.
+
+Dazu können Sie eine Response erstellen, wie unter [Eine Response direkt zurückgeben](response-directly.md){.internal-link target=_blank} beschrieben.
+
+Setzen Sie dann Cookies darin und geben Sie sie dann zurück:
+
+```Python hl_lines="10-12"
+{!../../../docs_src/response_cookies/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Beachten Sie, dass, wenn Sie eine Response direkt zurückgeben, anstatt den `Response`-Parameter zu verwenden, FastAPI diese direkt zurückgibt.
+
+ Sie müssen also sicherstellen, dass Ihre Daten vom richtigen Typ sind. Z. B. sollten diese mit JSON kompatibel sein, wenn Sie eine `JSONResponse` zurückgeben.
+
+ Und auch, dass Sie keine Daten senden, die durch ein `response_model` hätten gefiltert werden sollen.
+
+### Mehr Informationen
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import Response` oder `from starlette.responses import JSONResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
+
+ Und da die `Response` häufig zum Setzen von Headern und Cookies verwendet wird, stellt **FastAPI** diese auch unter `fastapi.Response` bereit.
+
+Um alle verfügbaren Parameter und Optionen anzuzeigen, sehen Sie sich deren Dokumentation in Starlette an.
diff --git a/docs/de/docs/advanced/response-directly.md b/docs/de/docs/advanced/response-directly.md
new file mode 100644
index 000000000..13bca7825
--- /dev/null
+++ b/docs/de/docs/advanced/response-directly.md
@@ -0,0 +1,63 @@
+# Eine Response direkt zurückgeben
+
+Wenn Sie eine **FastAPI** *Pfadoperation* erstellen, können Sie normalerweise beliebige Daten davon zurückgeben: ein `dict`, eine `list`e, ein Pydantic-Modell, ein Datenbankmodell, usw.
+
+Standardmäßig konvertiert **FastAPI** diesen Rückgabewert automatisch nach JSON, mithilfe des `jsonable_encoder`, der in [JSON-kompatibler Encoder](../tutorial/encoder.md){.internal-link target=_blank} erläutert wird.
+
+Dann würde es hinter den Kulissen diese JSON-kompatiblen Daten (z. B. ein `dict`) in eine `JSONResponse` einfügen, die zum Senden der Response an den Client verwendet würde.
+
+Sie können jedoch direkt eine `JSONResponse` von Ihren *Pfadoperationen* zurückgeben.
+
+Das kann beispielsweise nützlich sein, um benutzerdefinierte Header oder Cookies zurückzugeben.
+
+## Eine `Response` zurückgeben
+
+Tatsächlich können Sie jede `Response` oder jede Unterklasse davon zurückgeben.
+
+!!! tip "Tipp"
+ `JSONResponse` selbst ist eine Unterklasse von `Response`.
+
+Und wenn Sie eine `Response` zurückgeben, wird **FastAPI** diese direkt weiterleiten.
+
+Es wird keine Datenkonvertierung mit Pydantic-Modellen durchführen, es wird den Inhalt nicht in irgendeinen Typ konvertieren, usw.
+
+Dadurch haben Sie viel Flexibilität. Sie können jeden Datentyp zurückgeben, jede Datendeklaration oder -validierung überschreiben, usw.
+
+## Verwendung des `jsonable_encoder` in einer `Response`
+
+Da **FastAPI** keine Änderungen an einer von Ihnen zurückgegebenen `Response` vornimmt, müssen Sie sicherstellen, dass deren Inhalt dafür bereit ist.
+
+Sie können beispielsweise kein Pydantic-Modell in eine `JSONResponse` einfügen, ohne es zuvor in ein `dict` zu konvertieren, bei dem alle Datentypen (wie `datetime`, `UUID`, usw.) in JSON-kompatible Typen konvertiert wurden.
+
+In diesen Fällen können Sie den `jsonable_encoder` verwenden, um Ihre Daten zu konvertieren, bevor Sie sie an eine Response übergeben:
+
+```Python hl_lines="6-7 21-22"
+{!../../../docs_src/response_directly/tutorial001.py!}
+```
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import JSONResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
+
+## Eine benutzerdefinierte `Response` zurückgeben
+
+Das obige Beispiel zeigt alle Teile, die Sie benötigen, ist aber noch nicht sehr nützlich, da Sie das `item` einfach direkt hätten zurückgeben können, und **FastAPI** würde es für Sie in eine `JSONResponse` einfügen, es in ein `dict` konvertieren, usw. All das standardmäßig.
+
+Sehen wir uns nun an, wie Sie damit eine benutzerdefinierte Response zurückgeben können.
+
+Nehmen wir an, Sie möchten eine XML-Response zurückgeben.
+
+Sie könnten Ihren XML-Inhalt als String in eine `Response` einfügen und sie zurückgeben:
+
+```Python hl_lines="1 18"
+{!../../../docs_src/response_directly/tutorial002.py!}
+```
+
+## Anmerkungen
+
+Wenn Sie eine `Response` direkt zurücksenden, werden deren Daten weder validiert, konvertiert (serialisiert), noch automatisch dokumentiert.
+
+Sie können sie aber trotzdem wie unter [Zusätzliche Responses in OpenAPI](additional-responses.md){.internal-link target=_blank} beschrieben dokumentieren.
+
+In späteren Abschnitten erfahren Sie, wie Sie diese benutzerdefinierten `Response`s verwenden/deklarieren und gleichzeitig über automatische Datenkonvertierung, Dokumentation, usw. verfügen.
diff --git a/docs/de/docs/advanced/response-headers.md b/docs/de/docs/advanced/response-headers.md
new file mode 100644
index 000000000..6f4760e7f
--- /dev/null
+++ b/docs/de/docs/advanced/response-headers.md
@@ -0,0 +1,42 @@
+# Response-Header
+
+## Verwenden Sie einen `Response`-Parameter
+
+Sie können einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion* deklarieren (wie Sie es auch für Cookies tun können).
+
+Und dann können Sie Header in diesem *vorübergehenden* Response-Objekt festlegen.
+
+```Python hl_lines="1 7-8"
+{!../../../docs_src/response_headers/tutorial002.py!}
+```
+
+Anschließend können Sie wie gewohnt jedes gewünschte Objekt zurückgeben (ein `dict`, ein Datenbankmodell, usw.).
+
+Und wenn Sie ein `response_model` deklariert haben, wird es weiterhin zum Filtern und Konvertieren des von Ihnen zurückgegebenen Objekts verwendet.
+
+**FastAPI** verwendet diese *vorübergehende* Response, um die Header (auch Cookies und Statuscode) zu extrahieren und fügt diese in die endgültige Response ein, die den von Ihnen zurückgegebenen Wert enthält, gefiltert nach einem beliebigen `response_model`.
+
+Sie können den Parameter `Response` auch in Abhängigkeiten deklarieren und darin Header (und Cookies) festlegen.
+
+## Eine `Response` direkt zurückgeben
+
+Sie können auch Header hinzufügen, wenn Sie eine `Response` direkt zurückgeben.
+
+Erstellen Sie eine Response wie in [Eine Response direkt zurückgeben](response-directly.md){.internal-link target=_blank} beschrieben und übergeben Sie die Header als zusätzlichen Parameter:
+
+```Python hl_lines="10-12"
+{!../../../docs_src/response_headers/tutorial001.py!}
+```
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import Response` oder `from starlette.responses import JSONResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
+
+ Und da die `Response` häufig zum Setzen von Headern und Cookies verwendet wird, stellt **FastAPI** diese auch unter `fastapi.Response` bereit.
+
+## Benutzerdefinierte Header
+
+Beachten Sie, dass benutzerdefinierte proprietäre Header mittels des Präfix 'X-' hinzugefügt werden können.
+
+Wenn Sie jedoch benutzerdefinierte Header haben, die ein Client in einem Browser sehen können soll, müssen Sie diese zu Ihren CORS-Konfigurationen hinzufügen (weitere Informationen finden Sie unter [CORS (Cross-Origin Resource Sharing)](../tutorial/cors.md){.internal-link target=_blank}), unter Verwendung des Parameters `expose_headers`, dokumentiert in Starlettes CORS-Dokumentation.
diff --git a/docs/de/docs/advanced/security/http-basic-auth.md b/docs/de/docs/advanced/security/http-basic-auth.md
new file mode 100644
index 000000000..9f9c0cf7d
--- /dev/null
+++ b/docs/de/docs/advanced/security/http-basic-auth.md
@@ -0,0 +1,164 @@
+# HTTP Basic Auth
+
+Für die einfachsten Fälle können Sie HTTP Basic Auth verwenden.
+
+Bei HTTP Basic Auth erwartet die Anwendung einen Header, der einen Benutzernamen und ein Passwort enthält.
+
+Wenn sie diesen nicht empfängt, gibt sie den HTTP-Error 401 „Unauthorized“ zurück.
+
+Und gibt einen Header `WWW-Authenticate` mit dem Wert `Basic` und einem optionalen `realm`-Parameter („Bereich“) zurück.
+
+Dadurch wird der Browser angewiesen, die integrierte Eingabeaufforderung für einen Benutzernamen und ein Passwort anzuzeigen.
+
+Wenn Sie dann den Benutzernamen und das Passwort eingeben, sendet der Browser diese automatisch im Header.
+
+## Einfaches HTTP Basic Auth
+
+* Importieren Sie `HTTPBasic` und `HTTPBasicCredentials`.
+* Erstellen Sie mit `HTTPBasic` ein „`security`-Schema“.
+* Verwenden Sie dieses `security` mit einer Abhängigkeit in Ihrer *Pfadoperation*.
+* Diese gibt ein Objekt vom Typ `HTTPBasicCredentials` zurück:
+ * Es enthält den gesendeten `username` und das gesendete `password`.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4 8 12"
+ {!> ../../../docs_src/security/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="2 7 11"
+ {!> ../../../docs_src/security/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="2 6 10"
+ {!> ../../../docs_src/security/tutorial006.py!}
+ ```
+
+Wenn Sie versuchen, die URL zum ersten Mal zu öffnen (oder in der Dokumentation auf den Button „Execute“ zu klicken), wird der Browser Sie nach Ihrem Benutzernamen und Passwort fragen:
+
+
+
+## Den Benutzernamen überprüfen
+
+Hier ist ein vollständigeres Beispiel.
+
+Verwenden Sie eine Abhängigkeit, um zu überprüfen, ob Benutzername und Passwort korrekt sind.
+
+Verwenden Sie dazu das Python-Standardmodul `secrets`, um den Benutzernamen und das Passwort zu überprüfen.
+
+`secrets.compare_digest()` benötigt `bytes` oder einen `str`, welcher nur ASCII-Zeichen (solche der englischen Sprache) enthalten darf, das bedeutet, dass es nicht mit Zeichen wie `á`, wie in `Sebastián`, funktionieren würde.
+
+Um dies zu lösen, konvertieren wir zunächst den `username` und das `password` in UTF-8-codierte `bytes`.
+
+Dann können wir `secrets.compare_digest()` verwenden, um sicherzustellen, dass `credentials.username` `"stanleyjobson"` und `credentials.password` `"swordfish"` ist.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1 12-24"
+ {!> ../../../docs_src/security/tutorial007_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 12-24"
+ {!> ../../../docs_src/security/tutorial007_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1 11-21"
+ {!> ../../../docs_src/security/tutorial007.py!}
+ ```
+
+Dies wäre das gleiche wie:
+
+```Python
+if not (credentials.username == "stanleyjobson") or not (credentials.password == "swordfish"):
+ # Einen Error zurückgeben
+ ...
+```
+
+Aber durch die Verwendung von `secrets.compare_digest()` ist dieser Code sicher vor einer Art von Angriffen, die „Timing-Angriffe“ genannt werden.
+
+### Timing-Angriffe
+
+Aber was ist ein „Timing-Angriff“?
+
+Stellen wir uns vor, dass einige Angreifer versuchen, den Benutzernamen und das Passwort zu erraten.
+
+Und sie senden eine Anfrage mit dem Benutzernamen `johndoe` und dem Passwort `love123`.
+
+Dann würde der Python-Code in Ihrer Anwendung etwa so aussehen:
+
+```Python
+if "johndoe" == "stanleyjobson" and "love123" == "swordfish":
+ ...
+```
+
+Aber genau in dem Moment, in dem Python das erste `j` in `johndoe` mit dem ersten `s` in `stanleyjobson` vergleicht, gibt es `False` zurück, da es bereits weiß, dass diese beiden Strings nicht identisch sind, und denkt, „Es besteht keine Notwendigkeit, weitere Berechnungen mit dem Vergleich der restlichen Buchstaben zu verschwenden“. Und Ihre Anwendung wird zurückgeben „Incorrect username or password“.
+
+Doch dann versuchen es die Angreifer mit dem Benutzernamen `stanleyjobsox` und dem Passwort `love123`.
+
+Und Ihr Anwendungscode macht etwa Folgendes:
+
+```Python
+if "stanleyjobsox" == "stanleyjobson" and "love123" == "swordfish":
+ ...
+```
+
+Python muss das gesamte `stanleyjobso` in `stanleyjobsox` und `stanleyjobson` vergleichen, bevor es erkennt, dass beide Zeichenfolgen nicht gleich sind. Daher wird es einige zusätzliche Mikrosekunden dauern, bis die Antwort „Incorrect username or password“ erfolgt.
+
+#### Die Zeit zum Antworten hilft den Angreifern
+
+Wenn die Angreifer zu diesem Zeitpunkt feststellen, dass der Server einige Mikrosekunden länger braucht, um die Antwort „Incorrect username or password“ zu senden, wissen sie, dass sie _etwas_ richtig gemacht haben, einige der Anfangsbuchstaben waren richtig.
+
+Und dann können sie es noch einmal versuchen, wohl wissend, dass es wahrscheinlich eher etwas mit `stanleyjobsox` als mit `johndoe` zu tun hat.
+
+#### Ein „professioneller“ Angriff
+
+Natürlich würden die Angreifer das alles nicht von Hand versuchen, sondern ein Programm dafür schreiben, möglicherweise mit Tausenden oder Millionen Tests pro Sekunde. Und würden jeweils nur einen zusätzlichen richtigen Buchstaben erhalten.
+
+Aber so hätten die Angreifer in wenigen Minuten oder Stunden mit der „Hilfe“ unserer Anwendung den richtigen Benutzernamen und das richtige Passwort erraten, indem sie die Zeitspanne zur Hilfe nehmen, die diese zur Beantwortung benötigt.
+
+#### Das Problem beheben mittels `secrets.compare_digest()`
+
+Aber in unserem Code verwenden wir tatsächlich `secrets.compare_digest()`.
+
+Damit wird, kurz gesagt, der Vergleich von `stanleyjobsox` mit `stanleyjobson` genauso lange dauern wie der Vergleich von `johndoe` mit `stanleyjobson`. Und das Gleiche gilt für das Passwort.
+
+So ist Ihr Anwendungscode, dank der Verwendung von `secrets.compare_digest()`, vor dieser ganzen Klasse von Sicherheitsangriffen geschützt.
+
+### Den Error zurückgeben
+
+Nachdem Sie festgestellt haben, dass die Anmeldeinformationen falsch sind, geben Sie eine `HTTPException` mit dem Statuscode 401 zurück (derselbe, der auch zurückgegeben wird, wenn keine Anmeldeinformationen angegeben werden) und fügen den Header `WWW-Authenticate` hinzu, damit der Browser die Anmeldeaufforderung erneut anzeigt:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="26-30"
+ {!> ../../../docs_src/security/tutorial007_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="26-30"
+ {!> ../../../docs_src/security/tutorial007_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="23-27"
+ {!> ../../../docs_src/security/tutorial007.py!}
+ ```
diff --git a/docs/de/docs/advanced/security/index.md b/docs/de/docs/advanced/security/index.md
new file mode 100644
index 000000000..a3c975bed
--- /dev/null
+++ b/docs/de/docs/advanced/security/index.md
@@ -0,0 +1,16 @@
+# Fortgeschrittene Sicherheit
+
+## Zusatzfunktionen
+
+Neben den in [Tutorial – Benutzerhandbuch: Sicherheit](../../tutorial/security/index.md){.internal-link target=_blank} behandelten Funktionen gibt es noch einige zusätzliche Funktionen zur Handhabung der Sicherheit.
+
+!!! tip "Tipp"
+ Die nächsten Abschnitte sind **nicht unbedingt „fortgeschritten“**.
+
+ Und es ist möglich, dass für Ihren Anwendungsfall die Lösung in einem davon liegt.
+
+## Lesen Sie zuerst das Tutorial
+
+In den nächsten Abschnitten wird davon ausgegangen, dass Sie das Haupt-[Tutorial – Benutzerhandbuch: Sicherheit](../../tutorial/security/index.md){.internal-link target=_blank} bereits gelesen haben.
+
+Sie basieren alle auf den gleichen Konzepten, ermöglichen jedoch einige zusätzliche Funktionalitäten.
diff --git a/docs/de/docs/advanced/security/oauth2-scopes.md b/docs/de/docs/advanced/security/oauth2-scopes.md
new file mode 100644
index 000000000..ffd34d65f
--- /dev/null
+++ b/docs/de/docs/advanced/security/oauth2-scopes.md
@@ -0,0 +1,598 @@
+# OAuth2-Scopes
+
+Sie können OAuth2-Scopes direkt in **FastAPI** verwenden, sie sind nahtlos integriert.
+
+Das ermöglicht es Ihnen, ein feingranuliertes Berechtigungssystem nach dem OAuth2-Standard in Ihre OpenAPI-Anwendung (und deren API-Dokumentation) zu integrieren.
+
+OAuth2 mit Scopes ist der Mechanismus, der von vielen großen Authentifizierungsanbietern wie Facebook, Google, GitHub, Microsoft, Twitter usw. verwendet wird. Sie verwenden ihn, um Benutzern und Anwendungen spezifische Berechtigungen zu erteilen.
+
+Jedes Mal, wenn Sie sich mit Facebook, Google, GitHub, Microsoft oder Twitter anmelden („log in with“), verwendet die entsprechende Anwendung OAuth2 mit Scopes.
+
+In diesem Abschnitt erfahren Sie, wie Sie Authentifizierung und Autorisierung mit demselben OAuth2, mit Scopes in Ihrer **FastAPI**-Anwendung verwalten.
+
+!!! warning "Achtung"
+ Dies ist ein mehr oder weniger fortgeschrittener Abschnitt. Wenn Sie gerade erst anfangen, können Sie ihn überspringen.
+
+ Sie benötigen nicht unbedingt OAuth2-Scopes, und Sie können die Authentifizierung und Autorisierung handhaben wie Sie möchten.
+
+ Aber OAuth2 mit Scopes kann bequem in Ihre API (mit OpenAPI) und deren API-Dokumentation integriert werden.
+
+ Dennoch, verwenden Sie solche Scopes oder andere Sicherheits-/Autorisierungsanforderungen in Ihrem Code so wie Sie es möchten.
+
+ In vielen Fällen kann OAuth2 mit Scopes ein Overkill sein.
+
+ Aber wenn Sie wissen, dass Sie es brauchen oder neugierig sind, lesen Sie weiter.
+
+## OAuth2-Scopes und OpenAPI
+
+Die OAuth2-Spezifikation definiert „Scopes“ als eine Liste von durch Leerzeichen getrennten Strings.
+
+Der Inhalt jedes dieser Strings kann ein beliebiges Format haben, sollte jedoch keine Leerzeichen enthalten.
+
+Diese Scopes stellen „Berechtigungen“ dar.
+
+In OpenAPI (z. B. der API-Dokumentation) können Sie „Sicherheitsschemas“ definieren.
+
+Wenn eines dieser Sicherheitsschemas OAuth2 verwendet, können Sie auch Scopes deklarieren und verwenden.
+
+Jeder „Scope“ ist nur ein String (ohne Leerzeichen).
+
+Er wird normalerweise verwendet, um bestimmte Sicherheitsberechtigungen zu deklarieren, zum Beispiel:
+
+* `users:read` oder `users:write` sind gängige Beispiele.
+* `instagram_basic` wird von Facebook / Instagram verwendet.
+* `https://www.googleapis.com/auth/drive` wird von Google verwendet.
+
+!!! info
+ In OAuth2 ist ein „Scope“ nur ein String, der eine bestimmte erforderliche Berechtigung deklariert.
+
+ Es spielt keine Rolle, ob er andere Zeichen wie `:` enthält oder ob es eine URL ist.
+
+ Diese Details sind implementierungsspezifisch.
+
+ Für OAuth2 sind es einfach nur Strings.
+
+## Gesamtübersicht
+
+Sehen wir uns zunächst kurz die Teile an, die sich gegenüber den Beispielen im Haupt-**Tutorial – Benutzerhandbuch** für [OAuth2 mit Password (und Hashing), Bearer mit JWT-Tokens](../../tutorial/security/oauth2-jwt.md){.internal-link target=_blank} ändern. Diesmal verwenden wir OAuth2-Scopes:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="2 4 8 12 47 65 106 108-116 122-125 129-135 140 156"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3 7 11 45 63 104 106-114 120-123 127-133 138 154"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+Sehen wir uns diese Änderungen nun Schritt für Schritt an.
+
+## OAuth2-Sicherheitsschema
+
+Die erste Änderung ist, dass wir jetzt das OAuth2-Sicherheitsschema mit zwei verfügbaren Scopes deklarieren: `me` und `items`.
+
+Der `scopes`-Parameter erhält ein `dict` mit jedem Scope als Schlüssel und dessen Beschreibung als Wert:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="62-65"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="62-65"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="63-66"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="61-64"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="62-65"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="62-65"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+Da wir diese Scopes jetzt deklarieren, werden sie in der API-Dokumentation angezeigt, wenn Sie sich einloggen/autorisieren.
+
+Und Sie können auswählen, auf welche Scopes Sie Zugriff haben möchten: `me` und `items`.
+
+Das ist derselbe Mechanismus, der verwendet wird, wenn Sie beim Anmelden mit Facebook, Google, GitHub, usw. Berechtigungen erteilen:
+
+
+
+## JWT-Token mit Scopes
+
+Ändern Sie nun die Token-*Pfadoperation*, um die angeforderten Scopes zurückzugeben.
+
+Wir verwenden immer noch dasselbe `OAuth2PasswordRequestForm`. Es enthält eine Eigenschaft `scopes` mit einer `list`e von `str`s für jeden Scope, den es im Request erhalten hat.
+
+Und wir geben die Scopes als Teil des JWT-Tokens zurück.
+
+!!! danger "Gefahr"
+ Der Einfachheit halber fügen wir hier die empfangenen Scopes direkt zum Token hinzu.
+
+ Aus Sicherheitsgründen sollten Sie jedoch sicherstellen, dass Sie in Ihrer Anwendung nur die Scopes hinzufügen, die der Benutzer tatsächlich haben kann, oder die Sie vordefiniert haben.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="155"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="155"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="156"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="154"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="155"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="155"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+## Scopes in *Pfadoperationen* und Abhängigkeiten deklarieren
+
+Jetzt deklarieren wir, dass die *Pfadoperation* für `/users/me/items/` den Scope `items` erfordert.
+
+Dazu importieren und verwenden wir `Security` von `fastapi`.
+
+Sie können `Security` verwenden, um Abhängigkeiten zu deklarieren (genau wie `Depends`), aber `Security` erhält auch einen Parameter `scopes` mit einer Liste von Scopes (Strings).
+
+In diesem Fall übergeben wir eine Abhängigkeitsfunktion `get_current_active_user` an `Security` (genauso wie wir es mit `Depends` tun würden).
+
+Wir übergeben aber auch eine `list`e von Scopes, in diesem Fall mit nur einem Scope: `items` (es könnten mehrere sein).
+
+Und die Abhängigkeitsfunktion `get_current_active_user` kann auch Unterabhängigkeiten deklarieren, nicht nur mit `Depends`, sondern auch mit `Security`. Ihre eigene Unterabhängigkeitsfunktion (`get_current_user`) und weitere Scope-Anforderungen deklarierend.
+
+In diesem Fall erfordert sie den Scope `me` (sie könnte mehr als einen Scope erfordern).
+
+!!! note "Hinweis"
+ Sie müssen nicht unbedingt an verschiedenen Stellen verschiedene Scopes hinzufügen.
+
+ Wir tun dies hier, um zu demonstrieren, wie **FastAPI** auf verschiedenen Ebenen deklarierte Scopes verarbeitet.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4 139 170"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4 139 170"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4 140 171"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3 138 167"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="4 139 168"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="4 139 168"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+!!! info "Technische Details"
+ `Security` ist tatsächlich eine Unterklasse von `Depends` und hat nur noch einen zusätzlichen Parameter, den wir später kennenlernen werden.
+
+ Durch die Verwendung von `Security` anstelle von `Depends` weiß **FastAPI** jedoch, dass es Sicherheits-Scopes deklarieren, intern verwenden und die API mit OpenAPI dokumentieren kann.
+
+ Wenn Sie jedoch `Query`, `Path`, `Depends`, `Security` und andere von `fastapi` importieren, handelt es sich tatsächlich um Funktionen, die spezielle Klassen zurückgeben.
+
+## `SecurityScopes` verwenden
+
+Aktualisieren Sie nun die Abhängigkeit `get_current_user`.
+
+Das ist diejenige, die von den oben genannten Abhängigkeiten verwendet wird.
+
+Hier verwenden wir dasselbe OAuth2-Schema, das wir zuvor erstellt haben, und deklarieren es als Abhängigkeit: `oauth2_scheme`.
+
+Da diese Abhängigkeitsfunktion selbst keine Scope-Anforderungen hat, können wir `Depends` mit `oauth2_scheme` verwenden. Wir müssen `Security` nicht verwenden, wenn wir keine Sicherheits-Scopes angeben müssen.
+
+Wir deklarieren auch einen speziellen Parameter vom Typ `SecurityScopes`, der aus `fastapi.security` importiert wird.
+
+Diese `SecurityScopes`-Klasse ähnelt `Request` (`Request` wurde verwendet, um das Request-Objekt direkt zu erhalten).
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8 105"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8 105"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8 106"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7 104"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8 105"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8 105"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+## Die `scopes` verwenden
+
+Der Parameter `security_scopes` wird vom Typ `SecurityScopes` sein.
+
+Dieses verfügt über ein Attribut `scopes` mit einer Liste, die alle von ihm selbst benötigten Scopes enthält und ferner alle Abhängigkeiten, die dieses als Unterabhängigkeit verwenden. Sprich, alle „Dependanten“ ... das mag verwirrend klingen, wird aber später noch einmal erklärt.
+
+Das `security_scopes`-Objekt (der Klasse `SecurityScopes`) stellt außerdem ein `scope_str`-Attribut mit einem einzelnen String bereit, der die durch Leerzeichen getrennten Scopes enthält (den werden wir verwenden).
+
+Wir erstellen eine `HTTPException`, die wir später an mehreren Stellen wiederverwenden (`raise`n) können.
+
+In diese Exception fügen wir (falls vorhanden) die erforderlichen Scopes als durch Leerzeichen getrennten String ein (unter Verwendung von `scope_str`). Wir fügen diesen String mit den Scopes in den Header `WWW-Authenticate` ein (das ist Teil der Spezifikation).
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="105 107-115"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="105 107-115"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="106 108-116"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="104 106-114"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="105 107-115"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="105 107-115"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+## Den `username` und das Format der Daten überprüfen
+
+Wir verifizieren, dass wir einen `username` erhalten, und extrahieren die Scopes.
+
+Und dann validieren wir diese Daten mit dem Pydantic-Modell (wobei wir die `ValidationError`-Exception abfangen), und wenn wir beim Lesen des JWT-Tokens oder beim Validieren der Daten mit Pydantic einen Fehler erhalten, lösen wir die zuvor erstellte `HTTPException` aus.
+
+Dazu aktualisieren wir das Pydantic-Modell `TokenData` mit einem neuen Attribut `scopes`.
+
+Durch die Validierung der Daten mit Pydantic können wir sicherstellen, dass wir beispielsweise präzise eine `list`e von `str`s mit den Scopes und einen `str` mit dem `username` haben.
+
+Anstelle beispielsweise eines `dict`s oder etwas anderem, was später in der Anwendung zu Fehlern führen könnte und darum ein Sicherheitsrisiko darstellt.
+
+Wir verifizieren auch, dass wir einen Benutzer mit diesem Benutzernamen haben, und wenn nicht, lösen wir dieselbe Exception aus, die wir zuvor erstellt haben.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="46 116-127"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="46 116-127"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="47 117-128"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="45 115-126"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="46 116-127"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="46 116-127"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+## Die `scopes` verifizieren
+
+Wir überprüfen nun, ob das empfangenen Token alle Scopes enthält, die von dieser Abhängigkeit und deren Verwendern (einschließlich *Pfadoperationen*) gefordert werden. Andernfalls lösen wir eine `HTTPException` aus.
+
+Hierzu verwenden wir `security_scopes.scopes`, das eine `list`e mit allen diesen Scopes als `str` enthält.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="128-134"
+ {!> ../../../docs_src/security/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="128-134"
+ {!> ../../../docs_src/security/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="129-135"
+ {!> ../../../docs_src/security/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="127-133"
+ {!> ../../../docs_src/security/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="128-134"
+ {!> ../../../docs_src/security/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="128-134"
+ {!> ../../../docs_src/security/tutorial005.py!}
+ ```
+
+## Abhängigkeitsbaum und Scopes
+
+Sehen wir uns diesen Abhängigkeitsbaum und die Scopes noch einmal an.
+
+Da die Abhängigkeit `get_current_active_user` von `get_current_user` abhängt, wird der bei `get_current_active_user` deklarierte Scope `"me"` in die Liste der erforderlichen Scopes in `security_scopes.scopes` aufgenommen, das an `get_current_user` übergeben wird.
+
+Die *Pfadoperation* selbst deklariert auch einen Scope, `"items"`, sodass dieser auch in der Liste der `security_scopes.scopes` enthalten ist, die an `get_current_user` übergeben wird.
+
+So sieht die Hierarchie der Abhängigkeiten und Scopes aus:
+
+* Die *Pfadoperation* `read_own_items` hat:
+ * Erforderliche Scopes `["items"]` mit der Abhängigkeit:
+ * `get_current_active_user`:
+ * Die Abhängigkeitsfunktion `get_current_active_user` hat:
+ * Erforderliche Scopes `["me"]` mit der Abhängigkeit:
+ * `get_current_user`:
+ * Die Abhängigkeitsfunktion `get_current_user` hat:
+ * Selbst keine erforderlichen Scopes.
+ * Eine Abhängigkeit, die `oauth2_scheme` verwendet.
+ * Einen `security_scopes`-Parameter vom Typ `SecurityScopes`:
+ * Dieser `security_scopes`-Parameter hat ein Attribut `scopes` mit einer `list`e, die alle oben deklarierten Scopes enthält, sprich:
+ * `security_scopes.scopes` enthält `["me", "items"]` für die *Pfadoperation* `read_own_items`.
+ * `security_scopes.scopes` enthält `["me"]` für die *Pfadoperation* `read_users_me`, da das in der Abhängigkeit `get_current_active_user` deklariert ist.
+ * `security_scopes.scopes` wird `[]` (nichts) für die *Pfadoperation* `read_system_status` enthalten, da diese keine `Security` mit `scopes` deklariert hat, und deren Abhängigkeit `get_current_user` ebenfalls keinerlei `scopes` deklariert.
+
+!!! tip "Tipp"
+ Das Wichtige und „Magische“ hier ist, dass `get_current_user` für jede *Pfadoperation* eine andere Liste von `scopes` hat, die überprüft werden.
+
+ Alles hängt von den „Scopes“ ab, die in jeder *Pfadoperation* und jeder Abhängigkeit im Abhängigkeitsbaum für diese bestimmte *Pfadoperation* deklariert wurden.
+
+## Weitere Details zu `SecurityScopes`.
+
+Sie können `SecurityScopes` an jeder Stelle und an mehreren Stellen verwenden, es muss sich nicht in der „Wurzel“-Abhängigkeit befinden.
+
+Es wird immer die Sicherheits-Scopes enthalten, die in den aktuellen `Security`-Abhängigkeiten deklariert sind und in allen Abhängigkeiten für **diese spezifische** *Pfadoperation* und **diesen spezifischen** Abhängigkeitsbaum.
+
+Da die `SecurityScopes` alle von den Verwendern der Abhängigkeiten deklarierten Scopes enthalten, können Sie damit überprüfen, ob ein Token in einer zentralen Abhängigkeitsfunktion über die erforderlichen Scopes verfügt, und dann unterschiedliche Scope-Anforderungen in unterschiedlichen *Pfadoperationen* deklarieren.
+
+Diese werden für jede *Pfadoperation* unabhängig überprüft.
+
+## Testen Sie es
+
+Wenn Sie die API-Dokumentation öffnen, können Sie sich authentisieren und angeben, welche Scopes Sie autorisieren möchten.
+
+
+
+Wenn Sie keinen Scope auswählen, werden Sie „authentifiziert“, aber wenn Sie versuchen, auf `/users/me/` oder `/users/me/items/` zuzugreifen, wird eine Fehlermeldung angezeigt, die sagt, dass Sie nicht über genügend Berechtigungen verfügen. Sie können aber auf `/status/` zugreifen.
+
+Und wenn Sie den Scope `me`, aber nicht den Scope `items` auswählen, können Sie auf `/users/me/` zugreifen, aber nicht auf `/users/me/items/`.
+
+Das würde einer Drittanbieteranwendung passieren, die versucht, auf eine dieser *Pfadoperationen* mit einem Token zuzugreifen, das von einem Benutzer bereitgestellt wurde, abhängig davon, wie viele Berechtigungen der Benutzer dieser Anwendung erteilt hat.
+
+## Über Integrationen von Drittanbietern
+
+In diesem Beispiel verwenden wir den OAuth2-Flow „Password“.
+
+Das ist angemessen, wenn wir uns bei unserer eigenen Anwendung anmelden, wahrscheinlich mit unserem eigenen Frontend.
+
+Weil wir darauf vertrauen können, dass es den `username` und das `password` erhält, welche wir kontrollieren.
+
+Wenn Sie jedoch eine OAuth2-Anwendung erstellen, mit der andere eine Verbindung herstellen würden (d.h. wenn Sie einen Authentifizierungsanbieter erstellen, der Facebook, Google, GitHub usw. entspricht), sollten Sie einen der anderen Flows verwenden.
+
+Am häufigsten ist der „Implicit“-Flow.
+
+Am sichersten ist der „Code“-Flow, die Implementierung ist jedoch komplexer, da mehr Schritte erforderlich sind. Da er komplexer ist, schlagen viele Anbieter letztendlich den „Implicit“-Flow vor.
+
+!!! note "Hinweis"
+ Es ist üblich, dass jeder Authentifizierungsanbieter seine Flows anders benennt, um sie zu einem Teil seiner Marke zu machen.
+
+ Aber am Ende implementieren sie denselben OAuth2-Standard.
+
+**FastAPI** enthält Werkzeuge für alle diese OAuth2-Authentifizierungs-Flows in `fastapi.security.oauth2`.
+
+## `Security` in Dekorator-`dependencies`
+
+Auf die gleiche Weise können Sie eine `list`e von `Depends` im Parameter `dependencies` des Dekorators definieren (wie in [Abhängigkeiten in Pfadoperation-Dekoratoren](../../tutorial/dependencies/dependencies-in-path-operation-decorators.md){.internal-link target=_blank} erläutert), Sie könnten auch dort `Security` mit `scopes` verwenden.
diff --git a/docs/de/docs/advanced/settings.md b/docs/de/docs/advanced/settings.md
new file mode 100644
index 000000000..fe01d8e1f
--- /dev/null
+++ b/docs/de/docs/advanced/settings.md
@@ -0,0 +1,485 @@
+# Einstellungen und Umgebungsvariablen
+
+In vielen Fällen benötigt Ihre Anwendung möglicherweise einige externe Einstellungen oder Konfigurationen, zum Beispiel geheime Schlüssel, Datenbank-Anmeldeinformationen, Anmeldeinformationen für E-Mail-Dienste, usw.
+
+Die meisten dieser Einstellungen sind variabel (können sich ändern), wie z. B. Datenbank-URLs. Und vieles könnten schützenswerte, geheime Daten sein.
+
+Aus diesem Grund werden diese üblicherweise in Umgebungsvariablen bereitgestellt, die von der Anwendung gelesen werden.
+
+## Umgebungsvariablen
+
+!!! tip "Tipp"
+ Wenn Sie bereits wissen, was „Umgebungsvariablen“ sind und wie man sie verwendet, können Sie gerne mit dem nächsten Abschnitt weiter unten fortfahren.
+
+Eine Umgebungsvariable (auch bekannt als „env var“) ist eine Variable, die sich außerhalb des Python-Codes im Betriebssystem befindet und von Ihrem Python-Code (oder auch von anderen Programmen) gelesen werden kann.
+
+Sie können Umgebungsvariablen in der Shell erstellen und verwenden, ohne Python zu benötigen:
+
+=== "Linux, macOS, Windows Bash"
+
+
+
+Öffnen Sie dann die Dokumentation für die Unteranwendung unter http://127.0.0.1:8000/subapi/docs.
+
+Sie sehen die automatische API-Dokumentation für die Unteranwendung, welche nur deren eigene _Pfadoperationen_ anzeigt, alle unter dem korrekten Unterpfad-Präfix `/subapi`:
+
+
+
+Wenn Sie versuchen, mit einer der beiden Benutzeroberflächen zu interagieren, funktionieren diese ordnungsgemäß, da der Browser mit jeder spezifischen Anwendung oder Unteranwendung kommunizieren kann.
+
+### Technische Details: `root_path`
+
+Wenn Sie eine Unteranwendung wie oben beschrieben mounten, kümmert sich FastAPI darum, den Mount-Pfad für die Unteranwendung zu kommunizieren, mithilfe eines Mechanismus aus der ASGI-Spezifikation namens `root_path`.
+
+Auf diese Weise weiß die Unteranwendung, dass sie dieses Pfadpräfix für die Benutzeroberfläche der Dokumentation verwenden soll.
+
+Und die Unteranwendung könnte auch ihre eigenen gemounteten Unteranwendungen haben und alles würde korrekt funktionieren, da FastAPI sich um alle diese `root_path`s automatisch kümmert.
+
+Mehr über den `root_path` und dessen explizite Verwendung erfahren Sie im Abschnitt [Hinter einem Proxy](behind-a-proxy.md){.internal-link target=_blank}.
diff --git a/docs/de/docs/advanced/templates.md b/docs/de/docs/advanced/templates.md
new file mode 100644
index 000000000..17d821e61
--- /dev/null
+++ b/docs/de/docs/advanced/templates.md
@@ -0,0 +1,119 @@
+# Templates
+
+Sie können jede gewünschte Template-Engine mit **FastAPI** verwenden.
+
+Eine häufige Wahl ist Jinja2, dasselbe, was auch von Flask und anderen Tools verwendet wird.
+
+Es gibt Werkzeuge zur einfachen Konfiguration, die Sie direkt in Ihrer **FastAPI**-Anwendung verwenden können (bereitgestellt von Starlette).
+
+## Abhängigkeiten installieren
+
+Installieren Sie `jinja2`:
+
+
+
+Sie können Nachrichten in das Eingabefeld tippen und absenden:
+
+
+
+Und Ihre **FastAPI**-Anwendung mit WebSockets antwortet:
+
+
+
+Sie können viele Nachrichten senden (und empfangen):
+
+
+
+Und alle verwenden dieselbe WebSocket-Verbindung.
+
+## Verwendung von `Depends` und anderen
+
+In WebSocket-Endpunkten können Sie Folgendes aus `fastapi` importieren und verwenden:
+
+* `Depends`
+* `Security`
+* `Cookie`
+* `Header`
+* `Path`
+* `Query`
+
+Diese funktionieren auf die gleiche Weise wie für andere FastAPI-Endpunkte/*Pfadoperationen*:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="68-69 82"
+ {!> ../../../docs_src/websockets/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="68-69 82"
+ {!> ../../../docs_src/websockets/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="69-70 83"
+ {!> ../../../docs_src/websockets/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="66-67 79"
+ {!> ../../../docs_src/websockets/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="68-69 81"
+ {!> ../../../docs_src/websockets/tutorial002.py!}
+ ```
+
+!!! info
+ Da es sich um einen WebSocket handelt, macht es keinen Sinn, eine `HTTPException` auszulösen, stattdessen lösen wir eine `WebSocketException` aus.
+
+ Sie können einen „Closing“-Code verwenden, aus den gültigen Codes, die in der Spezifikation definiert sind.
+
+### WebSockets mit Abhängigkeiten ausprobieren
+
+Wenn Ihre Datei `main.py` heißt, führen Sie Ihre Anwendung mit Folgendem aus:
+
+
+
+## Verbindungsabbrüche und mehreren Clients handhaben
+
+Wenn eine WebSocket-Verbindung geschlossen wird, löst `await websocket.receive_text()` eine `WebSocketDisconnect`-Exception aus, die Sie dann wie in folgendem Beispiel abfangen und behandeln können.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="79-81"
+ {!> ../../../docs_src/websockets/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="81-83"
+ {!> ../../../docs_src/websockets/tutorial003.py!}
+ ```
+
+Zum Ausprobieren:
+
+* Öffnen Sie die Anwendung mit mehreren Browser-Tabs.
+* Schreiben Sie Nachrichten in den Tabs.
+* Schließen Sie dann einen der Tabs.
+
+Das wird die Ausnahme `WebSocketDisconnect` auslösen und alle anderen Clients erhalten eine Nachricht wie:
+
+```
+Client #1596980209979 left the chat
+```
+
+!!! tip "Tipp"
+ Die obige Anwendung ist ein minimales und einfaches Beispiel, das zeigt, wie Nachrichten verarbeitet und an mehrere WebSocket-Verbindungen gesendet werden.
+
+ Beachten Sie jedoch, dass, da alles nur im Speicher in einer einzigen Liste verwaltet wird, es nur funktioniert, während der Prozess ausgeführt wird, und nur mit einem einzelnen Prozess.
+
+ Wenn Sie etwas benötigen, das sich leicht in FastAPI integrieren lässt, aber robuster ist und von Redis, PostgreSQL und anderen unterstützt wird, sehen Sie sich encode/broadcaster an.
+
+## Mehr Informationen
+
+Weitere Informationen zu Optionen finden Sie in der Dokumentation von Starlette:
+
+* Die `WebSocket`-Klasse.
+* Klassen-basierte Handhabung von WebSockets.
diff --git a/docs/de/docs/advanced/wsgi.md b/docs/de/docs/advanced/wsgi.md
new file mode 100644
index 000000000..19ff90a90
--- /dev/null
+++ b/docs/de/docs/advanced/wsgi.md
@@ -0,0 +1,37 @@
+# WSGI inkludieren – Flask, Django und andere
+
+Sie können WSGI-Anwendungen mounten, wie Sie es in [Unteranwendungen – Mounts](sub-applications.md){.internal-link target=_blank}, [Hinter einem Proxy](behind-a-proxy.md){.internal-link target=_blank} gesehen haben.
+
+Dazu können Sie die `WSGIMiddleware` verwenden und damit Ihre WSGI-Anwendung wrappen, zum Beispiel Flask, Django usw.
+
+## `WSGIMiddleware` verwenden
+
+Sie müssen `WSGIMiddleware` importieren.
+
+Wrappen Sie dann die WSGI-Anwendung (z. B. Flask) mit der Middleware.
+
+Und dann mounten Sie das auf einem Pfad.
+
+```Python hl_lines="2-3 23"
+{!../../../docs_src/wsgi/tutorial001.py!}
+```
+
+## Es ansehen
+
+Jetzt wird jede Anfrage unter dem Pfad `/v1/` von der Flask-Anwendung verarbeitet.
+
+Und der Rest wird von **FastAPI** gehandhabt.
+
+Wenn Sie das mit Uvicorn ausführen und auf http://localhost:8000/v1/ gehen, sehen Sie die Response von Flask:
+
+```txt
+Hello, World from Flask!
+```
+
+Und wenn Sie auf http://localhost:8000/v2 gehen, sehen Sie die Response von FastAPI:
+
+```JSON
+{
+ "message": "Hello World"
+}
+```
diff --git a/docs/de/docs/alternatives.md b/docs/de/docs/alternatives.md
new file mode 100644
index 000000000..ea624ff3a
--- /dev/null
+++ b/docs/de/docs/alternatives.md
@@ -0,0 +1,414 @@
+# Alternativen, Inspiration und Vergleiche
+
+Was hat **FastAPI** inspiriert, ein Vergleich zu Alternativen, und was FastAPI von diesen gelernt hat.
+
+## Einführung
+
+**FastAPI** würde ohne die frühere Arbeit anderer nicht existieren.
+
+Es wurden zuvor viele Tools entwickelt, die als Inspiration für seine Entwicklung dienten.
+
+Ich habe die Schaffung eines neuen Frameworks viele Jahre lang vermieden. Zuerst habe ich versucht, alle von **FastAPI** abgedeckten Funktionen mithilfe vieler verschiedener Frameworks, Plugins und Tools zu lösen.
+
+Aber irgendwann gab es keine andere Möglichkeit, als etwas zu schaffen, das all diese Funktionen bereitstellte, die besten Ideen früherer Tools aufnahm und diese auf die bestmögliche Weise kombinierte, wobei Sprachfunktionen verwendet wurden, die vorher noch nicht einmal verfügbar waren (Python 3.6+ Typhinweise).
+
+## Vorherige Tools
+
+### Django
+
+Es ist das beliebteste Python-Framework und genießt großes Vertrauen. Es wird zum Aufbau von Systemen wie Instagram verwendet.
+
+Ist relativ eng mit relationalen Datenbanken (wie MySQL oder PostgreSQL) gekoppelt, daher ist es nicht sehr einfach, eine NoSQL-Datenbank (wie Couchbase, MongoDB, Cassandra, usw.) als Hauptspeicherengine zu verwenden.
+
+Es wurde erstellt, um den HTML-Code im Backend zu generieren, nicht um APIs zu erstellen, die von einem modernen Frontend (wie React, Vue.js und Angular) oder von anderen Systemen (wie IoT-Geräten) verwendet werden, um mit ihm zu kommunizieren.
+
+### Django REST Framework
+
+Das Django REST Framework wurde als flexibles Toolkit zum Erstellen von Web-APIs unter Verwendung von Django entwickelt, um dessen API-Möglichkeiten zu verbessern.
+
+Es wird von vielen Unternehmen verwendet, darunter Mozilla, Red Hat und Eventbrite.
+
+Es war eines der ersten Beispiele für **automatische API-Dokumentation**, und dies war insbesondere eine der ersten Ideen, welche „die Suche nach“ **FastAPI** inspirierten.
+
+!!! note "Hinweis"
+ Das Django REST Framework wurde von Tom Christie erstellt. Derselbe Schöpfer von Starlette und Uvicorn, auf denen **FastAPI** basiert.
+
+
+!!! check "Inspirierte **FastAPI**"
+ Eine automatische API-Dokumentationsoberfläche zu haben.
+
+### Flask
+
+Flask ist ein „Mikroframework“, es enthält weder Datenbankintegration noch viele der Dinge, die standardmäßig in Django enthalten sind.
+
+Diese Einfachheit und Flexibilität ermöglichen beispielsweise die Verwendung von NoSQL-Datenbanken als Hauptdatenspeichersystem.
+
+Da es sehr einfach ist, ist es relativ intuitiv zu erlernen, obwohl die Dokumentation an einigen Stellen etwas technisch wird.
+
+Es wird auch häufig für andere Anwendungen verwendet, die nicht unbedingt eine Datenbank, Benutzerverwaltung oder eine der vielen in Django enthaltenen Funktionen benötigen. Obwohl viele dieser Funktionen mit Plugins hinzugefügt werden können.
+
+Diese Entkopplung der Teile und die Tatsache, dass es sich um ein „Mikroframework“ handelt, welches so erweitert werden kann, dass es genau das abdeckt, was benötigt wird, war ein Schlüsselmerkmal, das ich beibehalten wollte.
+
+Angesichts der Einfachheit von Flask schien es eine gute Ergänzung zum Erstellen von APIs zu sein. Als Nächstes musste ein „Django REST Framework“ für Flask gefunden werden.
+
+!!! check "Inspirierte **FastAPI**"
+ Ein Mikroframework zu sein. Es einfach zu machen, die benötigten Tools und Teile zu kombinieren.
+
+ Über ein einfaches und benutzerfreundliches Routingsystem zu verfügen.
+
+
+### Requests
+
+**FastAPI** ist eigentlich keine Alternative zu **Requests**. Der Umfang der beiden ist sehr unterschiedlich.
+
+Es wäre tatsächlich üblich, Requests *innerhalb* einer FastAPI-Anwendung zu verwenden.
+
+Dennoch erhielt FastAPI von Requests einiges an Inspiration.
+
+**Requests** ist eine Bibliothek zur *Interaktion* mit APIs (als Client), während **FastAPI** eine Bibliothek zum *Erstellen* von APIs (als Server) ist.
+
+Die beiden stehen mehr oder weniger an entgegengesetzten Enden und ergänzen sich.
+
+Requests hat ein sehr einfaches und intuitives Design, ist sehr einfach zu bedienen und verfügt über sinnvolle Standardeinstellungen. Aber gleichzeitig ist es sehr leistungsstark und anpassbar.
+
+Aus diesem Grund heißt es auf der offiziellen Website:
+
+> Requests ist eines der am häufigsten heruntergeladenen Python-Packages aller Zeiten
+
+Die Art und Weise, wie Sie es verwenden, ist sehr einfach. Um beispielsweise einen `GET`-Request zu machen, würden Sie schreiben:
+
+```Python
+response = requests.get("http://example.com/some/url")
+```
+
+Die entsprechende *Pfadoperation* der FastAPI-API könnte wie folgt aussehen:
+
+```Python hl_lines="1"
+@app.get("/some/url")
+def read_url():
+ return {"message": "Hello World"}
+```
+
+Sehen Sie sich die Ähnlichkeiten in `requests.get(...)` und `@app.get(...)` an.
+
+!!! check "Inspirierte **FastAPI**"
+ * Über eine einfache und intuitive API zu verfügen.
+ * HTTP-Methodennamen (Operationen) direkt, auf einfache und intuitive Weise zu verwenden.
+ * Vernünftige Standardeinstellungen zu haben, aber auch mächtige Einstellungsmöglichkeiten.
+
+
+### Swagger / OpenAPI
+
+Die Hauptfunktion, die ich vom Django REST Framework haben wollte, war die automatische API-Dokumentation.
+
+Dann fand ich heraus, dass es einen Standard namens Swagger gab, zur Dokumentation von APIs unter Verwendung von JSON (oder YAML, einer Erweiterung von JSON).
+
+Und es gab bereits eine Web-Oberfläche für Swagger-APIs. Die Möglichkeit, Swagger-Dokumentation für eine API zu generieren, würde die automatische Nutzung dieser Web-Oberfläche ermöglichen.
+
+Irgendwann wurde Swagger an die Linux Foundation übergeben und in OpenAPI umbenannt.
+
+Aus diesem Grund spricht man bei Version 2.0 häufig von „Swagger“ und ab Version 3 von „OpenAPI“.
+
+!!! check "Inspirierte **FastAPI**"
+ Einen offenen Standard für API-Spezifikationen zu übernehmen und zu verwenden, anstelle eines benutzerdefinierten Schemas.
+
+ Und Standard-basierte Tools für die Oberfläche zu integrieren:
+
+ * Swagger UI
+ * ReDoc
+
+ Diese beiden wurden ausgewählt, weil sie ziemlich beliebt und stabil sind, aber bei einer schnellen Suche könnten Sie Dutzende alternativer Benutzeroberflächen für OpenAPI finden (welche Sie mit **FastAPI** verwenden können).
+
+### Flask REST Frameworks
+
+Es gibt mehrere Flask REST Frameworks, aber nachdem ich die Zeit und Arbeit investiert habe, sie zu untersuchen, habe ich festgestellt, dass viele nicht mehr unterstützt werden oder abgebrochen wurden und dass mehrere fortbestehende Probleme sie unpassend machten.
+
+### Marshmallow
+
+Eine der von API-Systemen benötigen Hauptfunktionen ist die Daten-„Serialisierung“, welche Daten aus dem Code (Python) entnimmt und in etwas umwandelt, was durch das Netzwerk gesendet werden kann. Beispielsweise das Konvertieren eines Objekts, welches Daten aus einer Datenbank enthält, in ein JSON-Objekt. Konvertieren von `datetime`-Objekten in Strings, usw.
+
+Eine weitere wichtige Funktion, benötigt von APIs, ist die Datenvalidierung, welche sicherstellt, dass die Daten unter gegebenen Umständen gültig sind. Zum Beispiel, dass ein Feld ein `int` ist und kein zufälliger String. Das ist besonders nützlich für hereinkommende Daten.
+
+Ohne ein Datenvalidierungssystem müssten Sie alle Prüfungen manuell im Code durchführen.
+
+Für diese Funktionen wurde Marshmallow entwickelt. Es ist eine großartige Bibliothek und ich habe sie schon oft genutzt.
+
+Aber sie wurde erstellt, bevor Typhinweise in Python existierten. Um also ein Schema zu definieren, müssen Sie bestimmte Werkzeuge und Klassen verwenden, die von Marshmallow bereitgestellt werden.
+
+!!! check "Inspirierte **FastAPI**"
+ Code zu verwenden, um „Schemas“ zu definieren, welche Datentypen und Validierung automatisch bereitstellen.
+
+### Webargs
+
+Eine weitere wichtige Funktion, die von APIs benötigt wird, ist das Parsen von Daten aus eingehenden Requests.
+
+Webargs wurde entwickelt, um dieses für mehrere Frameworks, einschließlich Flask, bereitzustellen.
+
+Es verwendet unter der Haube Marshmallow, um die Datenvalidierung durchzuführen. Und es wurde von denselben Entwicklern erstellt.
+
+Es ist ein großartiges Tool und ich habe es auch oft verwendet, bevor ich **FastAPI** hatte.
+
+!!! info
+ Webargs wurde von denselben Marshmallow-Entwicklern erstellt.
+
+!!! check "Inspirierte **FastAPI**"
+ Eingehende Requestdaten automatisch zu validieren.
+
+### APISpec
+
+Marshmallow und Webargs bieten Validierung, Parsen und Serialisierung als Plugins.
+
+Es fehlt jedoch noch die Dokumentation. Dann wurde APISpec erstellt.
+
+Es ist ein Plugin für viele Frameworks (und es gibt auch ein Plugin für Starlette).
+
+Die Funktionsweise besteht darin, dass Sie die Definition des Schemas im YAML-Format im Docstring jeder Funktion schreiben, die eine Route verarbeitet.
+
+Und es generiert OpenAPI-Schemas.
+
+So funktioniert es in Flask, Starlette, Responder, usw.
+
+Aber dann haben wir wieder das Problem einer Mikrosyntax innerhalb eines Python-Strings (eines großen YAML).
+
+Der Texteditor kann dabei nicht viel helfen. Und wenn wir Parameter oder Marshmallow-Schemas ändern und vergessen, auch den YAML-Docstring zu ändern, wäre das generierte Schema veraltet.
+
+!!! info
+ APISpec wurde von denselben Marshmallow-Entwicklern erstellt.
+
+
+!!! check "Inspirierte **FastAPI**"
+ Den offenen Standard für APIs, OpenAPI, zu unterstützen.
+
+### Flask-apispec
+
+Hierbei handelt es sich um ein Flask-Plugin, welches Webargs, Marshmallow und APISpec miteinander verbindet.
+
+Es nutzt die Informationen von Webargs und Marshmallow, um mithilfe von APISpec automatisch OpenAPI-Schemas zu generieren.
+
+Ein großartiges Tool, sehr unterbewertet. Es sollte weitaus populärer als viele andere Flask-Plugins sein. Möglicherweise liegt es daran, dass die Dokumentation zu kompakt und abstrakt ist.
+
+Das löste das Problem, YAML (eine andere Syntax) in Python-Docstrings schreiben zu müssen.
+
+Diese Kombination aus Flask, Flask-apispec mit Marshmallow und Webargs war bis zur Entwicklung von **FastAPI** mein Lieblings-Backend-Stack.
+
+Die Verwendung führte zur Entwicklung mehrerer Flask-Full-Stack-Generatoren. Dies sind die Hauptstacks, die ich (und mehrere externe Teams) bisher verwendet haben:
+
+* https://github.com/tiangolo/full-stack
+* https://github.com/tiangolo/full-stack-flask-couchbase
+* https://github.com/tiangolo/full-stack-flask-couchdb
+
+Und dieselben Full-Stack-Generatoren bildeten die Basis der [**FastAPI**-Projektgeneratoren](project-generation.md){.internal-link target=_blank}.
+
+!!! info
+ Flask-apispec wurde von denselben Marshmallow-Entwicklern erstellt.
+
+!!! check "Inspirierte **FastAPI**"
+ Das OpenAPI-Schema automatisch zu generieren, aus demselben Code, welcher die Serialisierung und Validierung definiert.
+
+### NestJS (und Angular)
+
+Dies ist nicht einmal Python, NestJS ist ein von Angular inspiriertes JavaScript (TypeScript) NodeJS Framework.
+
+Es erreicht etwas Ähnliches wie Flask-apispec.
+
+Es verfügt über ein integriertes Dependency Injection System, welches von Angular 2 inspiriert ist. Erfordert ein Vorab-Registrieren der „Injectables“ (wie alle anderen Dependency Injection Systeme, welche ich kenne), sodass der Code ausschweifender wird und es mehr Codeverdoppelung gibt.
+
+Da die Parameter mit TypeScript-Typen beschrieben werden (ähnlich den Python-Typhinweisen), ist die Editorunterstützung ziemlich gut.
+
+Da TypeScript-Daten jedoch nach der Kompilierung nach JavaScript nicht erhalten bleiben, können die Typen nicht gleichzeitig die Validierung, Serialisierung und Dokumentation definieren. Aus diesem Grund und aufgrund einiger Designentscheidungen ist es für die Validierung, Serialisierung und automatische Schemagenerierung erforderlich, an vielen Stellen Dekoratoren hinzuzufügen. Es wird also ziemlich ausführlich.
+
+Es kann nicht sehr gut mit verschachtelten Modellen umgehen. Wenn es sich beim JSON-Body in der Anfrage also um ein JSON-Objekt mit inneren Feldern handelt, die wiederum verschachtelte JSON-Objekte sind, kann er nicht richtig dokumentiert und validiert werden.
+
+!!! check "Inspirierte **FastAPI**"
+ Python-Typen zu verwenden, um eine hervorragende Editorunterstützung zu erhalten.
+
+ Über ein leistungsstarkes Dependency Injection System zu verfügen. Eine Möglichkeit zu finden, Codeverdoppelung zu minimieren.
+
+### Sanic
+
+Es war eines der ersten extrem schnellen Python-Frameworks, welches auf `asyncio` basierte. Es wurde so gestaltet, dass es Flask sehr ähnlich ist.
+
+!!! note "Technische Details"
+ Es verwendete `uvloop` anstelle der standardmäßigen Python-`asyncio`-Schleife. Das hat es so schnell gemacht.
+
+ Hat eindeutig Uvicorn und Starlette inspiriert, welche derzeit in offenen Benchmarks schneller als Sanic sind.
+
+!!! check "Inspirierte **FastAPI**"
+ Einen Weg zu finden, eine hervorragende Performanz zu haben.
+
+ Aus diesem Grund basiert **FastAPI** auf Starlette, da dieses das schnellste verfügbare Framework ist (getestet in Benchmarks von Dritten).
+
+### Falcon
+
+Falcon ist ein weiteres leistungsstarkes Python-Framework. Es ist minimalistisch konzipiert und dient als Grundlage für andere Frameworks wie Hug.
+
+Es ist so konzipiert, dass es über Funktionen verfügt, welche zwei Parameter empfangen, einen „Request“ und eine „Response“. Dann „lesen“ Sie Teile des Requests und „schreiben“ Teile der Response. Aufgrund dieses Designs ist es nicht möglich, Request-Parameter und -Bodys mit Standard-Python-Typhinweisen als Funktionsparameter zu deklarieren.
+
+Daher müssen Datenvalidierung, Serialisierung und Dokumentation im Code und nicht automatisch erfolgen. Oder sie müssen als Framework oberhalb von Falcon implementiert werden, so wie Hug. Dieselbe Unterscheidung findet auch in anderen Frameworks statt, die vom Design von Falcon inspiriert sind und ein Requestobjekt und ein Responseobjekt als Parameter haben.
+
+!!! check "Inspirierte **FastAPI**"
+ Wege zu finden, eine großartige Performanz zu erzielen.
+
+ Zusammen mit Hug (da Hug auf Falcon basiert), einen `response`-Parameter in Funktionen zu deklarieren.
+
+ Obwohl er in FastAPI optional ist und hauptsächlich zum Festlegen von Headern, Cookies und alternativen Statuscodes verwendet wird.
+
+### Molten
+
+Ich habe Molten in den ersten Phasen der Entwicklung von **FastAPI** entdeckt. Und es hat ganz ähnliche Ideen:
+
+* Basierend auf Python-Typhinweisen.
+* Validierung und Dokumentation aus diesen Typen.
+* Dependency Injection System.
+
+Es verwendet keine Datenvalidierungs-, Serialisierungs- und Dokumentationsbibliothek eines Dritten wie Pydantic, sondern verfügt über eine eigene. Daher wären diese Datentyp-Definitionen nicht so einfach wiederverwendbar.
+
+Es erfordert eine etwas ausführlichere Konfiguration. Und da es auf WSGI (anstelle von ASGI) basiert, ist es nicht darauf ausgelegt, die hohe Leistung von Tools wie Uvicorn, Starlette und Sanic zu nutzen.
+
+Das Dependency Injection System erfordert eine Vorab-Registrierung der Abhängigkeiten und die Abhängigkeiten werden basierend auf den deklarierten Typen aufgelöst. Daher ist es nicht möglich, mehr als eine „Komponente“ zu deklarieren, welche einen bestimmten Typ bereitstellt.
+
+Routen werden an einer einzigen Stelle deklariert, indem Funktionen verwendet werden, die an anderen Stellen deklariert wurden (anstatt Dekoratoren zu verwenden, welche direkt über der Funktion platziert werden können, welche den Endpunkt verarbeitet). Dies ähnelt eher der Vorgehensweise von Django als der Vorgehensweise von Flask (und Starlette). Es trennt im Code Dinge, die relativ eng miteinander gekoppelt sind.
+
+!!! check "Inspirierte **FastAPI**"
+ Zusätzliche Validierungen für Datentypen zu definieren, mithilfe des „Default“-Werts von Modellattributen. Dies verbessert die Editorunterstützung und war zuvor in Pydantic nicht verfügbar.
+
+ Das hat tatsächlich dazu geführt, dass Teile von Pydantic aktualisiert wurden, um denselben Validierungsdeklarationsstil zu unterstützen (diese gesamte Funktionalität ist jetzt bereits in Pydantic verfügbar).
+
+### Hug
+
+Hug war eines der ersten Frameworks, welches die Deklaration von API-Parametertypen mithilfe von Python-Typhinweisen implementierte. Das war eine großartige Idee, die andere Tools dazu inspirierte, dasselbe zu tun.
+
+Es verwendete benutzerdefinierte Typen in seinen Deklarationen anstelle von Standard-Python-Typen, es war aber dennoch ein großer Fortschritt.
+
+Außerdem war es eines der ersten Frameworks, welches ein benutzerdefiniertes Schema generierte, welches die gesamte API in JSON deklarierte.
+
+Es basierte nicht auf einem Standard wie OpenAPI und JSON Schema. Daher wäre es nicht einfach, es in andere Tools wie Swagger UI zu integrieren. Aber, nochmal, es war eine sehr innovative Idee.
+
+Es verfügt über eine interessante, ungewöhnliche Funktion: Mit demselben Framework ist es möglich, APIs und auch CLIs zu erstellen.
+
+Da es auf dem bisherigen Standard für synchrone Python-Webframeworks (WSGI) basiert, kann es nicht mit Websockets und anderen Dingen umgehen, verfügt aber dennoch über eine hohe Performanz.
+
+!!! info
+ Hug wurde von Timothy Crosley erstellt, dem gleichen Schöpfer von `isort`, einem großartigen Tool zum automatischen Sortieren von Importen in Python-Dateien.
+
+!!! check "Ideen, die **FastAPI** inspiriert haben"
+ Hug inspirierte Teile von APIStar und war eines der Tools, die ich am vielversprechendsten fand, neben APIStar.
+
+ Hug hat dazu beigetragen, **FastAPI** dazu zu inspirieren, Python-Typhinweise zum Deklarieren von Parametern zu verwenden und ein Schema zu generieren, das die API automatisch definiert.
+
+ Hug inspirierte **FastAPI** dazu, einen `response`-Parameter in Funktionen zu deklarieren, um Header und Cookies zu setzen.
+
+### APIStar (≦ 0.5)
+
+Kurz bevor ich mich entschied, **FastAPI** zu erstellen, fand ich den **APIStar**-Server. Er hatte fast alles, was ich suchte, und ein tolles Design.
+
+Er war eine der ersten Implementierungen eines Frameworks, die ich je gesehen hatte (vor NestJS und Molten), welches Python-Typhinweise zur Deklaration von Parametern und Requests verwendeten. Ich habe ihn mehr oder weniger zeitgleich mit Hug gefunden. Aber APIStar nutzte den OpenAPI-Standard.
+
+Er verfügte an mehreren Stellen über automatische Datenvalidierung, Datenserialisierung und OpenAPI-Schemagenerierung, basierend auf denselben Typhinweisen.
+
+Body-Schemadefinitionen verwendeten nicht die gleichen Python-Typhinweise wie Pydantic, er war Marshmallow etwas ähnlicher, sodass die Editorunterstützung nicht so gut war, aber dennoch war APIStar die beste verfügbare Option.
+
+Er hatte zu dieser Zeit die besten Leistungsbenchmarks (nur übertroffen von Starlette).
+
+Anfangs gab es keine Web-Oberfläche für die automatische API-Dokumentation, aber ich wusste, dass ich Swagger UI hinzufügen konnte.
+
+Er verfügte über ein Dependency Injection System. Es erforderte eine Vorab-Registrierung der Komponenten, wie auch bei anderen oben besprochenen Tools. Aber dennoch, es war ein tolles Feature.
+
+Ich konnte ihn nie in einem vollständigen Projekt verwenden, da er keine Sicherheitsintegration hatte, sodass ich nicht alle Funktionen, die ich hatte, durch die auf Flask-apispec basierenden Full-Stack-Generatoren ersetzen konnte. Ich hatte in meinem Projekte-Backlog den Eintrag, einen Pull Request zu erstellen, welcher diese Funktionalität hinzufügte.
+
+Doch dann verlagerte sich der Schwerpunkt des Projekts.
+
+Es handelte sich nicht länger um ein API-Webframework, da sich der Entwickler auf Starlette konzentrieren musste.
+
+Jetzt handelt es sich bei APIStar um eine Reihe von Tools zur Validierung von OpenAPI-Spezifikationen, nicht um ein Webframework.
+
+!!! info
+ APIStar wurde von Tom Christie erstellt. Derselbe, welcher Folgendes erstellt hat:
+
+ * Django REST Framework
+ * Starlette (auf welchem **FastAPI** basiert)
+ * Uvicorn (verwendet von Starlette und **FastAPI**)
+
+!!! check "Inspirierte **FastAPI**"
+ Zu existieren.
+
+ Die Idee, mehrere Dinge (Datenvalidierung, Serialisierung und Dokumentation) mit denselben Python-Typen zu deklarieren, welche gleichzeitig eine hervorragende Editorunterstützung bieten, hielt ich für eine brillante Idee.
+
+ Und nach einer langen Suche nach einem ähnlichen Framework und dem Testen vieler verschiedener Alternativen, war APIStar die beste verfügbare Option.
+
+ Dann hörte APIStar auf, als Server zu existieren, und Starlette wurde geschaffen, welches eine neue, bessere Grundlage für ein solches System bildete. Das war die finale Inspiration für die Entwicklung von **FastAPI**.
+
+ Ich betrachte **FastAPI** als einen „spirituellen Nachfolger“ von APIStar, welcher die Funktionen, das Typsystem und andere Teile verbessert und erweitert, basierend auf den Erkenntnissen aus all diesen früheren Tools.
+
+## Verwendet von **FastAPI**
+
+### Pydantic
+
+Pydantic ist eine Bibliothek zum Definieren von Datenvalidierung, Serialisierung und Dokumentation (unter Verwendung von JSON Schema) basierend auf Python-Typhinweisen.
+
+Das macht es äußerst intuitiv.
+
+Es ist vergleichbar mit Marshmallow. Obwohl es in Benchmarks schneller als Marshmallow ist. Und da es auf den gleichen Python-Typhinweisen basiert, ist die Editorunterstützung großartig.
+
+!!! check "**FastAPI** verwendet es, um"
+ Die gesamte Datenvalidierung, Datenserialisierung und automatische Modelldokumentation (basierend auf JSON Schema) zu erledigen.
+
+ **FastAPI** nimmt dann, abgesehen von all den anderen Dingen, die es tut, dieses JSON-Schema und fügt es in OpenAPI ein.
+
+### Starlette
+
+Starlette ist ein leichtgewichtiges ASGI-Framework/Toolkit, welches sich ideal für die Erstellung hochperformanter asynchroner Dienste eignet.
+
+Es ist sehr einfach und intuitiv. Es ist so konzipiert, dass es leicht erweiterbar ist und über modulare Komponenten verfügt.
+
+Es bietet:
+
+* Eine sehr beeindruckende Leistung.
+* WebSocket-Unterstützung.
+* Hintergrundtasks im selben Prozess.
+* Events für das Hoch- und Herunterfahren.
+* Testclient basierend auf HTTPX.
+* CORS, GZip, statische Dateien, Streamende Responses.
+* Session- und Cookie-Unterstützung.
+* 100 % Testabdeckung.
+* 100 % Typannotierte Codebasis.
+* Wenige starke Abhängigkeiten.
+
+Starlette ist derzeit das schnellste getestete Python-Framework. Nur übertroffen von Uvicorn, welches kein Framework, sondern ein Server ist.
+
+Starlette bietet alle grundlegenden Funktionen eines Web-Microframeworks.
+
+Es bietet jedoch keine automatische Datenvalidierung, Serialisierung oder Dokumentation.
+
+Das ist eines der wichtigsten Dinge, welche **FastAPI** hinzufügt, alles basierend auf Python-Typhinweisen (mit Pydantic). Das, plus, das Dependency Injection System, Sicherheitswerkzeuge, OpenAPI-Schemagenerierung, usw.
+
+!!! note "Technische Details"
+ ASGI ist ein neuer „Standard“, welcher von Mitgliedern des Django-Kernteams entwickelt wird. Es handelt sich immer noch nicht um einen „Python-Standard“ (ein PEP), obwohl sie gerade dabei sind, das zu tun.
+
+ Dennoch wird es bereits von mehreren Tools als „Standard“ verwendet. Das verbessert die Interoperabilität erheblich, da Sie Uvicorn mit jeden anderen ASGI-Server (wie Daphne oder Hypercorn) tauschen oder ASGI-kompatible Tools wie `python-socketio` hinzufügen können.
+
+!!! check "**FastAPI** verwendet es, um"
+ Alle Kern-Webaspekte zu handhaben. Und fügt Funktionen obenauf.
+
+ Die Klasse `FastAPI` selbst erbt direkt von der Klasse `Starlette`.
+
+ Alles, was Sie also mit Starlette machen können, können Sie direkt mit **FastAPI** machen, da es sich im Grunde um Starlette auf Steroiden handelt.
+
+### Uvicorn
+
+Uvicorn ist ein blitzschneller ASGI-Server, der auf uvloop und httptools basiert.
+
+Es handelt sich nicht um ein Webframework, sondern um einen Server. Beispielsweise werden keine Tools für das Routing von Pfaden bereitgestellt. Das ist etwas, was ein Framework wie Starlette (oder **FastAPI**) zusätzlich bieten würde.
+
+Es ist der empfohlene Server für Starlette und **FastAPI**.
+
+!!! check "**FastAPI** empfiehlt es als"
+ Hauptwebserver zum Ausführen von **FastAPI**-Anwendungen.
+
+ Sie können ihn mit Gunicorn kombinieren, um einen asynchronen Multiprozess-Server zu erhalten.
+
+ Weitere Details finden Sie im Abschnitt [Deployment](deployment/index.md){.internal-link target=_blank}.
+
+## Benchmarks und Geschwindigkeit
+
+Um den Unterschied zwischen Uvicorn, Starlette und FastAPI zu verstehen, zu vergleichen und zu sehen, lesen Sie den Abschnitt über [Benchmarks](benchmarks.md){.internal-link target=_blank}.
diff --git a/docs/de/docs/async.md b/docs/de/docs/async.md
new file mode 100644
index 000000000..c2a43ac66
--- /dev/null
+++ b/docs/de/docs/async.md
@@ -0,0 +1,430 @@
+# Nebenläufigkeit und async / await
+
+Details zur `async def`-Syntax für *Pfadoperation-Funktionen* und Hintergrundinformationen zu asynchronem Code, Nebenläufigkeit und Parallelität.
+
+## In Eile?
+
+TL;DR:
+
+Wenn Sie Bibliotheken von Dritten verwenden, die mit `await` aufgerufen werden müssen, wie zum Beispiel:
+
+```Python
+results = await some_library()
+```
+
+Dann deklarieren Sie Ihre *Pfadoperation-Funktionen* mit `async def` wie in:
+
+```Python hl_lines="2"
+@app.get('/')
+async def read_results():
+ results = await some_library()
+ return results
+```
+
+!!! note
+ Sie können `await` nur innerhalb von Funktionen verwenden, die mit `async def` erstellt wurden.
+
+---
+
+Wenn Sie eine Bibliothek eines Dritten verwenden, die mit etwas kommuniziert (einer Datenbank, einer API, dem Dateisystem, usw.) und welche die Verwendung von `await` nicht unterstützt (dies ist derzeit bei den meisten Datenbankbibliotheken der Fall), dann deklarieren Sie Ihre *Pfadoperation-Funktionen* ganz normal nur mit `def`, etwa:
+
+```Python hl_lines="2"
+@app.get('/')
+def results():
+ results = some_library()
+ return results
+```
+
+---
+
+Wenn Ihre Anwendung (irgendwie) mit nichts anderem kommunizieren und auf dessen Antwort warten muss, verwenden Sie `async def`.
+
+---
+
+Wenn Sie sich unsicher sind, verwenden Sie einfach `def`.
+
+---
+
+**Hinweis**: Sie können `def` und `async def` in Ihren *Pfadoperation-Funktionen* beliebig mischen, so wie Sie es benötigen, und jede einzelne Funktion in der für Sie besten Variante erstellen. FastAPI wird damit das Richtige tun.
+
+Wie dem auch sei, in jedem der oben genannten Fälle wird FastAPI immer noch asynchron arbeiten und extrem schnell sein.
+
+Wenn Sie jedoch den oben genannten Schritten folgen, können einige Performance-Optimierungen vorgenommen werden.
+
+## Technische Details
+
+Moderne Versionen von Python unterstützen **„asynchronen Code“** unter Verwendung sogenannter **„Coroutinen“** mithilfe der Syntax **`async`** und **`await`**.
+
+Nehmen wir obigen Satz in den folgenden Abschnitten Schritt für Schritt unter die Lupe:
+
+* **Asynchroner Code**
+* **`async` und `await`**
+* **Coroutinen**
+
+## Asynchroner Code
+
+Asynchroner Code bedeutet lediglich, dass die Sprache 💬 eine Möglichkeit hat, dem Computersystem / Programm 🤖 mitzuteilen, dass es 🤖 an einem bestimmten Punkt im Code darauf warten muss, dass *etwas anderes* irgendwo anders fertig wird. Nehmen wir an, *etwas anderes* ist hier „Langsam-Datei“ 📝.
+
+Während der Zeit, die „Langsam-Datei“ 📝 benötigt, kann das System also andere Aufgaben erledigen.
+
+Dann kommt das System / Programm 🤖 bei jeder Gelegenheit zurück, wenn es entweder wieder wartet, oder wann immer es 🤖 die ganze Arbeit erledigt hat, die zu diesem Zeitpunkt zu tun war. Und es 🤖 wird nachschauen, ob eine der Aufgaben, auf die es gewartet hat, fertig damit ist, zu tun, was sie tun sollte.
+
+Dann nimmt es 🤖 die erste erledigte Aufgabe (sagen wir, unsere „Langsam-Datei“ 📝) und bearbeitet sie weiter.
+
+Das „Warten auf etwas anderes“ bezieht sich normalerweise auf I/O-Operationen, die relativ „langsam“ sind (im Vergleich zur Geschwindigkeit des Prozessors und des Arbeitsspeichers), wie etwa das Warten darauf, dass:
+
+* die Daten des Clients über das Netzwerk empfangen wurden
+* die von Ihrem Programm gesendeten Daten vom Client über das Netzwerk empfangen wurden
+* der Inhalt einer Datei vom System von der Festplatte gelesen und an Ihr Programm übergeben wurde
+* der Inhalt, den Ihr Programm dem System übergeben hat, auf die Festplatte geschrieben wurde
+* eine Remote-API-Operation beendet wurde
+* Eine Datenbankoperation abgeschlossen wurde
+* eine Datenbankabfrage die Ergebnisse zurückgegeben hat
+* usw.
+
+Da die Ausführungszeit hier hauptsächlich durch das Warten auf I/O-Operationen verbraucht wird, nennt man dies auch „I/O-lastige“ („I/O bound“) Operationen.
+
+„Asynchron“, sagt man, weil das Computersystem / Programm nicht mit einer langsamen Aufgabe „synchronisiert“ werden muss und nicht auf den genauen Moment warten muss, in dem die Aufgabe beendet ist, ohne dabei etwas zu tun, um schließlich das Ergebnis der Aufgabe zu übernehmen und die Arbeit fortsetzen zu können.
+
+Da es sich stattdessen um ein „asynchrones“ System handelt, kann die Aufgabe nach Abschluss ein wenig (einige Mikrosekunden) in der Schlange warten, bis das System / Programm seine anderen Dinge erledigt hat und zurückkommt, um die Ergebnisse entgegenzunehmen und mit ihnen weiterzuarbeiten.
+
+Für „synchron“ (im Gegensatz zu „asynchron“) wird auch oft der Begriff „sequentiell“ verwendet, da das System / Programm alle Schritte in einer Sequenz („der Reihe nach“) ausführt, bevor es zu einer anderen Aufgabe wechselt, auch wenn diese Schritte mit Warten verbunden sind.
+
+### Nebenläufigkeit und Hamburger
+
+Diese oben beschriebene Idee von **asynchronem** Code wird manchmal auch **„Nebenläufigkeit“** genannt. Sie unterscheidet sich von **„Parallelität“**.
+
+**Nebenläufigkeit** und **Parallelität** beziehen sich beide auf „verschiedene Dinge, die mehr oder weniger gleichzeitig passieren“.
+
+Aber die Details zwischen *Nebenläufigkeit* und *Parallelität* sind ziemlich unterschiedlich.
+
+Um den Unterschied zu erkennen, stellen Sie sich die folgende Geschichte über Hamburger vor:
+
+### Nebenläufige Hamburger
+
+Sie gehen mit Ihrem Schwarm Fastfood holen, stehen in der Schlange, während der Kassierer die Bestellungen der Leute vor Ihnen entgegennimmt. 😍
+
+
+
+Dann sind Sie an der Reihe und Sie bestellen zwei sehr schmackhafte Burger für Ihren Schwarm und Sie. 🍔🍔
+
+
+
+Der Kassierer sagt etwas zum Koch in der Küche, damit dieser weiß, dass er Ihre Burger zubereiten muss (obwohl er gerade die für die vorherigen Kunden zubereitet).
+
+
+
+Sie bezahlen. 💸
+
+Der Kassierer gibt Ihnen die Nummer Ihrer Bestellung.
+
+
+
+Während Sie warten, suchen Sie sich mit Ihrem Schwarm einen Tisch aus, Sie sitzen da und reden lange mit Ihrem Schwarm (da Ihre Burger sehr aufwändig sind und die Zubereitung einige Zeit dauert).
+
+Während Sie mit Ihrem Schwarm am Tisch sitzen und auf die Burger warten, können Sie die Zeit damit verbringen, zu bewundern, wie großartig, süß und klug Ihr Schwarm ist ✨😍✨.
+
+
+
+Während Sie warten und mit Ihrem Schwarm sprechen, überprüfen Sie von Zeit zu Zeit die auf dem Zähler angezeigte Nummer, um zu sehen, ob Sie bereits an der Reihe sind.
+
+Dann, irgendwann, sind Sie endlich an der Reihe. Sie gehen zur Theke, holen sich die Burger und kommen zurück an den Tisch.
+
+
+
+Sie und Ihr Schwarm essen die Burger und haben eine schöne Zeit. ✨
+
+
+
+!!! info
+ Die wunderschönen Illustrationen stammen von Ketrina Thompson. 🎨
+
+---
+
+Stellen Sie sich vor, Sie wären das Computersystem / Programm 🤖 in dieser Geschichte.
+
+Während Sie an der Schlange stehen, sind Sie einfach untätig 😴, warten darauf, dass Sie an die Reihe kommen, und tun nichts sehr „Produktives“. Aber die Schlange ist schnell abgearbeitet, weil der Kassierer nur die Bestellungen entgegennimmt (und nicht zubereitet), also ist das vertretbar.
+
+Wenn Sie dann an der Reihe sind, erledigen Sie tatsächliche „produktive“ Arbeit, Sie gehen das Menü durch, entscheiden sich, was Sie möchten, bekunden Ihre und die Wahl Ihres Schwarms, bezahlen, prüfen, ob Sie die richtige Menge Geld oder die richtige Karte geben, prüfen, ob die Rechnung korrekt ist, prüfen, dass die Bestellung die richtigen Artikel enthält, usw.
+
+Aber dann, auch wenn Sie Ihre Burger noch nicht haben, ist Ihre Interaktion mit dem Kassierer erst mal „auf Pause“ ⏸, weil Sie warten müssen 🕙, bis Ihre Burger fertig sind.
+
+Aber wenn Sie sich von der Theke entfernt haben und mit der Nummer für die Bestellung an einem Tisch sitzen, können Sie Ihre Aufmerksamkeit auf Ihren Schwarm lenken und an dieser Aufgabe „arbeiten“ ⏯ 🤓. Sie machen wieder etwas sehr „Produktives“ und flirten mit Ihrem Schwarm 😍.
+
+Dann sagt der Kassierer 💁 „Ich bin mit dem Burger fertig“, indem er Ihre Nummer auf dem Display über der Theke anzeigt, aber Sie springen nicht sofort wie verrückt auf, wenn das Display auf Ihre Nummer springt. Sie wissen, dass niemand Ihnen Ihre Burger wegnimmt, denn Sie haben die Nummer Ihrer Bestellung, und andere Leute haben andere Nummern.
+
+Also warten Sie darauf, dass Ihr Schwarm ihre Geschichte zu Ende erzählt (die aktuelle Arbeit ⏯ / bearbeitete Aufgabe beendet 🤓), lächeln sanft und sagen, dass Sie die Burger holen ⏸.
+
+Dann gehen Sie zur Theke 🔀, zur ursprünglichen Aufgabe, die nun erledigt ist ⏯, nehmen die Burger auf, sagen Danke, und bringen sie zum Tisch. Damit ist dieser Schritt / diese Aufgabe der Interaktion mit der Theke abgeschlossen ⏹. Das wiederum schafft eine neue Aufgabe, „Burger essen“ 🔀 ⏯, aber die vorherige Aufgabe „Burger holen“ ist erledigt ⏹.
+
+### Parallele Hamburger
+
+Stellen wir uns jetzt vor, dass es sich hierbei nicht um „nebenläufige Hamburger“, sondern um „parallele Hamburger“ handelt.
+
+Sie gehen los mit Ihrem Schwarm, um paralleles Fast Food zu bekommen.
+
+Sie stehen in der Schlange, während mehrere (sagen wir acht) Kassierer, die gleichzeitig Köche sind, die Bestellungen der Leute vor Ihnen entgegennehmen.
+
+Alle vor Ihnen warten darauf, dass ihre Burger fertig sind, bevor sie die Theke verlassen, denn jeder der 8 Kassierer geht los und bereitet den Burger sofort zu, bevor er die nächste Bestellung entgegennimmt.
+
+
+
+Dann sind Sie endlich an der Reihe und bestellen zwei sehr leckere Burger für Ihren Schwarm und Sie.
+
+Sie zahlen 💸.
+
+
+
+Der Kassierer geht in die Küche.
+
+Sie warten, vor der Theke stehend 🕙, damit niemand außer Ihnen Ihre Burger entgegennimmt, da es keine Nummern für die Reihenfolge gibt.
+
+
+
+Da Sie und Ihr Schwarm damit beschäftigt sind, niemanden vor sich zu lassen, der Ihre Burger nimmt, wenn sie ankommen, können Sie Ihrem Schwarm keine Aufmerksamkeit schenken. 😞
+
+Das ist „synchrone“ Arbeit, Sie sind mit dem Kassierer/Koch „synchronisiert“ 👨🍳. Sie müssen warten 🕙 und genau in dem Moment da sein, in dem der Kassierer/Koch 👨🍳 die Burger zubereitet hat und Ihnen gibt, sonst könnte jemand anderes sie nehmen.
+
+
+
+Dann kommt Ihr Kassierer/Koch 👨🍳 endlich mit Ihren Burgern zurück, nachdem Sie lange vor der Theke gewartet 🕙 haben.
+
+
+
+Sie nehmen Ihre Burger und gehen mit Ihrem Schwarm an den Tisch.
+
+Sie essen sie und sind fertig. ⏹
+
+
+
+Es wurde nicht viel geredet oder geflirtet, da die meiste Zeit mit Warten 🕙 vor der Theke verbracht wurde. 😞
+
+!!! info
+ Die wunderschönen Illustrationen stammen von Ketrina Thompson. 🎨
+
+---
+
+In diesem Szenario der parallelen Hamburger sind Sie ein Computersystem / Programm 🤖 mit zwei Prozessoren (Sie und Ihr Schwarm), die beide warten 🕙 und ihre Aufmerksamkeit darauf verwenden, „lange Zeit vor der Theke zu warten“ 🕙.
+
+Der Fast-Food-Laden verfügt über 8 Prozessoren (Kassierer/Köche). Während der nebenläufige Burger-Laden nur zwei hatte (einen Kassierer und einen Koch).
+
+Dennoch ist das schlussendliche Benutzererlebnis nicht das Beste. 😞
+
+---
+
+Dies wäre die parallele äquivalente Geschichte für Hamburger. 🍔
+
+Für ein „realeres“ Beispiel hierfür, stellen Sie sich eine Bank vor.
+
+Bis vor kurzem hatten die meisten Banken mehrere Kassierer 👨💼👨💼👨💼👨💼 und eine große Warteschlange 🕙🕙🕙🕙🕙🕙🕙🕙.
+
+Alle Kassierer erledigen die ganze Arbeit mit einem Kunden nach dem anderen 👨💼⏯.
+
+Und man muss lange in der Schlange warten 🕙 sonst kommt man nicht an die Reihe.
+
+Sie würden Ihren Schwarm 😍 wahrscheinlich nicht mitnehmen wollen, um Besorgungen bei der Bank zu erledigen 🏦.
+
+### Hamburger Schlussfolgerung
+
+In diesem Szenario „Fast Food Burger mit Ihrem Schwarm“ ist es viel sinnvoller, ein nebenläufiges System zu haben ⏸🔀⏯, da viel gewartet wird 🕙.
+
+Das ist auch bei den meisten Webanwendungen der Fall.
+
+Viele, viele Benutzer, aber Ihr Server wartet 🕙 darauf, dass deren nicht so gute Internetverbindungen die Requests übermitteln.
+
+Und dann warten 🕙, bis die Responses zurückkommen.
+
+Dieses „Warten“ 🕙 wird in Mikrosekunden gemessen, aber zusammenfassend lässt sich sagen, dass am Ende eine Menge gewartet wird.
+
+Deshalb ist es sehr sinnvoll, asynchronen ⏸🔀⏯ Code für Web-APIs zu verwenden.
+
+Diese Art der Asynchronität hat NodeJS populär gemacht (auch wenn NodeJS nicht parallel ist) und darin liegt die Stärke von Go als Programmiersprache.
+
+Und das ist das gleiche Leistungsniveau, das Sie mit **FastAPI** erhalten.
+
+Und da Sie Parallelität und Asynchronität gleichzeitig haben können, erzielen Sie eine höhere Performanz als die meisten getesteten NodeJS-Frameworks und sind mit Go auf Augenhöhe, einer kompilierten Sprache, die näher an C liegt (alles dank Starlette).
+
+### Ist Nebenläufigkeit besser als Parallelität?
+
+Nein! Das ist nicht die Moral der Geschichte.
+
+Nebenläufigkeit unterscheidet sich von Parallelität. Und sie ist besser bei **bestimmten** Szenarien, die viel Warten erfordern. Aus diesem Grund ist sie im Allgemeinen viel besser als Parallelität für die Entwicklung von Webanwendungen. Aber das stimmt nicht für alle Anwendungen.
+
+Um die Dinge auszugleichen, stellen Sie sich die folgende Kurzgeschichte vor:
+
+> Sie müssen ein großes, schmutziges Haus aufräumen.
+
+*Yup, das ist die ganze Geschichte*.
+
+---
+
+Es gibt kein Warten 🕙, nur viel Arbeit an mehreren Stellen im Haus.
+
+Sie könnten wie im Hamburger-Beispiel hin- und herspringen, zuerst das Wohnzimmer, dann die Küche, aber da Sie auf nichts warten 🕙, sondern nur putzen und putzen, hätte das Hin- und Herspringen keine Auswirkungen.
+
+Es würde mit oder ohne Hin- und Herspringen (Nebenläufigkeit) die gleiche Zeit in Anspruch nehmen, um fertig zu werden, und Sie hätten die gleiche Menge an Arbeit erledigt.
+
+Aber wenn Sie in diesem Fall die acht Ex-Kassierer/Köche/jetzt Reinigungskräfte mitbringen würden und jeder von ihnen (plus Sie) würde einen Bereich des Hauses reinigen, könnten Sie die ganze Arbeit **parallel** erledigen, und würden mit dieser zusätzlichen Hilfe viel schneller fertig werden.
+
+In diesem Szenario wäre jede einzelne Reinigungskraft (einschließlich Ihnen) ein Prozessor, der seinen Teil der Arbeit erledigt.
+
+Und da die meiste Ausführungszeit durch tatsächliche Arbeit (anstatt durch Warten) in Anspruch genommen wird und die Arbeit in einem Computer von einer CPU erledigt wird, werden diese Probleme als „CPU-lastig“ („CPU bound“) bezeichnet.
+
+---
+
+Typische Beispiele für CPU-lastige Vorgänge sind Dinge, die komplexe mathematische Berechnungen erfordern.
+
+Zum Beispiel:
+
+* **Audio-** oder **Bildbearbeitung**.
+* **Computer Vision**: Ein Bild besteht aus Millionen von Pixeln, jedes Pixel hat 3 Werte / Farben, die Verarbeitung erfordert normalerweise, Berechnungen mit diesen Pixeln durchzuführen, alles zur gleichen Zeit.
+* **Maschinelles Lernen**: Normalerweise sind viele „Matrix“- und „Vektor“-Multiplikationen erforderlich. Stellen Sie sich eine riesige Tabelle mit Zahlen vor, in der Sie alle Zahlen gleichzeitig multiplizieren.
+* **Deep Learning**: Dies ist ein Teilgebiet des maschinellen Lernens, daher gilt das Gleiche. Es ist nur so, dass es nicht eine einzige Tabelle mit Zahlen zum Multiplizieren gibt, sondern eine riesige Menge davon, und in vielen Fällen verwendet man einen speziellen Prozessor, um diese Modelle zu erstellen und / oder zu verwenden.
+
+### Nebenläufigkeit + Parallelität: Web + maschinelles Lernen
+
+Mit **FastAPI** können Sie die Vorteile der Nebenläufigkeit nutzen, die in der Webentwicklung weit verbreitet ist (derselbe Hauptvorteil von NodeJS).
+
+Sie können aber auch die Vorteile von Parallelität und Multiprocessing (Mehrere Prozesse werden parallel ausgeführt) für **CPU-lastige** Workloads wie in Systemen für maschinelles Lernen nutzen.
+
+Dies und die einfache Tatsache, dass Python die Hauptsprache für **Data Science**, maschinelles Lernen und insbesondere Deep Learning ist, machen FastAPI zu einem sehr passenden Werkzeug für Web-APIs und Anwendungen für Data Science / maschinelles Lernen (neben vielen anderen).
+
+Wie Sie diese Parallelität in der Produktion erreichen, erfahren Sie im Abschnitt über [Deployment](deployment/index.md){.internal-link target=_blank}.
+
+## `async` und `await`.
+
+Moderne Versionen von Python verfügen über eine sehr intuitive Möglichkeit, asynchronen Code zu schreiben. Dadurch sieht es wie normaler „sequentieller“ Code aus und übernimmt im richtigen Moment das „Warten“ für Sie.
+
+Wenn es einen Vorgang gibt, der erfordert, dass gewartet wird, bevor die Ergebnisse zurückgegeben werden, und der diese neue Python-Funktionalität unterstützt, können Sie ihn wie folgt schreiben:
+
+```Python
+burgers = await get_burgers(2)
+```
+
+Der Schlüssel hier ist das `await`. Es teilt Python mit, dass es warten ⏸ muss, bis `get_burgers(2)` seine Aufgabe erledigt hat 🕙, bevor die Ergebnisse in `burgers` gespeichert werden. Damit weiß Python, dass es in der Zwischenzeit etwas anderes tun kann 🔀 ⏯ (z. B. einen weiteren Request empfangen).
+
+Damit `await` funktioniert, muss es sich in einer Funktion befinden, die diese Asynchronität unterstützt. Dazu deklarieren Sie sie einfach mit `async def`:
+
+```Python hl_lines="1"
+async def get_burgers(number: int):
+ # Mach Sie hier etwas Asynchrones, um die Burger zu erstellen
+ return burgers
+```
+
+... statt mit `def`:
+
+```Python hl_lines="2"
+# Die ist nicht asynchron
+def get_sequential_burgers(number: int):
+ # Mach Sie hier etwas Sequentielles, um die Burger zu erstellen
+ return burgers
+```
+
+Mit `async def` weiß Python, dass es innerhalb dieser Funktion auf `await`-Ausdrücke achten muss und dass es die Ausführung dieser Funktion „anhalten“ ⏸ und etwas anderes tun kann 🔀, bevor es zurückkommt.
+
+Wenn Sie eine `async def`-Funktion aufrufen möchten, müssen Sie sie „erwarten“ („await“). Das folgende wird also nicht funktionieren:
+
+```Python
+# Das funktioniert nicht, weil get_burgers definiert wurde mit: async def
+burgers = get_burgers(2)
+```
+
+---
+
+Wenn Sie also eine Bibliothek verwenden, die Ihnen sagt, dass Sie sie mit `await` aufrufen können, müssen Sie die *Pfadoperation-Funktionen*, die diese Bibliothek verwenden, mittels `async def` erstellen, wie in:
+
+```Python hl_lines="2-3"
+@app.get('/burgers')
+async def read_burgers():
+ burgers = await get_burgers(2)
+ return burgers
+```
+
+### Weitere technische Details
+
+Ihnen ist wahrscheinlich aufgefallen, dass `await` nur innerhalb von Funktionen verwendet werden kann, die mit `async def` definiert sind.
+
+Gleichzeitig müssen aber mit `async def` definierte Funktionen „erwartet“ („awaited“) werden. Daher können Funktionen mit `async def` nur innerhalb von Funktionen aufgerufen werden, die auch mit `async def` definiert sind.
+
+Daraus resultiert das Ei-und-Huhn-Problem: Wie ruft man die erste `async` Funktion auf?
+
+Wenn Sie mit **FastAPI** arbeiten, müssen Sie sich darüber keine Sorgen machen, da diese „erste“ Funktion Ihre *Pfadoperation-Funktion* sein wird und FastAPI weiß, was zu tun ist.
+
+Wenn Sie jedoch `async` / `await` ohne FastAPI verwenden möchten, können Sie dies auch tun.
+
+### Schreiben Sie Ihren eigenen asynchronen Code
+
+Starlette (und **FastAPI**) basiert auf AnyIO, was bedeutet, es ist sowohl kompatibel mit der Python-Standardbibliothek asyncio, als auch mit Trio.
+
+Insbesondere können Sie AnyIO direkt verwenden für Ihre fortgeschritten nebenläufigen und parallelen Anwendungsfälle, die fortgeschrittenere Muster in Ihrem eigenen Code erfordern.
+
+Und selbst wenn Sie FastAPI nicht verwenden würden, könnten Sie auch Ihre eigenen asynchronen Anwendungen mit AnyIO so schreiben, dass sie hoch kompatibel sind und Sie dessen Vorteile nutzen können (z. B. *strukturierte Nebenläufigkeit*).
+
+### Andere Formen von asynchronem Code
+
+Diese Art der Verwendung von `async` und `await` ist in der Sprache relativ neu.
+
+Aber sie erleichtert die Arbeit mit asynchronem Code erheblich.
+
+Die gleiche Syntax (oder fast identisch) wurde kürzlich auch in moderne Versionen von JavaScript (im Browser und in NodeJS) aufgenommen.
+
+Davor war der Umgang mit asynchronem Code jedoch deutlich komplexer und schwieriger.
+
+In früheren Versionen von Python hätten Sie Threads oder Gevent verwenden können. Der Code ist jedoch viel komplexer zu verstehen, zu debuggen und nachzuvollziehen.
+
+In früheren Versionen von NodeJS / Browser JavaScript hätten Sie „Callbacks“ verwendet. Was zur Callback-Hölle führt.
+
+## Coroutinen
+
+**Coroutine** ist nur ein schicker Begriff für dasjenige, was von einer `async def`-Funktion zurückgegeben wird. Python weiß, dass es so etwas wie eine Funktion ist, die es starten kann und die irgendwann endet, aber auch dass sie pausiert ⏸ werden kann, wann immer darin ein `await` steht.
+
+Aber all diese Funktionalität der Verwendung von asynchronem Code mit `async` und `await` wird oft als Verwendung von „Coroutinen“ zusammengefasst. Es ist vergleichbar mit dem Hauptmerkmal von Go, den „Goroutinen“.
+
+## Fazit
+
+Sehen wir uns den gleichen Satz von oben noch mal an:
+
+> Moderne Versionen von Python unterstützen **„asynchronen Code“** unter Verwendung sogenannter **„Coroutinen“** mithilfe der Syntax **`async`** und **`await`**.
+
+Das sollte jetzt mehr Sinn ergeben. ✨
+
+All das ist es, was FastAPI (via Starlette) befeuert und es eine so beeindruckende Performanz haben lässt.
+
+## Sehr technische Details
+
+!!! warning "Achtung"
+ Das folgende können Sie wahrscheinlich überspringen.
+
+ Dies sind sehr technische Details darüber, wie **FastAPI** unter der Haube funktioniert.
+
+ Wenn Sie über gute technische Kenntnisse verfügen (Coroutinen, Threads, Blocking, usw.) und neugierig sind, wie FastAPI mit `async def`s im Vergleich zu normalen `def`s umgeht, fahren Sie fort.
+
+### Pfadoperation-Funktionen
+
+Wenn Sie eine *Pfadoperation-Funktion* mit normalem `def` anstelle von `async def` deklarieren, wird sie in einem externen Threadpool ausgeführt, der dann `await`et wird, anstatt direkt aufgerufen zu werden (da dies den Server blockieren würde).
+
+Wenn Sie von einem anderen asynchronen Framework kommen, das nicht auf die oben beschriebene Weise funktioniert, und Sie es gewohnt sind, triviale, nur-berechnende *Pfadoperation-Funktionen* mit einfachem `def` zu definieren, um einen geringfügigen Geschwindigkeitsgewinn (etwa 100 Nanosekunden) zu erzielen, beachten Sie bitte, dass der Effekt in **FastAPI** genau gegenteilig wäre. In solchen Fällen ist es besser, `async def` zu verwenden, es sei denn, Ihre *Pfadoperation-Funktionen* verwenden Code, der blockierende I/O-Operationen durchführt.
+
+Dennoch besteht in beiden Fällen eine gute Chance, dass **FastAPI** [immer noch schneller](index.md#performanz){.internal-link target=_blank} als Ihr bisheriges Framework (oder zumindest damit vergleichbar) ist.
+
+### Abhängigkeiten
+
+Das Gleiche gilt für [Abhängigkeiten](tutorial/dependencies/index.md){.internal-link target=_blank}. Wenn eine Abhängigkeit eine normale `def`-Funktion ist, anstelle einer `async def`-Funktion, dann wird sie im externen Threadpool ausgeführt.
+
+### Unterabhängigkeiten
+
+Sie können mehrere Abhängigkeiten und [Unterabhängigkeiten](tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} haben, die einander bedingen (als Parameter der Funktionsdefinitionen), einige davon könnten erstellt werden mit `async def` und einige mit normalem `def`. Es würde immer noch funktionieren und diejenigen, die mit normalem `def` erstellt wurden, würden in einem externen Thread (vom Threadpool stammend) aufgerufen werden, anstatt `await`et zu werden.
+
+### Andere Hilfsfunktionen
+
+Jede andere Hilfsfunktion, die Sie direkt aufrufen, kann mit normalem `def` oder `async def` erstellt werden, und FastAPI beeinflusst nicht die Art und Weise, wie Sie sie aufrufen.
+
+Dies steht im Gegensatz zu den Funktionen, die FastAPI für Sie aufruft: *Pfadoperation-Funktionen* und Abhängigkeiten.
+
+Wenn Ihre Hilfsfunktion eine normale Funktion mit `def` ist, wird sie direkt aufgerufen (so wie Sie es in Ihrem Code schreiben), nicht in einem Threadpool. Wenn die Funktion mit `async def` erstellt wurde, sollten Sie sie `await`en, wenn Sie sie in Ihrem Code aufrufen.
+
+---
+
+Nochmal, es handelt sich hier um sehr technische Details, die Ihnen helfen, falls Sie danach gesucht haben.
+
+Andernfalls liegen Sie richtig, wenn Sie sich an die Richtlinien aus dem obigen Abschnitt halten: In Eile?.
diff --git a/docs/de/docs/benchmarks.md b/docs/de/docs/benchmarks.md
new file mode 100644
index 000000000..6efd56e83
--- /dev/null
+++ b/docs/de/docs/benchmarks.md
@@ -0,0 +1,34 @@
+# Benchmarks
+
+Unabhängige TechEmpower-Benchmarks zeigen, **FastAPI**-Anwendungen, die unter Uvicorn ausgeführt werden, gehören zu den schnellsten existierenden Python-Frameworks, nur Starlette und Uvicorn selbst (intern von FastAPI verwendet) sind schneller.
+
+Beim Ansehen von Benchmarks und Vergleichen sollten Sie jedoch Folgende Punkte beachten.
+
+## Benchmarks und Geschwindigkeit
+
+Wenn Sie sich die Benchmarks ansehen, werden häufig mehrere Tools mit unterschiedlichen Eigenschaften als gleichwertig verglichen.
+
+Konkret geht es darum, Uvicorn, Starlette und FastAPI miteinander zu vergleichen (neben vielen anderen Tools).
+
+Je einfacher das Problem, welches durch das Tool gelöst wird, desto besser ist die Performanz. Und die meisten Benchmarks testen nicht die zusätzlichen Funktionen, welche das Tool bietet.
+
+Die Hierarchie ist wie folgt:
+
+* **Uvicorn**: ein ASGI-Server
+ * **Starlette**: (verwendet Uvicorn) ein Web-Mikroframework
+ * **FastAPI**: (verwendet Starlette) ein API-Mikroframework mit mehreren zusätzlichen Funktionen zum Erstellen von APIs, mit Datenvalidierung, usw.
+
+* **Uvicorn**:
+ * Bietet die beste Leistung, da außer dem Server selbst nicht viel zusätzlicher Code vorhanden ist.
+ * Sie würden eine Anwendung nicht direkt in Uvicorn schreiben. Das würde bedeuten, dass Ihr Code zumindest mehr oder weniger den gesamten von Starlette (oder **FastAPI**) bereitgestellten Code enthalten müsste. Und wenn Sie das täten, hätte Ihre endgültige Anwendung den gleichen Overhead wie die Verwendung eines Frameworks nebst Minimierung Ihres Anwendungscodes und der Fehler.
+ * Wenn Sie Uvicorn vergleichen, vergleichen Sie es mit Anwendungsservern wie Daphne, Hypercorn, uWSGI, usw.
+* **Starlette**:
+ * Wird nach Uvicorn die nächstbeste Performanz erbringen. Tatsächlich nutzt Starlette intern Uvicorn. Daher kann es wahrscheinlich nur „langsamer“ als Uvicorn sein, weil mehr Code ausgeführt wird.
+ * Aber es bietet Ihnen die Tools zum Erstellen einfacher Webanwendungen, mit Routing basierend auf Pfaden, usw.
+ * Wenn Sie Starlette vergleichen, vergleichen Sie es mit Webframeworks (oder Mikroframeworks) wie Sanic, Flask, Django, usw.
+* **FastAPI**:
+ * So wie Starlette Uvicorn verwendet und nicht schneller als dieses sein kann, verwendet **FastAPI** Starlette, sodass es nicht schneller als dieses sein kann.
+ * FastAPI bietet zusätzlich zu Starlette weitere Funktionen. Funktionen, die Sie beim Erstellen von APIs fast immer benötigen, wie Datenvalidierung und Serialisierung. Und wenn Sie es verwenden, erhalten Sie kostenlos automatische Dokumentation (die automatische Dokumentation verursacht nicht einmal zusätzlichen Aufwand für laufende Anwendungen, sie wird beim Start generiert).
+ * Wenn Sie FastAPI nicht, und direkt Starlette (oder ein anderes Tool wie Sanic, Flask, Responder, usw.) verwenden würden, müssten Sie die gesamte Datenvalidierung und Serialisierung selbst implementieren. Ihre finale Anwendung hätte also immer noch den gleichen Overhead, als ob sie mit FastAPI erstellt worden wäre. Und in vielen Fällen ist diese Datenvalidierung und Serialisierung der größte Teil des in Anwendungen geschriebenen Codes.
+ * Durch die Verwendung von FastAPI sparen Sie also Entwicklungszeit, Fehler und Codezeilen und würden wahrscheinlich die gleiche Leistung (oder eine bessere) erzielen, die Sie hätten, wenn Sie es nicht verwenden würden (da Sie alles in Ihrem Code implementieren müssten).
+ * Wenn Sie FastAPI vergleichen, vergleichen Sie es mit einem Webanwendung-Framework (oder einer Reihe von Tools), welche Datenvalidierung, Serialisierung und Dokumentation bereitstellen, wie Flask-apispec, NestJS, Molten, usw. – Frameworks mit integrierter automatischer Datenvalidierung, Serialisierung und Dokumentation.
diff --git a/docs/de/docs/contributing.md b/docs/de/docs/contributing.md
new file mode 100644
index 000000000..07a3c9a78
--- /dev/null
+++ b/docs/de/docs/contributing.md
@@ -0,0 +1,447 @@
+# Entwicklung – Mitwirken
+
+Vielleicht möchten Sie sich zuerst die grundlegenden Möglichkeiten anschauen, [FastAPI zu helfen und Hilfe zu erhalten](help-fastapi.md){.internal-link target=_blank}.
+
+## Entwicklung
+
+Wenn Sie das fastapi Repository bereits geklont haben und tief in den Code eintauchen möchten, hier einen Leitfaden zum Einrichten Ihrer Umgebung.
+
+### Virtuelle Umgebung mit `venv`
+
+Sie können mit dem Python-Modul `venv` in einem Verzeichnis eine isolierte virtuelle lokale Umgebung erstellen. Machen wir das im geklonten Repository (da wo sich die `requirements.txt` befindet):
+
+
+
+---
+
+Nachdem wir nun den Unterschied zwischen den Begriffen **Prozess** und **Programm** kennen, sprechen wir weiter über das Deployment.
+
+## Beim Hochfahren ausführen
+
+Wenn Sie eine Web-API erstellen, möchten Sie in den meisten Fällen, dass diese **immer läuft**, ununterbrochen, damit Ihre Clients immer darauf zugreifen können. Es sei denn natürlich, Sie haben einen bestimmten Grund, warum Sie möchten, dass diese nur in bestimmten Situationen ausgeführt wird. Meistens möchten Sie jedoch, dass sie ständig ausgeführt wird und **verfügbar** ist.
+
+### Auf einem entfernten Server
+
+Wenn Sie einen entfernten Server (einen Cloud-Server, eine virtuelle Maschine, usw.) einrichten, können Sie am einfachsten Uvicorn (oder ähnliches) manuell ausführen, genau wie bei der lokalen Entwicklung.
+
+Und es wird funktionieren und **während der Entwicklung** nützlich sein.
+
+Wenn Ihre Verbindung zum Server jedoch unterbrochen wird, wird der **laufende Prozess** wahrscheinlich abstürzen.
+
+Und wenn der Server neu gestartet wird (z. B. nach Updates oder Migrationen vom Cloud-Anbieter), werden Sie das wahrscheinlich **nicht bemerken**. Und deshalb wissen Sie nicht einmal, dass Sie den Prozess manuell neu starten müssen. Ihre API bleibt also einfach tot. 😱
+
+### Beim Hochfahren automatisch ausführen
+
+Im Allgemeinen möchten Sie wahrscheinlich, dass das Serverprogramm (z. B. Uvicorn) beim Hochfahren des Servers automatisch gestartet wird und kein **menschliches Eingreifen** erforderlich ist, sodass immer ein Prozess mit Ihrer API ausgeführt wird (z. B. Uvicorn, welches Ihre FastAPI-Anwendung ausführt).
+
+### Separates Programm
+
+Um dies zu erreichen, haben Sie normalerweise ein **separates Programm**, welches sicherstellt, dass Ihre Anwendung beim Hochfahren ausgeführt wird. Und in vielen Fällen würde es auch sicherstellen, dass auch andere Komponenten oder Anwendungen ausgeführt werden, beispielsweise eine Datenbank.
+
+### Beispieltools zur Ausführung beim Hochfahren
+
+Einige Beispiele für Tools, die diese Aufgabe übernehmen können, sind:
+
+* Docker
+* Kubernetes
+* Docker Compose
+* Docker im Schwarm-Modus
+* Systemd
+* Supervisor
+* Es wird intern von einem Cloud-Anbieter im Rahmen seiner Dienste verwaltet
+* Andere ...
+
+In den nächsten Kapiteln werde ich Ihnen konkretere Beispiele geben.
+
+## Neustart
+
+Ähnlich wie Sie sicherstellen möchten, dass Ihre Anwendung beim Hochfahren ausgeführt wird, möchten Sie wahrscheinlich auch sicherstellen, dass diese nach Fehlern **neu gestartet** wird.
+
+### Wir machen Fehler
+
+Wir, als Menschen, machen ständig **Fehler**. Software hat fast *immer* **Bugs**, die an verschiedenen Stellen versteckt sind. 🐛
+
+Und wir als Entwickler verbessern den Code ständig, wenn wir diese Bugs finden und neue Funktionen implementieren (und möglicherweise auch neue Bugs hinzufügen 😅).
+
+### Kleine Fehler automatisch handhaben
+
+Wenn beim Erstellen von Web-APIs mit FastAPI ein Fehler in unserem Code auftritt, wird FastAPI ihn normalerweise dem einzelnen Request zurückgeben, der den Fehler ausgelöst hat. 🛡
+
+Der Client erhält für diesen Request einen **500 Internal Server Error**, aber die Anwendung arbeitet bei den nächsten Requests weiter, anstatt einfach komplett abzustürzen.
+
+### Größere Fehler – Abstürze
+
+Dennoch kann es vorkommen, dass wir Code schreiben, der **die gesamte Anwendung zum Absturz bringt** und so zum Absturz von Uvicorn und Python führt. 💥
+
+Und dennoch möchten Sie wahrscheinlich nicht, dass die Anwendung tot bleibt, weil an einer Stelle ein Fehler aufgetreten ist. Sie möchten wahrscheinlich, dass sie zumindest für die *Pfadoperationen*, die nicht fehlerhaft sind, **weiterläuft**.
+
+### Neustart nach Absturz
+
+Aber in den Fällen mit wirklich schwerwiegenden Fehlern, die den laufenden **Prozess** zum Absturz bringen, benötigen Sie eine externe Komponente, die den Prozess **neu startet**, zumindest ein paar Mal ...
+
+!!! tip "Tipp"
+ ... Obwohl es wahrscheinlich keinen Sinn macht, sie immer wieder neu zu starten, wenn die gesamte Anwendung einfach **sofort abstürzt**. Aber in diesen Fällen werden Sie es wahrscheinlich während der Entwicklung oder zumindest direkt nach dem Deployment bemerken.
+
+ Konzentrieren wir uns also auf die Hauptfälle, in denen die Anwendung in bestimmten Fällen **in der Zukunft** völlig abstürzen könnte und es dann dennoch sinnvoll ist, sie neu zu starten.
+
+Sie möchten wahrscheinlich, dass eine **externe Komponente** für den Neustart Ihrer Anwendung verantwortlich ist, da zu diesem Zeitpunkt dieselbe Anwendung mit Uvicorn und Python bereits abgestürzt ist und es daher nichts im selben Code derselben Anwendung gibt, was etwas dagegen tun kann.
+
+### Beispieltools zum automatischen Neustart
+
+In den meisten Fällen wird dasselbe Tool, das zum **Ausführen des Programms beim Hochfahren** verwendet wird, auch für automatische **Neustarts** verwendet.
+
+Dies könnte zum Beispiel erledigt werden durch:
+
+* Docker
+* Kubernetes
+* Docker Compose
+* Docker im Schwarm-Modus
+* Systemd
+* Supervisor
+* Intern von einem Cloud-Anbieter im Rahmen seiner Dienste
+* Andere ...
+
+## Replikation – Prozesse und Arbeitsspeicher
+
+Wenn Sie eine FastAPI-Anwendung verwenden und ein Serverprogramm wie Uvicorn verwenden, kann **ein einzelner Prozess** mehrere Clients gleichzeitig bedienen.
+
+In vielen Fällen möchten Sie jedoch mehrere Prozesse gleichzeitig ausführen.
+
+### Mehrere Prozesse – Worker
+
+Wenn Sie mehr Clients haben, als ein einzelner Prozess verarbeiten kann (z. B. wenn die virtuelle Maschine nicht sehr groß ist) und die CPU des Servers **mehrere Kerne** hat, dann könnten **mehrere Prozesse** gleichzeitig mit derselben Anwendung laufen und alle Requests unter sich verteilen.
+
+Wenn Sie mit **mehreren Prozessen** dasselbe API-Programm ausführen, werden diese üblicherweise als **Worker** bezeichnet.
+
+### Workerprozesse und Ports
+
+Erinnern Sie sich aus der Dokumentation [Über HTTPS](https.md){.internal-link target=_blank}, dass nur ein Prozess auf einer Kombination aus Port und IP-Adresse auf einem Server lauschen kann?
+
+Das ist immer noch wahr.
+
+Um also **mehrere Prozesse** gleichzeitig zu haben, muss es einen **einzelnen Prozess geben, der einen Port überwacht**, welcher dann die Kommunikation auf irgendeine Weise an jeden Workerprozess überträgt.
+
+### Arbeitsspeicher pro Prozess
+
+Wenn das Programm nun Dinge in den Arbeitsspeicher lädt, zum Beispiel ein Modell für maschinelles Lernen in einer Variablen oder den Inhalt einer großen Datei in einer Variablen, verbraucht das alles **einen Teil des Arbeitsspeichers (RAM – Random Access Memory)** des Servers.
+
+Und mehrere Prozesse teilen sich normalerweise keinen Speicher. Das bedeutet, dass jeder laufende Prozess seine eigenen Dinge, eigenen Variablen und eigenen Speicher hat. Und wenn Sie in Ihrem Code viel Speicher verbrauchen, verbraucht **jeder Prozess** die gleiche Menge Speicher.
+
+### Serverspeicher
+
+Wenn Ihr Code beispielsweise ein Machine-Learning-Modell mit **1 GB Größe** lädt und Sie einen Prozess mit Ihrer API ausführen, verbraucht dieser mindestens 1 GB RAM. Und wenn Sie **4 Prozesse** (4 Worker) starten, verbraucht jeder 1 GB RAM. Insgesamt verbraucht Ihre API also **4 GB RAM**.
+
+Und wenn Ihr entfernter Server oder Ihre virtuelle Maschine nur über 3 GB RAM verfügt, führt der Versuch, mehr als 4 GB RAM zu laden, zu Problemen. 🚨
+
+### Mehrere Prozesse – Ein Beispiel
+
+Im folgenden Beispiel gibt es einen **Manager-Prozess**, welcher zwei **Workerprozesse** startet und steuert.
+
+Dieser Manager-Prozess wäre wahrscheinlich derjenige, welcher der IP am **Port** lauscht. Und er würde die gesamte Kommunikation an die Workerprozesse weiterleiten.
+
+Diese Workerprozesse würden Ihre Anwendung ausführen, sie würden die Hauptberechnungen durchführen, um einen **Request** entgegenzunehmen und eine **Response** zurückzugeben, und sie würden alles, was Sie in Variablen einfügen, in den RAM laden.
+
++ +**FastAPI** würde ohne die frühere Arbeit anderer nicht existieren. + +Es wurden zuvor viele Tools entwickelt, die als Inspiration für seine Entwicklung dienten. + +Ich habe die Schaffung eines neuen Frameworks viele Jahre lang vermieden. Zuerst habe ich versucht, alle von **FastAPI** abgedeckten Funktionen mithilfe vieler verschiedener Frameworks, Plugins und Tools zu lösen. + +Aber irgendwann gab es keine andere Möglichkeit, als etwas zu schaffen, das all diese Funktionen bereitstellte, die besten Ideen früherer Tools aufnahm und diese auf die bestmögliche Weise kombinierte, wobei Sprachfunktionen verwendet wurden, die vorher noch nicht einmal verfügbar waren (Python 3.6+ Typhinweise). + ++ +## Investigation + +Durch die Nutzung all dieser vorherigen Alternativen hatte ich die Möglichkeit, von allen zu lernen, Ideen aufzunehmen und sie auf die beste Weise zu kombinieren, die ich für mich und die Entwicklerteams, mit denen ich zusammengearbeitet habe, finden konnte. + +Es war beispielsweise klar, dass es idealerweise auf Standard-Python-Typhinweisen basieren sollte. + +Der beste Ansatz bestand außerdem darin, bereits bestehende Standards zu nutzen. + +Bevor ich also überhaupt angefangen habe, **FastAPI** zu schreiben, habe ich mehrere Monate damit verbracht, die Spezifikationen für OpenAPI, JSON Schema, OAuth2, usw. zu studieren und deren Beziehungen, Überschneidungen und Unterschiede zu verstehen. + +## Design + +Dann habe ich einige Zeit damit verbracht, die Entwickler-„API“ zu entwerfen, die ich als Benutzer haben wollte (als Entwickler, welcher FastAPI verwendet). + +Ich habe mehrere Ideen in den beliebtesten Python-Editoren getestet: PyCharm, VS Code, Jedi-basierte Editoren. + +Laut der letzten Python-Entwickler-Umfrage, deckt das etwa 80 % der Benutzer ab. + +Das bedeutet, dass **FastAPI** speziell mit den Editoren getestet wurde, die von 80 % der Python-Entwickler verwendet werden. Und da die meisten anderen Editoren in der Regel ähnlich funktionieren, sollten alle diese Vorteile für praktisch alle Editoren funktionieren. + +Auf diese Weise konnte ich die besten Möglichkeiten finden, die Codeverdoppelung so weit wie möglich zu reduzieren, überall Autovervollständigung, Typ- und Fehlerprüfungen, usw. zu gewährleisten. + +Alles auf eine Weise, die allen Entwicklern das beste Entwicklungserlebnis bot. + +## Anforderungen + +Nachdem ich mehrere Alternativen getestet hatte, entschied ich, dass ich **Pydantic** wegen seiner Vorteile verwenden würde. + +Dann habe ich zu dessen Code beigetragen, um es vollständig mit JSON Schema kompatibel zu machen, und so verschiedene Möglichkeiten zum Definieren von einschränkenden Deklarationen (Constraints) zu unterstützen, und die Editorunterstützung (Typprüfungen, Codevervollständigung) zu verbessern, basierend auf den Tests in mehreren Editoren. + +Während der Entwicklung habe ich auch zu **Starlette** beigetragen, der anderen Schlüsselanforderung. + +## Entwicklung + +Als ich mit der Erstellung von **FastAPI** selbst begann, waren die meisten Teile bereits vorhanden, das Design definiert, die Anforderungen und Tools bereit und das Wissen über die Standards und Spezifikationen klar und frisch. + +## Zukunft + +Zu diesem Zeitpunkt ist bereits klar, dass **FastAPI** mit seinen Ideen für viele Menschen nützlich ist. + +Es wird gegenüber früheren Alternativen gewählt, da es für viele Anwendungsfälle besser geeignet ist. + +Viele Entwickler und Teams verlassen sich bei ihren Projekten bereits auf **FastAPI** (einschließlich mir und meinem Team). + +Dennoch stehen uns noch viele Verbesserungen und Funktionen bevor. + +**FastAPI** hat eine große Zukunft vor sich. + +Und [Ihre Hilfe](help-fastapi.md){.internal-link target=_blank} wird sehr geschätzt. diff --git a/docs/de/docs/how-to/conditional-openapi.md b/docs/de/docs/how-to/conditional-openapi.md new file mode 100644 index 000000000..7f277bb88 --- /dev/null +++ b/docs/de/docs/how-to/conditional-openapi.md @@ -0,0 +1,58 @@ +# Bedingte OpenAPI + +Bei Bedarf können Sie OpenAPI mithilfe von Einstellungen und Umgebungsvariablen abhängig von der Umgebung bedingt konfigurieren und sogar vollständig deaktivieren. + +## Über Sicherheit, APIs und Dokumentation + +Das Verstecken Ihrer Dokumentationsoberflächen in der Produktion *sollte nicht* die Methode sein, Ihre API zu schützen. + +Dadurch wird Ihrer API keine zusätzliche Sicherheit hinzugefügt, die *Pfadoperationen* sind weiterhin dort verfügbar, wo sie sich befinden. + +Wenn Ihr Code eine Sicherheitslücke aufweist, ist diese weiterhin vorhanden. + +Das Verstecken der Dokumentation macht es nur schwieriger zu verstehen, wie mit Ihrer API interagiert werden kann, und könnte es auch schwieriger machen, diese in der Produktion zu debuggen. Man könnte es einfach als eine Form von Security through obscurity betrachten. + +Wenn Sie Ihre API sichern möchten, gibt es mehrere bessere Dinge, die Sie tun können, zum Beispiel: + +* Stellen Sie sicher, dass Sie über gut definierte Pydantic-Modelle für Ihre Requestbodys und Responses verfügen. +* Konfigurieren Sie alle erforderlichen Berechtigungen und Rollen mithilfe von Abhängigkeiten. +* Speichern Sie niemals Klartext-Passwörter, sondern nur Passwort-Hashes. +* Implementieren und verwenden Sie gängige kryptografische Tools wie Passlib und JWT-Tokens, usw. +* Fügen Sie bei Bedarf detailliertere Berechtigungskontrollen mit OAuth2-Scopes hinzu. +* ... usw. + +Dennoch kann es sein, dass Sie einen ganz bestimmten Anwendungsfall haben, bei dem Sie die API-Dokumentation für eine bestimmte Umgebung (z. B. für die Produktion) oder abhängig von Konfigurationen aus Umgebungsvariablen wirklich deaktivieren müssen. + +## Bedingte OpenAPI aus Einstellungen und Umgebungsvariablen + +Sie können problemlos dieselben Pydantic-Einstellungen verwenden, um Ihre generierte OpenAPI und die Dokumentationsoberflächen zu konfigurieren. + +Zum Beispiel: + +```Python hl_lines="6 11" +{!../../../docs_src/conditional_openapi/tutorial001.py!} +``` + +Hier deklarieren wir die Einstellung `openapi_url` mit dem gleichen Defaultwert `"/openapi.json"`. + +Und dann verwenden wir das beim Erstellen der `FastAPI`-App. + +Dann könnten Sie OpenAPI (einschließlich der Dokumentationsoberflächen) deaktivieren, indem Sie die Umgebungsvariable `OPENAPI_URL` auf einen leeren String setzen, wie zum Beispiel: + +
+
+Sie können sie jedoch deaktivieren, indem Sie `syntaxHighlight` auf `False` setzen:
+
+```Python hl_lines="3"
+{!../../../docs_src/configure_swagger_ui/tutorial001.py!}
+```
+
+... und dann zeigt die Swagger-Oberfläche die Syntaxhervorhebung nicht mehr an:
+
+
+
+## Das Theme ändern
+
+Auf die gleiche Weise könnten Sie das Theme der Syntaxhervorhebung mit dem Schlüssel `syntaxHighlight.theme` festlegen (beachten Sie, dass er einen Punkt in der Mitte hat):
+
+```Python hl_lines="3"
+{!../../../docs_src/configure_swagger_ui/tutorial002.py!}
+```
+
+Obige Konfiguration würde das Theme für die Farbe der Syntaxhervorhebung ändern:
+
+
+
+## Defaultparameter der Swagger-Oberfläche ändern
+
+FastAPI enthält einige Defaultkonfigurationsparameter, die für die meisten Anwendungsfälle geeignet sind.
+
+Es umfasst die folgenden Defaultkonfigurationen:
+
+```Python
+{!../../../fastapi/openapi/docs.py[ln:7-23]!}
+```
+
+Sie können jede davon überschreiben, indem Sie im Argument `swagger_ui_parameters` einen anderen Wert festlegen.
+
+Um beispielsweise `deepLinking` zu deaktivieren, könnten Sie folgende Einstellungen an `swagger_ui_parameters` übergeben:
+
+```Python hl_lines="3"
+{!../../../docs_src/configure_swagger_ui/tutorial003.py!}
+```
+
+## Andere Parameter der Swagger-Oberfläche
+
+Um alle anderen möglichen Konfigurationen zu sehen, die Sie verwenden können, lesen Sie die offizielle Dokumentation für die Parameter der Swagger-Oberfläche.
+
+## JavaScript-basierte Einstellungen
+
+Die Swagger-Oberfläche erlaubt, dass andere Konfigurationen auch **JavaScript**-Objekte sein können (z. B. JavaScript-Funktionen).
+
+FastAPI umfasst auch diese Nur-JavaScript-`presets`-Einstellungen:
+
+```JavaScript
+presets: [
+ SwaggerUIBundle.presets.apis,
+ SwaggerUIBundle.SwaggerUIStandalonePreset
+]
+```
+
+Dabei handelt es sich um **JavaScript**-Objekte, nicht um Strings, daher können Sie diese nicht direkt vom Python-Code aus übergeben.
+
+Wenn Sie solche JavaScript-Konfigurationen verwenden müssen, können Sie einen der früher genannten Wege verwenden. Überschreiben Sie alle *Pfadoperationen* der Swagger-Oberfläche und schreiben Sie manuell jedes benötigte JavaScript.
diff --git a/docs/de/docs/how-to/custom-docs-ui-assets.md b/docs/de/docs/how-to/custom-docs-ui-assets.md
new file mode 100644
index 000000000..991eaf269
--- /dev/null
+++ b/docs/de/docs/how-to/custom-docs-ui-assets.md
@@ -0,0 +1,199 @@
+# Statische Assets der Dokumentationsoberfläche (selbst hosten)
+
+Die API-Dokumentation verwendet **Swagger UI** und **ReDoc**, und jede dieser Dokumentationen benötigt einige JavaScript- und CSS-Dateien.
+
+Standardmäßig werden diese Dateien von einem CDN bereitgestellt.
+
+Es ist jedoch möglich, das anzupassen, ein bestimmtes CDN festzulegen oder die Dateien selbst bereitzustellen.
+
+## Benutzerdefiniertes CDN für JavaScript und CSS
+
+Nehmen wir an, Sie möchten ein anderes CDN verwenden, zum Beispiel möchten Sie `https://unpkg.com/` verwenden.
+
+Das kann nützlich sein, wenn Sie beispielsweise in einem Land leben, in dem bestimmte URLs eingeschränkt sind.
+
+### Die automatischen Dokumentationen deaktivieren
+
+Der erste Schritt besteht darin, die automatischen Dokumentationen zu deaktivieren, da diese standardmäßig das Standard-CDN verwenden.
+
+Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`:
+
+```Python hl_lines="8"
+{!../../../docs_src/custom_docs_ui/tutorial001.py!}
+```
+
+### Die benutzerdefinierten Dokumentationen hinzufügen
+
+Jetzt können Sie die *Pfadoperationen* für die benutzerdefinierten Dokumentationen erstellen.
+
+Sie können die internen Funktionen von FastAPI wiederverwenden, um die HTML-Seiten für die Dokumentation zu erstellen und ihnen die erforderlichen Argumente zu übergeben:
+
+* `openapi_url`: die URL, unter welcher die HTML-Seite für die Dokumentation das OpenAPI-Schema für Ihre API abrufen kann. Sie können hier das Attribut `app.openapi_url` verwenden.
+* `title`: der Titel Ihrer API.
+* `oauth2_redirect_url`: Sie können hier `app.swagger_ui_oauth2_redirect_url` verwenden, um die Standardeinstellung zu verwenden.
+* `swagger_js_url`: die URL, unter welcher der HTML-Code für Ihre Swagger-UI-Dokumentation die **JavaScript**-Datei abrufen kann. Dies ist die benutzerdefinierte CDN-URL.
+* `swagger_css_url`: die URL, unter welcher der HTML-Code für Ihre Swagger-UI-Dokumentation die **CSS**-Datei abrufen kann. Dies ist die benutzerdefinierte CDN-URL.
+
+Und genau so für ReDoc ...
+
+```Python hl_lines="2-6 11-19 22-24 27-33"
+{!../../../docs_src/custom_docs_ui/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Die *Pfadoperation* für `swagger_ui_redirect` ist ein Hilfsmittel bei der Verwendung von OAuth2.
+
+ Wenn Sie Ihre API mit einem OAuth2-Anbieter integrieren, können Sie sich authentifizieren und mit den erworbenen Anmeldeinformationen zur API-Dokumentation zurückkehren. Und mit ihr interagieren, die echte OAuth2-Authentifizierung verwendend.
+
+ Swagger UI erledigt das hinter den Kulissen für Sie, benötigt aber diesen „Umleitungs“-Helfer.
+
+### Eine *Pfadoperation* erstellen, um es zu testen
+
+Um nun testen zu können, ob alles funktioniert, erstellen Sie eine *Pfadoperation*:
+
+```Python hl_lines="36-38"
+{!../../../docs_src/custom_docs_ui/tutorial001.py!}
+```
+
+### Es ausprobieren
+
+Jetzt sollten Sie in der Lage sein, zu Ihrer Dokumentation auf http://127.0.0.1:8000/docs zu gehen und die Seite neu zuladen, die Assets werden nun vom neuen CDN geladen.
+
+## JavaScript und CSS für die Dokumentation selbst hosten
+
+Das Selbst Hosten von JavaScript und CSS kann nützlich sein, wenn Sie beispielsweise möchten, dass Ihre Anwendung auch offline, ohne bestehenden Internetzugang oder in einem lokalen Netzwerk weiter funktioniert.
+
+Hier erfahren Sie, wie Sie diese Dateien selbst in derselben FastAPI-App bereitstellen und die Dokumentation für deren Verwendung konfigurieren.
+
+### Projektdateistruktur
+
+Nehmen wir an, die Dateistruktur Ihres Projekts sieht folgendermaßen aus:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+```
+
+Erstellen Sie jetzt ein Verzeichnis zum Speichern dieser statischen Dateien.
+
+Ihre neue Dateistruktur könnte so aussehen:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+└── static/
+```
+
+### Die Dateien herunterladen
+
+Laden Sie die für die Dokumentation benötigten statischen Dateien herunter und legen Sie diese im Verzeichnis `static/` ab.
+
+Sie können wahrscheinlich mit der rechten Maustaste auf jeden Link klicken und eine Option wie etwa `Link speichern unter...` auswählen.
+
+**Swagger UI** verwendet folgende Dateien:
+
+* `swagger-ui-bundle.js`
+* `swagger-ui.css`
+
+Und **ReDoc** verwendet diese Datei:
+
+* `redoc.standalone.js`
+
+Danach könnte Ihre Dateistruktur wie folgt aussehen:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+└── static
+ ├── redoc.standalone.js
+ ├── swagger-ui-bundle.js
+ └── swagger-ui.css
+```
+
+### Die statischen Dateien bereitstellen
+
+* Importieren Sie `StaticFiles`.
+* „Mounten“ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad.
+
+```Python hl_lines="7 11"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+### Die statischen Dateien testen
+
+Starten Sie Ihre Anwendung und gehen Sie auf http://127.0.0.1:8000/static/redoc.standalone.js.
+
+Sie sollten eine sehr lange JavaScript-Datei für **ReDoc** sehen.
+
+Sie könnte beginnen mit etwas wie:
+
+```JavaScript
+/*!
+ * ReDoc - OpenAPI/Swagger-generated API Reference Documentation
+ * -------------------------------------------------------------
+ * Version: "2.0.0-rc.18"
+ * Repo: https://github.com/Redocly/redoc
+ */
+!function(e,t){"object"==typeof exports&&"object"==typeof m
+
+...
+```
+
+Das zeigt, dass Sie statische Dateien aus Ihrer Anwendung bereitstellen können und dass Sie die statischen Dateien für die Dokumentation an der richtigen Stelle platziert haben.
+
+Jetzt können wir die Anwendung so konfigurieren, dass sie diese statischen Dateien für die Dokumentation verwendet.
+
+### Die automatischen Dokumentationen deaktivieren, für statische Dateien
+
+Wie bei der Verwendung eines benutzerdefinierten CDN besteht der erste Schritt darin, die automatischen Dokumentationen zu deaktivieren, da diese standardmäßig das CDN verwenden.
+
+Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`:
+
+```Python hl_lines="9"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+### Die benutzerdefinierten Dokumentationen, mit statischen Dateien, hinzufügen
+
+Und genau wie bei einem benutzerdefinierten CDN können Sie jetzt die *Pfadoperationen* für die benutzerdefinierten Dokumentationen erstellen.
+
+Auch hier können Sie die internen Funktionen von FastAPI wiederverwenden, um die HTML-Seiten für die Dokumentationen zu erstellen, und diesen die erforderlichen Argumente übergeben:
+
+* `openapi_url`: die URL, unter der die HTML-Seite für die Dokumentation das OpenAPI-Schema für Ihre API abrufen kann. Sie können hier das Attribut `app.openapi_url` verwenden.
+* `title`: der Titel Ihrer API.
+* `oauth2_redirect_url`: Sie können hier `app.swagger_ui_oauth2_redirect_url` verwenden, um die Standardeinstellung zu verwenden.
+* `swagger_js_url`: die URL, unter welcher der HTML-Code für Ihre Swagger-UI-Dokumentation die **JavaScript**-Datei abrufen kann. **Das ist die, welche jetzt von Ihrer eigenen Anwendung bereitgestellt wird**.
+* `swagger_css_url`: die URL, unter welcher der HTML-Code für Ihre Swagger-UI-Dokumentation die **CSS**-Datei abrufen kann. **Das ist die, welche jetzt von Ihrer eigenen Anwendung bereitgestellt wird**.
+
+Und genau so für ReDoc ...
+
+```Python hl_lines="2-6 14-22 25-27 30-36"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+!!! tip "Tipp"
+ Die *Pfadoperation* für `swagger_ui_redirect` ist ein Hilfsmittel bei der Verwendung von OAuth2.
+
+ Wenn Sie Ihre API mit einem OAuth2-Anbieter integrieren, können Sie sich authentifizieren und mit den erworbenen Anmeldeinformationen zur API-Dokumentation zurückkehren. Und mit ihr interagieren, die echte OAuth2-Authentifizierung verwendend.
+
+ Swagger UI erledigt das hinter den Kulissen für Sie, benötigt aber diesen „Umleitungs“-Helfer.
+
+### Eine *Pfadoperation* erstellen, um statische Dateien zu testen
+
+Um nun testen zu können, ob alles funktioniert, erstellen Sie eine *Pfadoperation*:
+
+```Python hl_lines="39-41"
+{!../../../docs_src/custom_docs_ui/tutorial002.py!}
+```
+
+### Benutzeroberfläche, mit statischen Dateien, testen
+
+Jetzt sollten Sie in der Lage sein, Ihr WLAN zu trennen, gehen Sie zu Ihrer Dokumentation unter http://127.0.0.1:8000/docs und laden Sie die Seite neu.
+
+Und selbst ohne Internet könnten Sie die Dokumentation für Ihre API sehen und damit interagieren.
diff --git a/docs/de/docs/how-to/custom-request-and-route.md b/docs/de/docs/how-to/custom-request-and-route.md
new file mode 100644
index 000000000..b51a20bfc
--- /dev/null
+++ b/docs/de/docs/how-to/custom-request-and-route.md
@@ -0,0 +1,109 @@
+# Benutzerdefinierte Request- und APIRoute-Klasse
+
+In einigen Fällen möchten Sie möglicherweise die von den Klassen `Request` und `APIRoute` verwendete Logik überschreiben.
+
+Das kann insbesondere eine gute Alternative zur Logik in einer Middleware sein.
+
+Wenn Sie beispielsweise den Requestbody lesen oder manipulieren möchten, bevor er von Ihrer Anwendung verarbeitet wird.
+
+!!! danger "Gefahr"
+ Dies ist eine „fortgeschrittene“ Funktion.
+
+ Wenn Sie gerade erst mit **FastAPI** beginnen, möchten Sie diesen Abschnitt vielleicht überspringen.
+
+## Anwendungsfälle
+
+Einige Anwendungsfälle sind:
+
+* Konvertieren von Nicht-JSON-Requestbodys nach JSON (z. B. `msgpack`).
+* Dekomprimierung gzip-komprimierter Requestbodys.
+* Automatisches Loggen aller Requestbodys.
+
+## Handhaben von benutzerdefinierten Requestbody-Kodierungen
+
+Sehen wir uns an, wie Sie eine benutzerdefinierte `Request`-Unterklasse verwenden, um gzip-Requests zu dekomprimieren.
+
+Und eine `APIRoute`-Unterklasse zur Verwendung dieser benutzerdefinierten Requestklasse.
+
+### Eine benutzerdefinierte `GzipRequest`-Klasse erstellen
+
+!!! tip "Tipp"
+ Dies ist nur ein einfaches Beispiel, um zu demonstrieren, wie es funktioniert. Wenn Sie Gzip-Unterstützung benötigen, können Sie die bereitgestellte [`GzipMiddleware`](../advanced/middleware.md#gzipmiddleware){.internal-link target=_blank} verwenden.
+
+Zuerst erstellen wir eine `GzipRequest`-Klasse, welche die Methode `Request.body()` überschreibt, um den Body bei Vorhandensein eines entsprechenden Headers zu dekomprimieren.
+
+Wenn der Header kein `gzip` enthält, wird nicht versucht, den Body zu dekomprimieren.
+
+Auf diese Weise kann dieselbe Routenklasse gzip-komprimierte oder unkomprimierte Requests verarbeiten.
+
+```Python hl_lines="8-15"
+{!../../../docs_src/custom_request_and_route/tutorial001.py!}
+```
+
+### Eine benutzerdefinierte `GzipRoute`-Klasse erstellen
+
+Als Nächstes erstellen wir eine benutzerdefinierte Unterklasse von `fastapi.routing.APIRoute`, welche `GzipRequest` nutzt.
+
+Dieses Mal wird die Methode `APIRoute.get_route_handler()` überschrieben.
+
+Diese Methode gibt eine Funktion zurück. Und diese Funktion empfängt einen Request und gibt eine Response zurück.
+
+Hier verwenden wir sie, um aus dem ursprünglichen Request einen `GzipRequest` zu erstellen.
+
+```Python hl_lines="18-26"
+{!../../../docs_src/custom_request_and_route/tutorial001.py!}
+```
+
+!!! note "Technische Details"
+ Ein `Request` hat ein `request.scope`-Attribut, welches einfach ein Python-`dict` ist, welches die mit dem Request verbundenen Metadaten enthält.
+
+ Ein `Request` hat auch ein `request.receive`, welches eine Funktion ist, die den Hauptteil des Requests empfängt.
+
+ Das `scope`-`dict` und die `receive`-Funktion sind beide Teil der ASGI-Spezifikation.
+
+ Und diese beiden Dinge, `scope` und `receive`, werden benötigt, um eine neue `Request`-Instanz zu erstellen.
+
+ Um mehr über den `Request` zu erfahren, schauen Sie sich Starlettes Dokumentation zu Requests an.
+
+Das Einzige, was die von `GzipRequest.get_route_handler` zurückgegebene Funktion anders macht, ist die Konvertierung von `Request` in ein `GzipRequest`.
+
+Dabei kümmert sich unser `GzipRequest` um die Dekomprimierung der Daten (falls erforderlich), bevor diese an unsere *Pfadoperationen* weitergegeben werden.
+
+Danach ist die gesamte Verarbeitungslogik dieselbe.
+
+Aufgrund unserer Änderungen in `GzipRequest.body` wird der Requestbody jedoch bei Bedarf automatisch dekomprimiert, wenn er von **FastAPI** geladen wird.
+
+## Zugriff auf den Requestbody in einem Exceptionhandler
+
+!!! tip "Tipp"
+ Um dasselbe Problem zu lösen, ist es wahrscheinlich viel einfacher, den `body` in einem benutzerdefinierten Handler für `RequestValidationError` zu verwenden ([Fehlerbehandlung](../tutorial/handling-errors.md#den-requestvalidationerror-body-verwenden){.internal-link target=_blank}).
+
+ Dieses Beispiel ist jedoch immer noch gültig und zeigt, wie mit den internen Komponenten interagiert wird.
+
+Wir können denselben Ansatz auch verwenden, um in einem Exceptionhandler auf den Requestbody zuzugreifen.
+
+Alles, was wir tun müssen, ist, den Request innerhalb eines `try`/`except`-Blocks zu handhaben:
+
+```Python hl_lines="13 15"
+{!../../../docs_src/custom_request_and_route/tutorial002.py!}
+```
+
+Wenn eine Exception auftritt, befindet sich die `Request`-Instanz weiterhin im Gültigkeitsbereich, sodass wir den Requestbody lesen und bei der Fehlerbehandlung verwenden können:
+
+```Python hl_lines="16-18"
+{!../../../docs_src/custom_request_and_route/tutorial002.py!}
+```
+
+## Benutzerdefinierte `APIRoute`-Klasse in einem Router
+
+Sie können auch den Parameter `route_class` eines `APIRouter` festlegen:
+
+```Python hl_lines="26"
+{!../../../docs_src/custom_request_and_route/tutorial003.py!}
+```
+
+In diesem Beispiel verwenden die *Pfadoperationen* unter dem `router` die benutzerdefinierte `TimedRoute`-Klasse und haben in der Response einen zusätzlichen `X-Response-Time`-Header mit der Zeit, die zum Generieren der Response benötigt wurde:
+
+```Python hl_lines="13-20"
+{!../../../docs_src/custom_request_and_route/tutorial003.py!}
+```
diff --git a/docs/de/docs/how-to/extending-openapi.md b/docs/de/docs/how-to/extending-openapi.md
new file mode 100644
index 000000000..2fbfa13e5
--- /dev/null
+++ b/docs/de/docs/how-to/extending-openapi.md
@@ -0,0 +1,87 @@
+# OpenAPI erweitern
+
+In einigen Fällen müssen Sie möglicherweise das generierte OpenAPI-Schema ändern.
+
+In diesem Abschnitt erfahren Sie, wie.
+
+## Der normale Vorgang
+
+Der normale (Standard-)Prozess ist wie folgt.
+
+Eine `FastAPI`-Anwendung (-Instanz) verfügt über eine `.openapi()`-Methode, von der erwartet wird, dass sie das OpenAPI-Schema zurückgibt.
+
+Als Teil der Erstellung des Anwendungsobjekts wird eine *Pfadoperation* für `/openapi.json` (oder welcher Wert für den Parameter `openapi_url` gesetzt wurde) registriert.
+
+Diese gibt lediglich eine JSON-Response zurück, mit dem Ergebnis der Methode `.openapi()` der Anwendung.
+
+Standardmäßig überprüft die Methode `.openapi()` die Eigenschaft `.openapi_schema`, um zu sehen, ob diese Inhalt hat, und gibt diesen zurück.
+
+Ist das nicht der Fall, wird der Inhalt mithilfe der Hilfsfunktion unter `fastapi.openapi.utils.get_openapi` generiert.
+
+Und diese Funktion `get_openapi()` erhält als Parameter:
+
+* `title`: Der OpenAPI-Titel, der in der Dokumentation angezeigt wird.
+* `version`: Die Version Ihrer API, z. B. `2.5.0`.
+* `openapi_version`: Die Version der verwendeten OpenAPI-Spezifikation. Standardmäßig die neueste Version: `3.1.0`.
+* `summary`: Eine kurze Zusammenfassung der API.
+* `description`: Die Beschreibung Ihrer API. Dies kann Markdown enthalten und wird in der Dokumentation angezeigt.
+* `routes`: Eine Liste von Routen, dies sind alle registrierten *Pfadoperationen*. Sie stammen von `app.routes`.
+
+!!! info
+ Der Parameter `summary` ist in OpenAPI 3.1.0 und höher verfügbar und wird von FastAPI 0.99.0 und höher unterstützt.
+
+## Überschreiben der Standardeinstellungen
+
+Mithilfe der oben genannten Informationen können Sie dieselbe Hilfsfunktion verwenden, um das OpenAPI-Schema zu generieren und jeden benötigten Teil zu überschreiben.
+
+Fügen wir beispielsweise ReDocs OpenAPI-Erweiterung zum Einbinden eines benutzerdefinierten Logos hinzu.
+
+### Normales **FastAPI**
+
+Schreiben Sie zunächst wie gewohnt Ihre ganze **FastAPI**-Anwendung:
+
+```Python hl_lines="1 4 7-9"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Das OpenAPI-Schema generieren
+
+Verwenden Sie dann dieselbe Hilfsfunktion, um das OpenAPI-Schema innerhalb einer `custom_openapi()`-Funktion zu generieren:
+
+```Python hl_lines="2 15-21"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Das OpenAPI-Schema ändern
+
+Jetzt können Sie die ReDoc-Erweiterung hinzufügen und dem `info`-„Objekt“ im OpenAPI-Schema ein benutzerdefiniertes `x-logo` hinzufügen:
+
+```Python hl_lines="22-24"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Zwischenspeichern des OpenAPI-Schemas
+
+Sie können die Eigenschaft `.openapi_schema` als „Cache“ verwenden, um Ihr generiertes Schema zu speichern.
+
+Auf diese Weise muss Ihre Anwendung das Schema nicht jedes Mal generieren, wenn ein Benutzer Ihre API-Dokumentation öffnet.
+
+Es wird nur einmal generiert und dann wird dasselbe zwischengespeicherte Schema für die nächsten Requests verwendet.
+
+```Python hl_lines="13-14 25-26"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Die Methode überschreiben
+
+Jetzt können Sie die Methode `.openapi()` durch Ihre neue Funktion ersetzen.
+
+```Python hl_lines="29"
+{!../../../docs_src/extending_openapi/tutorial001.py!}
+```
+
+### Testen
+
+Sobald Sie auf http://127.0.0.1:8000/redoc gehen, werden Sie sehen, dass Ihr benutzerdefiniertes Logo verwendet wird (in diesem Beispiel das Logo von **FastAPI**):
+
+
diff --git a/docs/de/docs/how-to/general.md b/docs/de/docs/how-to/general.md
new file mode 100644
index 000000000..b38b5fabf
--- /dev/null
+++ b/docs/de/docs/how-to/general.md
@@ -0,0 +1,39 @@
+# Allgemeines – How-To – Rezepte
+
+Hier finden Sie mehrere Verweise auf andere Stellen in der Dokumentation, für allgemeine oder häufige Fragen.
+
+## Daten filtern – Sicherheit
+
+Um sicherzustellen, dass Sie nicht mehr Daten zurückgeben, als Sie sollten, lesen Sie die Dokumentation unter [Tutorial – Responsemodell – Rückgabetyp](../tutorial/response-model.md){.internal-link target=_blank}.
+
+## Dokumentations-Tags – OpenAPI
+
+Um Tags zu Ihren *Pfadoperationen* hinzuzufügen und diese in der Oberfläche der Dokumentation zu gruppieren, lesen Sie die Dokumentation unter [Tutorial – Pfadoperation-Konfiguration – Tags](../tutorial/path-operation-configuration.md#tags){.internal-link target=_blank}.
+
+## Zusammenfassung und Beschreibung in der Dokumentation – OpenAPI
+
+Um Ihren *Pfadoperationen* eine Zusammenfassung und Beschreibung hinzuzufügen und diese in der Oberfläche der Dokumentation anzuzeigen, lesen Sie die Dokumentation unter [Tutorial – Pfadoperation-Konfiguration – Zusammenfassung und Beschreibung](../tutorial/path-operation-configuration.md#zusammenfassung-und-beschreibung){.internal-link target=_blank}.
+
+## Beschreibung der Response in der Dokumentation – OpenAPI
+
+Um die Beschreibung der Response zu definieren, welche in der Oberfläche der Dokumentation angezeigt wird, lesen Sie die Dokumentation unter [Tutorial – Pfadoperation-Konfiguration – Beschreibung der Response](../tutorial/path-operation-configuration.md#beschreibung-der-response){.internal-link target=_blank}.
+
+## *Pfadoperation* in der Dokumentation deprecaten – OpenAPI
+
+Um eine *Pfadoperation* zu deprecaten – sie als veraltet zu markieren – und das in der Oberfläche der Dokumentation anzuzeigen, lesen Sie die Dokumentation unter [Tutorial – Pfadoperation-Konfiguration – Deprecaten](../tutorial/path-operation-configuration.md#eine-pfadoperation-deprecaten){.internal-link target=_blank}.
+
+## Daten in etwas JSON-kompatibles konvertieren
+
+Um Daten in etwas JSON-kompatibles zu konvertieren, lesen Sie die Dokumentation unter [Tutorial – JSON-kompatibler Encoder](../tutorial/encoder.md){.internal-link target=_blank}.
+
+## OpenAPI-Metadaten – Dokumentation
+
+Um Metadaten zu Ihrem OpenAPI-Schema hinzuzufügen, einschließlich einer Lizenz, Version, Kontakt, usw., lesen Sie die Dokumentation unter [Tutorial – Metadaten und URLs der Dokumentationen](../tutorial/metadata.md){.internal-link target=_blank}.
+
+## Benutzerdefinierte OpenAPI-URL
+
+Um die OpenAPI-URL anzupassen (oder zu entfernen), lesen Sie die Dokumentation unter [Tutorial – Metadaten und URLs der Dokumentationen](../tutorial/metadata.md#openapi-url){.internal-link target=_blank}.
+
+## URLs der OpenAPI-Dokumentationen
+
+Um die URLs zu aktualisieren, die für die automatisch generierten Dokumentations-Oberflächen verwendet werden, lesen Sie die Dokumentation unter [Tutorial – Metadaten und URLs der Dokumentationen](../tutorial/metadata.md#urls-der-dokumentationen){.internal-link target=_blank}.
diff --git a/docs/de/docs/how-to/graphql.md b/docs/de/docs/how-to/graphql.md
new file mode 100644
index 000000000..9b03e8e05
--- /dev/null
+++ b/docs/de/docs/how-to/graphql.md
@@ -0,0 +1,56 @@
+# GraphQL
+
+Da **FastAPI** auf dem **ASGI**-Standard basiert, ist es sehr einfach, jede **GraphQL**-Bibliothek zu integrieren, die auch mit ASGI kompatibel ist.
+
+Sie können normale FastAPI-*Pfadoperationen* mit GraphQL in derselben Anwendung kombinieren.
+
+!!! tip "Tipp"
+ **GraphQL** löst einige sehr spezifische Anwendungsfälle.
+
+ Es hat **Vorteile** und **Nachteile** im Vergleich zu gängigen **Web-APIs**.
+
+ Wiegen Sie ab, ob die **Vorteile** für Ihren Anwendungsfall die **Nachteile** ausgleichen. 🤓
+
+## GraphQL-Bibliotheken
+
+Hier sind einige der **GraphQL**-Bibliotheken, welche **ASGI** unterstützen. Diese könnten Sie mit **FastAPI** verwenden:
+
+* Strawberry 🍓
+ * Mit Dokumentation für FastAPI
+* Ariadne
+ * Mit Dokumentation für Starlette (welche auch für FastAPI gilt)
+* Tartiflette
+ * Mit Tartiflette ASGI, für ASGI-Integration
+* Graphene
+ * Mit starlette-graphene3
+
+## GraphQL mit Strawberry
+
+Wenn Sie mit **GraphQL** arbeiten möchten oder müssen, ist **Strawberry** die **empfohlene** Bibliothek, da deren Design dem Design von **FastAPI** am nächsten kommt und alles auf **Typannotationen** basiert.
+
+Abhängig von Ihrem Anwendungsfall bevorzugen Sie vielleicht eine andere Bibliothek, aber wenn Sie mich fragen würden, würde ich Ihnen wahrscheinlich empfehlen, **Strawberry** auszuprobieren.
+
+Hier ist eine kleine Vorschau, wie Sie Strawberry mit FastAPI integrieren können:
+
+```Python hl_lines="3 22 25-26"
+{!../../../docs_src/graphql/tutorial001.py!}
+```
+
+Weitere Informationen zu Strawberry finden Sie in der Strawberry-Dokumentation.
+
+Und auch die Dokumentation zu Strawberry mit FastAPI.
+
+## Ältere `GraphQLApp` von Starlette
+
+Frühere Versionen von Starlette enthielten eine `GraphQLApp`-Klasse zur Integration mit Graphene.
+
+Das wurde von Starlette deprecated, aber wenn Sie Code haben, der das verwendet, können Sie einfach zu starlette-graphene3 **migrieren**, welches denselben Anwendungsfall abdeckt und über eine **fast identische Schnittstelle** verfügt.
+
+!!! tip "Tipp"
+ Wenn Sie GraphQL benötigen, würde ich Ihnen trotzdem empfehlen, sich Strawberry anzuschauen, da es auf Typannotationen basiert, statt auf benutzerdefinierten Klassen und Typen.
+
+## Mehr darüber lernen
+
+Weitere Informationen zu **GraphQL** finden Sie in der offiziellen GraphQL-Dokumentation.
+
+Sie können auch mehr über jede der oben beschriebenen Bibliotheken in den jeweiligen Links lesen.
diff --git a/docs/de/docs/how-to/index.md b/docs/de/docs/how-to/index.md
new file mode 100644
index 000000000..101829ff8
--- /dev/null
+++ b/docs/de/docs/how-to/index.md
@@ -0,0 +1,10 @@
+# How-To – Rezepte
+
+Hier finden Sie verschiedene Rezepte und „How-To“-Anleitungen zu **verschiedenen Themen**.
+
+Die meisten dieser Ideen sind mehr oder weniger **unabhängig**, und in den meisten Fällen müssen Sie diese nur studieren, wenn sie direkt auf **Ihr Projekt** anwendbar sind.
+
+Wenn etwas für Ihr Projekt interessant und nützlich erscheint, lesen Sie es, andernfalls überspringen Sie es einfach.
+
+!!! tip "Tipp"
+ Wenn Sie strukturiert **FastAPI lernen** möchten (empfohlen), lesen Sie stattdessen Kapitel für Kapitel das [Tutorial – Benutzerhandbuch](../tutorial/index.md){.internal-link target=_blank}.
diff --git a/docs/de/docs/how-to/separate-openapi-schemas.md b/docs/de/docs/how-to/separate-openapi-schemas.md
new file mode 100644
index 000000000..000bcf633
--- /dev/null
+++ b/docs/de/docs/how-to/separate-openapi-schemas.md
@@ -0,0 +1,231 @@
+# Separate OpenAPI-Schemas für Eingabe und Ausgabe oder nicht
+
+Bei Verwendung von **Pydantic v2** ist die generierte OpenAPI etwas genauer und **korrekter** als zuvor. 😎
+
+Tatsächlich gibt es in einigen Fällen sogar **zwei JSON-Schemas** in OpenAPI für dasselbe Pydantic-Modell für Eingabe und Ausgabe, je nachdem, ob sie **Defaultwerte** haben.
+
+Sehen wir uns an, wie das funktioniert und wie Sie es bei Bedarf ändern können.
+
+## Pydantic-Modelle für Eingabe und Ausgabe
+
+Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/separate_openapi_schemas/tutorial001_py310.py[ln:1-7]!}
+
+ # Code unterhalb weggelassen 👇
+ ```
+
+
+
+
+
+
++ FastAPI Framework, hochperformant, leicht zu erlernen, schnell zu programmieren, einsatzbereit +
+ + +--- + +**Dokumentation**: https://fastapi.tiangolo.com + +**Quellcode**: https://github.com/tiangolo/fastapi + +--- + +FastAPI ist ein modernes, schnelles (hoch performantes) Webframework zur Erstellung von APIs mit Python 3.8+ auf Basis von Standard-Python-Typhinweisen. + +Seine Schlüssel-Merkmale sind: + +* **Schnell**: Sehr hohe Leistung, auf Augenhöhe mit **NodeJS** und **Go** (Dank Starlette und Pydantic). [Eines der schnellsten verfügbaren Python-Frameworks](#performanz). + +* **Schnell zu programmieren**: Erhöhen Sie die Geschwindigkeit bei der Entwicklung von Funktionen um etwa 200 % bis 300 %. * +* **Weniger Bugs**: Verringern Sie die von Menschen (Entwicklern) verursachten Fehler um etwa 40 %. * +* **Intuitiv**: Exzellente Editor-Unterstützung. Code-Vervollständigung überall. Weniger Debuggen. +* **Einfach**: So konzipiert, dass es einfach zu benutzen und zu erlernen ist. Weniger Zeit für das Lesen der Dokumentation. +* **Kurz**: Minimieren Sie die Verdoppelung von Code. Mehrere Funktionen aus jeder Parameterdeklaration. Weniger Bugs. +* **Robust**: Erhalten Sie produktionsreifen Code. Mit automatischer, interaktiver Dokumentation. +* **Standards-basiert**: Basierend auf (und vollständig kompatibel mit) den offenen Standards für APIs: OpenAPI (früher bekannt als Swagger) und JSON Schema. + +* Schätzung auf Basis von Tests in einem internen Entwicklungsteam, das Produktionsanwendungen erstellt. + +## Sponsoren + + + +{% if sponsors %} +{% for sponsor in sponsors.gold -%} +async def ...uvicorn main:app --reload ...email_validator - für E-Mail-Validierung.
+* pydantic-settings - für die Verwaltung von Einstellungen.
+* pydantic-extra-types - für zusätzliche Typen, mit Pydantic zu verwenden.
+
+Wird von Starlette verwendet:
+
+* httpx - erforderlich, wenn Sie den `TestClient` verwenden möchten.
+* jinja2 - erforderlich, wenn Sie die Standardkonfiguration für Templates verwenden möchten.
+* python-multipart - erforderlich, wenn Sie Formulare mittels `request.form()` „parsen“ möchten.
+* itsdangerous - erforderlich für `SessionMiddleware` Unterstützung.
+* pyyaml - erforderlich für Starlette's `SchemaGenerator` Unterstützung (Sie brauchen das wahrscheinlich nicht mit FastAPI).
+* ujson - erforderlich, wenn Sie `UJSONResponse` verwenden möchten.
+
+Wird von FastAPI / Starlette verwendet:
+
+* uvicorn - für den Server, der Ihre Anwendung lädt und serviert.
+* orjson - erforderlich, wenn Sie `ORJSONResponse` verwenden möchten.
+
+Sie können diese alle mit `pip install "fastapi[all]"` installieren.
+
+## Lizenz
+
+Dieses Projekt ist unter den Bedingungen der MIT-Lizenz lizenziert.
diff --git a/docs/de/docs/learn/index.md b/docs/de/docs/learn/index.md
new file mode 100644
index 000000000..b5582f55b
--- /dev/null
+++ b/docs/de/docs/learn/index.md
@@ -0,0 +1,5 @@
+# Lernen
+
+Hier finden Sie die einführenden Kapitel und Tutorials zum Erlernen von **FastAPI**.
+
+Sie könnten dies als **Buch**, als **Kurs**, als **offizielle** und empfohlene Methode zum Erlernen von FastAPI betrachten. 😎
diff --git a/docs/de/docs/newsletter.md b/docs/de/docs/newsletter.md
new file mode 100644
index 000000000..31995b164
--- /dev/null
+++ b/docs/de/docs/newsletter.md
@@ -0,0 +1,5 @@
+# FastAPI und Freunde Newsletter
+
+
+
+
diff --git a/docs/de/docs/project-generation.md b/docs/de/docs/project-generation.md
new file mode 100644
index 000000000..c1ae6512d
--- /dev/null
+++ b/docs/de/docs/project-generation.md
@@ -0,0 +1,84 @@
+# Projektgenerierung – Vorlage
+
+Sie können einen Projektgenerator für den Einstieg verwenden, welcher einen Großteil der Ersteinrichtung, Sicherheit, Datenbank und einige API-Endpunkte bereits für Sie erstellt.
+
+Ein Projektgenerator verfügt immer über ein sehr spezifisches Setup, das Sie aktualisieren und an Ihre eigenen Bedürfnisse anpassen sollten, aber es könnte ein guter Ausgangspunkt für Ihr Projekt sein.
+
+## Full Stack FastAPI PostgreSQL
+
+GitHub: https://github.com/tiangolo/full-stack-fastapi-postgresql
+
+### Full Stack FastAPI PostgreSQL – Funktionen
+
+* Vollständige **Docker**-Integration (Docker-basiert).
+* Docker-Schwarmmodus-Deployment.
+* **Docker Compose**-Integration und Optimierung für die lokale Entwicklung.
+* **Produktionsbereit** Python-Webserver, verwendet Uvicorn und Gunicorn.
+* Python **FastAPI**-Backend:
+ * **Schnell**: Sehr hohe Leistung, auf Augenhöhe mit **NodeJS** und **Go** (dank Starlette und Pydantic).
+ * **Intuitiv**: Hervorragende Editor-Unterstützung. Codevervollständigung überall. Weniger Zeitaufwand für das Debuggen.
+ * **Einfach**: Einfach zu bedienen und zu erlernen. Weniger Zeit für das Lesen von Dokumentationen.
+ * **Kurz**: Codeverdoppelung minimieren. Mehrere Funktionalitäten aus jeder Parameterdeklaration.
+ * **Robust**: Erhalten Sie produktionsbereiten Code. Mit automatischer, interaktiver Dokumentation.
+ * **Standards-basiert**: Basierend auf (und vollständig kompatibel mit) den offenen Standards für APIs: OpenAPI und JSON Schema.
+ * **Viele weitere Funktionen**, einschließlich automatischer Validierung, Serialisierung, interaktiver Dokumentation, Authentifizierung mit OAuth2-JWT-Tokens, usw.
+* **Sicheres Passwort**-Hashing standardmäßig.
+* **JWT-Token**-Authentifizierung.
+* **SQLAlchemy**-Modelle (unabhängig von Flask-Erweiterungen, sodass sie direkt mit Celery-Workern verwendet werden können).
+* Grundlegende Startmodelle für Benutzer (ändern und entfernen Sie nach Bedarf).
+* **Alembic**-Migrationen.
+* **CORS** (Cross Origin Resource Sharing).
+* **Celery**-Worker, welche Modelle und Code aus dem Rest des Backends selektiv importieren und verwenden können.
+* REST-Backend-Tests basierend auf **Pytest**, integriert in Docker, sodass Sie die vollständige API-Interaktion unabhängig von der Datenbank testen können. Da es in Docker ausgeführt wird, kann jedes Mal ein neuer Datenspeicher von Grund auf erstellt werden (Sie können also ElasticSearch, MongoDB, CouchDB oder was auch immer Sie möchten verwenden und einfach testen, ob die API funktioniert).
+* Einfache Python-Integration mit **Jupyter-Kerneln** für Remote- oder In-Docker-Entwicklung mit Erweiterungen wie Atom Hydrogen oder Visual Studio Code Jupyter.
+* **Vue**-Frontend:
+ * Mit Vue CLI generiert.
+ * Handhabung der **JWT-Authentifizierung**.
+ * Login-View.
+ * Nach der Anmeldung Hauptansicht des Dashboards.
+ * Haupt-Dashboard mit Benutzererstellung und -bearbeitung.
+ * Bearbeitung des eigenen Benutzers.
+ * **Vuex**.
+ * **Vue-Router**.
+ * **Vuetify** für schöne Material-Designkomponenten.
+ * **TypeScript**.
+ * Docker-Server basierend auf **Nginx** (konfiguriert, um gut mit Vue-Router zu funktionieren).
+ * Mehrstufigen Docker-Erstellung, sodass Sie kompilierten Code nicht speichern oder committen müssen.
+ * Frontend-Tests, welche zur Erstellungszeit ausgeführt werden (können auch deaktiviert werden).
+ * So modular wie möglich gestaltet, sodass es sofort einsatzbereit ist. Sie können es aber mit Vue CLI neu generieren oder es so wie Sie möchten erstellen und wiederverwenden, was Sie möchten.
+* **PGAdmin** für die PostgreSQL-Datenbank, können Sie problemlos ändern, sodass PHPMyAdmin und MySQL verwendet wird.
+* **Flower** für die Überwachung von Celery-Jobs.
+* Load Balancing zwischen Frontend und Backend mit **Traefik**, sodass Sie beide unter derselben Domain haben können, getrennt durch den Pfad, aber von unterschiedlichen Containern ausgeliefert.
+* Traefik-Integration, einschließlich automatischer Generierung von Let's Encrypt-**HTTPS**-Zertifikaten.
+* GitLab **CI** (kontinuierliche Integration), einschließlich Frontend- und Backend-Testen.
+
+## Full Stack FastAPI Couchbase
+
+GitHub: https://github.com/tiangolo/full-stack-fastapi-couchbase
+
+⚠️ **WARNUNG** ⚠️
+
+Wenn Sie ein neues Projekt von Grund auf starten, prüfen Sie die Alternativen hier.
+
+Zum Beispiel könnte der Projektgenerator Full Stack FastAPI PostgreSQL eine bessere Alternative sein, da er aktiv gepflegt und genutzt wird. Und er enthält alle neuen Funktionen und Verbesserungen.
+
+Es steht Ihnen weiterhin frei, den Couchbase-basierten Generator zu verwenden, wenn Sie möchten. Er sollte wahrscheinlich immer noch gut funktionieren, und wenn Sie bereits ein Projekt damit erstellt haben, ist das auch in Ordnung (und Sie haben es wahrscheinlich bereits an Ihre Bedürfnisse angepasst).
+
+Weitere Informationen hierzu finden Sie in der Dokumentation des Repos.
+
+## Full Stack FastAPI MongoDB
+
+... könnte später kommen, abhängig von meiner verfügbaren Zeit und anderen Faktoren. 😅 🎉
+
+## Modelle für maschinelles Lernen mit spaCy und FastAPI
+
+GitHub: https://github.com/microsoft/cookiecutter-spacy-fastapi
+
+### Modelle für maschinelles Lernen mit spaCy und FastAPI – Funktionen
+
+* **spaCy** NER-Modellintegration.
+* **Azure Cognitive Search**-Anforderungsformat integriert.
+* **Produktionsbereit** Python-Webserver, verwendet Uvicorn und Gunicorn.
+* **Azure DevOps** Kubernetes (AKS) CI/CD-Deployment integriert.
+* **Mehrsprachig** Wählen Sie bei der Projekteinrichtung ganz einfach eine der integrierten Sprachen von spaCy aus.
+* **Einfach erweiterbar** auf andere Modellframeworks (Pytorch, Tensorflow), nicht nur auf SpaCy.
diff --git a/docs/de/docs/python-types.md b/docs/de/docs/python-types.md
new file mode 100644
index 000000000..d11a193dd
--- /dev/null
+++ b/docs/de/docs/python-types.md
@@ -0,0 +1,537 @@
+# Einführung in Python-Typen
+
+Python hat Unterstützung für optionale „Typhinweise“ (Englisch: „Type Hints“). Auch „Typ Annotationen“ genannt.
+
+Diese **„Typhinweise“** oder -Annotationen sind eine spezielle Syntax, die es erlaubt, den Typ einer Variablen zu deklarieren.
+
+Durch das Deklarieren von Typen für Ihre Variablen können Editoren und Tools bessere Unterstützung bieten.
+
+Dies ist lediglich eine **schnelle Anleitung / Auffrischung** über Pythons Typhinweise. Sie deckt nur das Minimum ab, das nötig ist, um diese mit **FastAPI** zu verwenden ... was tatsächlich sehr wenig ist.
+
+**FastAPI** basiert vollständig auf diesen Typhinweisen, sie geben der Anwendung viele Vorteile und Möglichkeiten.
+
+Aber selbst wenn Sie **FastAPI** nie verwenden, wird es für Sie nützlich sein, ein wenig darüber zu lernen.
+
+!!! note "Hinweis"
+ Wenn Sie ein Python-Experte sind und bereits alles über Typhinweise wissen, überspringen Sie dieses Kapitel und fahren Sie mit dem nächsten fort.
+
+## Motivation
+
+Fangen wir mit einem einfachen Beispiel an:
+
+```Python
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+Dieses Programm gibt aus:
+
+```
+John Doe
+```
+
+Die Funktion macht Folgendes:
+
+* Nimmt einen `first_name` und `last_name`.
+* Schreibt den ersten Buchstaben eines jeden Wortes groß, mithilfe von `title()`.
+* Verkettet sie mit einem Leerzeichen in der Mitte.
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+### Bearbeiten Sie es
+
+Es ist ein sehr einfaches Programm.
+
+Aber nun stellen Sie sich vor, Sie würden es selbst schreiben.
+
+Irgendwann sind die Funktions-Parameter fertig, Sie starten mit der Definition des Körpers ...
+
+Aber dann müssen Sie „diese Methode aufrufen, die den ersten Buchstaben in Großbuchstaben umwandelt“.
+
+War es `upper`? War es `uppercase`? `first_uppercase`? `capitalize`?
+
+Dann versuchen Sie es mit dem langjährigen Freund des Programmierers, der Editor-Autovervollständigung.
+
+Sie geben den ersten Parameter der Funktion ein, `first_name`, dann einen Punkt (`.`) und drücken `Strg+Leertaste`, um die Vervollständigung auszulösen.
+
+Aber leider erhalten Sie nichts Nützliches:
+
+
+
+### Typen hinzufügen
+
+Lassen Sie uns eine einzelne Zeile aus der vorherigen Version ändern.
+
+Wir ändern den folgenden Teil, die Parameter der Funktion, von:
+
+```Python
+ first_name, last_name
+```
+
+zu:
+
+```Python
+ first_name: str, last_name: str
+```
+
+Das war's.
+
+Das sind die „Typhinweise“:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial002.py!}
+```
+
+Das ist nicht das gleiche wie das Deklarieren von Defaultwerten, wie es hier der Fall ist:
+
+```Python
+ first_name="john", last_name="doe"
+```
+
+Das ist eine andere Sache.
+
+Wir verwenden Doppelpunkte (`:`), nicht Gleichheitszeichen (`=`).
+
+Und das Hinzufügen von Typhinweisen ändert normalerweise nichts an dem, was ohne sie passieren würde.
+
+Aber jetzt stellen Sie sich vor, Sie sind wieder mitten in der Erstellung dieser Funktion, aber mit Typhinweisen.
+
+An derselben Stelle versuchen Sie, die Autovervollständigung mit „Strg+Leertaste“ auszulösen, und Sie sehen:
+
+
+
+Hier können Sie durch die Optionen blättern, bis Sie diejenige finden, bei der es „Klick“ macht:
+
+
+
+## Mehr Motivation
+
+Sehen Sie sich diese Funktion an, sie hat bereits Typhinweise:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial003.py!}
+```
+
+Da der Editor die Typen der Variablen kennt, erhalten Sie nicht nur Code-Vervollständigung, sondern auch eine Fehlerprüfung:
+
+
+
+Jetzt, da Sie wissen, dass Sie das reparieren müssen, konvertieren Sie `age` mittels `str(age)` in einen String:
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial004.py!}
+```
+
+## Deklarieren von Typen
+
+Sie haben gerade den Haupt-Einsatzort für die Deklaration von Typhinweisen gesehen. Als Funktionsparameter.
+
+Das ist auch meistens, wie sie in **FastAPI** verwendet werden.
+
+### Einfache Typen
+
+Sie können alle Standard-Python-Typen deklarieren, nicht nur `str`.
+
+Zum Beispiel diese:
+
+* `int`
+* `float`
+* `bool`
+* `bytes`
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial005.py!}
+```
+
+### Generische Typen mit Typ-Parametern
+
+Es gibt Datenstrukturen, die andere Werte enthalten können, wie etwa `dict`, `list`, `set` und `tuple`. Die inneren Werte können auch ihren eigenen Typ haben.
+
+Diese Typen mit inneren Typen werden „**generische**“ Typen genannt. Es ist möglich, sie mit ihren inneren Typen zu deklarieren.
+
+Um diese Typen und die inneren Typen zu deklarieren, können Sie Pythons Standardmodul `typing` verwenden. Es existiert speziell für die Unterstützung dieser Typhinweise.
+
+#### Neuere Python-Versionen
+
+Die Syntax, welche `typing` verwendet, ist **kompatibel** mit allen Versionen, von Python 3.6 aufwärts zu den neuesten, inklusive Python 3.9, Python 3.10, usw.
+
+Mit der Weiterentwicklung von Python kommen **neuere Versionen** heraus, mit verbesserter Unterstützung für Typannotationen, und in vielen Fällen müssen Sie gar nicht mehr das `typing`-Modul importieren, um Typannotationen zu schreiben.
+
+Wenn Sie eine neuere Python-Version für Ihr Projekt wählen können, werden Sie aus dieser zusätzlichen Vereinfachung Nutzen ziehen können.
+
+In der gesamten Dokumentation gibt es Beispiele, welche kompatibel mit unterschiedlichen Python-Versionen sind (wenn es Unterschiede gibt).
+
+Zum Beispiel bedeutet „**Python 3.6+**“, dass das Beispiel kompatibel mit Python 3.6 oder höher ist (inklusive 3.7, 3.8, 3.9, 3.10, usw.). Und „**Python 3.9+**“ bedeutet, es ist kompatibel mit Python 3.9 oder höher (inklusive 3.10, usw.).
+
+Wenn Sie über die **neueste Version von Python** verfügen, verwenden Sie die Beispiele für die neueste Version, diese werden die **beste und einfachste Syntax** haben, zum Beispiel, „**Python 3.10+**“.
+
+#### Liste
+
+Definieren wir zum Beispiel eine Variable, die eine `list` von `str` – eine Liste von Strings – sein soll.
+
+=== "Python 3.9+"
+
+ Deklarieren Sie die Variable mit der gleichen Doppelpunkt-Syntax (`:`).
+
+ Als Typ nehmen Sie `list`.
+
+ Da die Liste ein Typ ist, welcher innere Typen enthält, werden diese von eckigen Klammern umfasst:
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial006_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ Von `typing` importieren Sie `List` (mit Großbuchstaben `L`):
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial006.py!}
+ ```
+
+ Deklarieren Sie die Variable mit der gleichen Doppelpunkt-Syntax (`:`).
+
+ Als Typ nehmen Sie das `List`, das Sie von `typing` importiert haben.
+
+ Da die Liste ein Typ ist, welcher innere Typen enthält, werden diese von eckigen Klammern umfasst:
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/python_types/tutorial006.py!}
+ ```
+
+!!! tip "Tipp"
+ Die inneren Typen in den eckigen Klammern werden als „Typ-Parameter“ bezeichnet.
+
+ In diesem Fall ist `str` der Typ-Parameter, der an `List` übergeben wird (oder `list` in Python 3.9 und darüber).
+
+Das bedeutet: Die Variable `items` ist eine Liste – `list` – und jedes der Elemente in dieser Liste ist ein String – `str`.
+
+!!! tip "Tipp"
+ Wenn Sie Python 3.9 oder höher verwenden, müssen Sie `List` nicht von `typing` importieren, Sie können stattdessen den regulären `list`-Typ verwenden.
+
+Auf diese Weise kann Ihr Editor Sie auch bei der Bearbeitung von Einträgen aus der Liste unterstützen:
+
+
+
+Ohne Typen ist das fast unmöglich zu erreichen.
+
+Beachten Sie, dass die Variable `item` eines der Elemente in der Liste `items` ist.
+
+Und trotzdem weiß der Editor, dass es sich um ein `str` handelt, und bietet entsprechende Unterstützung.
+
+#### Tupel und Menge
+
+Das Gleiche gilt für die Deklaration eines Tupels – `tuple` – und einer Menge – `set`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial007_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial007.py!}
+ ```
+
+Das bedeutet:
+
+* Die Variable `items_t` ist ein `tuple` mit 3 Elementen, einem `int`, einem weiteren `int` und einem `str`.
+* Die Variable `items_s` ist ein `set`, und jedes seiner Elemente ist vom Typ `bytes`.
+
+#### Dict
+
+Um ein `dict` zu definieren, übergeben Sie zwei Typ-Parameter, getrennt durch Kommas.
+
+Der erste Typ-Parameter ist für die Schlüssel des `dict`.
+
+Der zweite Typ-Parameter ist für die Werte des `dict`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial008_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial008.py!}
+ ```
+
+Das bedeutet:
+
+* Die Variable `prices` ist ein `dict`:
+ * Die Schlüssel dieses `dict` sind vom Typ `str` (z. B. die Namen der einzelnen Artikel).
+ * Die Werte dieses `dict` sind vom Typ `float` (z. B. der Preis jedes Artikels).
+
+#### Union
+
+Sie können deklarieren, dass eine Variable einer von **verschiedenen Typen** sein kann, zum Beispiel ein `int` oder ein `str`.
+
+In Python 3.6 und höher (inklusive Python 3.10) können Sie den `Union`-Typ von `typing` verwenden und die möglichen Typen innerhalb der eckigen Klammern auflisten.
+
+In Python 3.10 gibt es zusätzlich eine **neue Syntax**, die es erlaubt, die möglichen Typen getrennt von einem vertikalen Balken (`|`) aufzulisten.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial008b_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial008b.py!}
+ ```
+
+In beiden Fällen bedeutet das, dass `item` ein `int` oder ein `str` sein kann.
+
+#### Vielleicht `None`
+
+Sie können deklarieren, dass ein Wert ein `str`, aber vielleicht auch `None` sein kann.
+
+In Python 3.6 und darüber (inklusive Python 3.10) können Sie das deklarieren, indem Sie `Optional` vom `typing` Modul importieren und verwenden.
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009.py!}
+```
+
+Wenn Sie `Optional[str]` anstelle von nur `str` verwenden, wird Ihr Editor Ihnen dabei helfen, Fehler zu erkennen, bei denen Sie annehmen könnten, dass ein Wert immer eine String (`str`) ist, obwohl er auch `None` sein könnte.
+
+`Optional[Something]` ist tatsächlich eine Abkürzung für `Union[Something, None]`, diese beiden sind äquivalent.
+
+Das bedeutet auch, dass Sie in Python 3.10 `Something | None` verwenden können:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/python_types/tutorial009_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial009.py!}
+ ```
+
+=== "Python 3.8+ Alternative"
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial009b.py!}
+ ```
+
+#### `Union` oder `Optional` verwenden?
+
+Wenn Sie eine Python-Version unterhalb 3.10 verwenden, hier ist mein sehr **subjektiver** Standpunkt dazu:
+
+* 🚨 Vermeiden Sie `Optional[SomeType]`
+* Stattdessen ✨ **verwenden Sie `Union[SomeType, None]`** ✨.
+
+Beide sind äquivalent und im Hintergrund dasselbe, aber ich empfehle `Union` statt `Optional`, weil das Wort „**optional**“ impliziert, dass dieser Wert, zum Beispiel als Funktionsparameter, optional ist. Tatsächlich bedeutet es aber nur „Der Wert kann `None` sein“, selbst wenn der Wert nicht optional ist und benötigt wird.
+
+Ich denke, `Union[SomeType, None]` ist expliziter bezüglich seiner Bedeutung.
+
+Es geht nur um Wörter und Namen. Aber diese Worte können beeinflussen, wie Sie und Ihre Teamkollegen über den Code denken.
+
+Nehmen wir zum Beispiel diese Funktion:
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009c.py!}
+```
+
+Der Parameter `name` ist definiert als `Optional[str]`, aber er ist **nicht optional**, Sie können die Funktion nicht ohne diesen Parameter aufrufen:
+
+```Python
+say_hi() # Oh, nein, das löst einen Fehler aus! 😱
+```
+
+Der `name` Parameter wird **immer noch benötigt** (nicht *optional*), weil er keinen Default-Wert hat. `name` akzeptiert aber dennoch `None` als Wert:
+
+```Python
+say_hi(name=None) # Das funktioniert, None is gültig 🎉
+```
+
+Die gute Nachricht ist, dass Sie sich darüber keine Sorgen mehr machen müssen, wenn Sie Python 3.10 verwenden, da Sie einfach `|` verwenden können, um Vereinigungen von Typen zu definieren:
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009c_py310.py!}
+```
+
+Und dann müssen Sie sich nicht mehr um Namen wie `Optional` und `Union` kümmern. 😎
+
+#### Generische Typen
+
+Diese Typen, die Typ-Parameter in eckigen Klammern akzeptieren, werden **generische Typen** oder **Generics** genannt.
+
+=== "Python 3.10+"
+
+ Sie können die eingebauten Typen als Generics verwenden (mit eckigen Klammern und Typen darin):
+
+ * `list`
+ * `tuple`
+ * `set`
+ * `dict`
+
+ Verwenden Sie für den Rest, wie unter Python 3.8, das `typing`-Modul:
+
+ * `Union`
+ * `Optional` (so wie unter Python 3.8)
+ * ... und andere.
+
+ In Python 3.10 können Sie als Alternative zu den Generics `Union` und `Optional` den vertikalen Balken (`|`) verwenden, um Vereinigungen von Typen zu deklarieren, das ist besser und einfacher.
+
+=== "Python 3.9+"
+
+ Sie können die eingebauten Typen als Generics verwenden (mit eckigen Klammern und Typen darin):
+
+ * `list`
+ * `tuple`
+ * `set`
+ * `dict`
+
+ Verwenden Sie für den Rest, wie unter Python 3.8, das `typing`-Modul:
+
+ * `Union`
+ * `Optional`
+ * ... und andere.
+
+=== "Python 3.8+"
+
+ * `List`
+ * `Tuple`
+ * `Set`
+ * `Dict`
+ * `Union`
+ * `Optional`
+ * ... und andere.
+
+### Klassen als Typen
+
+Sie können auch eine Klasse als Typ einer Variablen deklarieren.
+
+Nehmen wir an, Sie haben eine Klasse `Person`, mit einem Namen:
+
+```Python hl_lines="1-3"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+Dann können Sie eine Variable vom Typ `Person` deklarieren:
+
+```Python hl_lines="6"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+Und wiederum bekommen Sie die volle Editor-Unterstützung:
+
+
+
+Beachten Sie, das bedeutet: „`one_person` ist eine **Instanz** der Klasse `Person`“.
+
+Es bedeutet nicht: „`one_person` ist die **Klasse** genannt `Person`“.
+
+## Pydantic Modelle
+
+Pydantic ist eine Python-Bibliothek für die Validierung von Daten.
+
+Sie deklarieren die „Form“ der Daten als Klassen mit Attributen.
+
+Und jedes Attribut hat einen Typ.
+
+Dann erzeugen Sie eine Instanz dieser Klasse mit einigen Werten, und Pydantic validiert die Werte, konvertiert sie in den passenden Typ (falls notwendig) und gibt Ihnen ein Objekt mit allen Daten.
+
+Und Sie erhalten volle Editor-Unterstützung für dieses Objekt.
+
+Ein Beispiel aus der offiziellen Pydantic Dokumentation:
+
+=== "Python 3.10+"
+
+ ```Python
+ {!> ../../../docs_src/python_types/tutorial011_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python
+ {!> ../../../docs_src/python_types/tutorial011_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ {!> ../../../docs_src/python_types/tutorial011.py!}
+ ```
+
+!!! info
+ Um mehr über Pydantic zu erfahren, schauen Sie sich dessen Dokumentation an.
+
+**FastAPI** basiert vollständig auf Pydantic.
+
+Viel mehr von all dem werden Sie in praktischer Anwendung im [Tutorial - Benutzerhandbuch](tutorial/index.md){.internal-link target=_blank} sehen.
+
+!!! tip "Tipp"
+ Pydantic verhält sich speziell, wenn Sie `Optional` oder `Union[Etwas, None]` ohne einen Default-Wert verwenden. Sie können darüber in der Pydantic Dokumentation unter Required fields mehr erfahren.
+
+## Typhinweise mit Metadaten-Annotationen
+
+Python bietet auch die Möglichkeit, **zusätzliche Metadaten** in Typhinweisen unterzubringen, mittels `Annotated`.
+
+=== "Python 3.9+"
+
+ In Python 3.9 ist `Annotated` ein Teil der Standardbibliothek, Sie können es von `typing` importieren.
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial013_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ In Versionen niedriger als Python 3.9 importieren Sie `Annotated` von `typing_extensions`.
+
+ Es wird bereits mit **FastAPI** installiert sein.
+
+ ```Python hl_lines="1 4"
+ {!> ../../../docs_src/python_types/tutorial013.py!}
+ ```
+
+Python selbst macht nichts mit `Annotated`. Für Editoren und andere Tools ist der Typ immer noch `str`.
+
+Aber Sie können `Annotated` nutzen, um **FastAPI** mit Metadaten zu versorgen, die ihm sagen, wie sich ihre Anwendung verhalten soll.
+
+Wichtig ist, dass **der erste *Typ-Parameter***, den Sie `Annotated` übergeben, der **tatsächliche Typ** ist. Der Rest sind Metadaten für andere Tools.
+
+Im Moment müssen Sie nur wissen, dass `Annotated` existiert, und dass es Standard-Python ist. 😎
+
+Später werden Sie sehen, wie **mächtig** es sein kann.
+
+!!! tip "Tipp"
+ Der Umstand, dass es **Standard-Python** ist, bedeutet, dass Sie immer noch die **bestmögliche Entwickler-Erfahrung** in ihrem Editor haben, sowie mit den Tools, die Sie nutzen, um ihren Code zu analysieren, zu refaktorisieren, usw. ✨
+
+ Und ebenfalls, dass Ihr Code sehr kompatibel mit vielen anderen Python-Tools und -Bibliotheken sein wird. 🚀
+
+## Typhinweise in **FastAPI**
+
+**FastAPI** macht sich diese Typhinweise zunutze, um mehrere Dinge zu tun.
+
+Mit **FastAPI** deklarieren Sie Parameter mit Typhinweisen, und Sie erhalten:
+
+* **Editorunterstützung**.
+* **Typ-Prüfungen**.
+
+... und **FastAPI** verwendet dieselben Deklarationen, um:
+
+* **Anforderungen** zu definieren: aus Anfrage-Pfadparametern, Abfrageparametern, Header-Feldern, Bodys, Abhängigkeiten, usw.
+* **Daten umzuwandeln**: aus der Anfrage in den erforderlichen Typ.
+* **Daten zu validieren**: aus jeder Anfrage:
+ * **Automatische Fehler** generieren, die an den Client zurückgegeben werden, wenn die Daten ungültig sind.
+* Die API mit OpenAPI zu **dokumentieren**:
+ * Die dann von den Benutzeroberflächen der automatisch generierten interaktiven Dokumentation verwendet wird.
+
+Das mag alles abstrakt klingen. Machen Sie sich keine Sorgen. Sie werden all das in Aktion sehen im [Tutorial - Benutzerhandbuch](tutorial/index.md){.internal-link target=_blank}.
+
+Das Wichtigste ist, dass **FastAPI** durch die Verwendung von Standard-Python-Typen an einer einzigen Stelle (anstatt weitere Klassen, Dekoratoren usw. hinzuzufügen) einen Großteil der Arbeit für Sie erledigt.
+
+!!! info
+ Wenn Sie bereits das ganze Tutorial durchgearbeitet haben und mehr über Typen erfahren wollen, dann ist eine gute Ressource der „Cheat Sheet“ von `mypy`.
diff --git a/docs/de/docs/reference/apirouter.md b/docs/de/docs/reference/apirouter.md
new file mode 100644
index 000000000..b0728b7df
--- /dev/null
+++ b/docs/de/docs/reference/apirouter.md
@@ -0,0 +1,24 @@
+# `APIRouter`-Klasse
+
+Hier sind die Referenzinformationen für die Klasse `APIRouter` mit all ihren Parametern, Attributen und Methoden.
+
+Sie können die `APIRouter`-Klasse direkt von `fastapi` importieren:
+
+```python
+from fastapi import APIRouter
+```
+
+::: fastapi.APIRouter
+ options:
+ members:
+ - websocket
+ - include_router
+ - get
+ - put
+ - post
+ - delete
+ - options
+ - head
+ - patch
+ - trace
+ - on_event
diff --git a/docs/de/docs/reference/background.md b/docs/de/docs/reference/background.md
new file mode 100644
index 000000000..0fd389325
--- /dev/null
+++ b/docs/de/docs/reference/background.md
@@ -0,0 +1,11 @@
+# Hintergrundtasks – `BackgroundTasks`
+
+Sie können einen Parameter in einer *Pfadoperation-Funktion* oder einer Abhängigkeitsfunktion mit dem Typ `BackgroundTasks` deklarieren und diesen danach verwenden, um die Ausführung von Hintergrundtasks nach dem Senden der Response zu definieren.
+
+Sie können `BackgroundTasks` direkt von `fastapi` importieren:
+
+```python
+from fastapi import BackgroundTasks
+```
+
+::: fastapi.BackgroundTasks
diff --git a/docs/de/docs/reference/dependencies.md b/docs/de/docs/reference/dependencies.md
new file mode 100644
index 000000000..2ed5b5050
--- /dev/null
+++ b/docs/de/docs/reference/dependencies.md
@@ -0,0 +1,29 @@
+# Abhängigkeiten – `Depends()` und `Security()`
+
+## `Depends()`
+
+Abhängigkeiten werden hauptsächlich mit der speziellen Funktion `Depends()` behandelt, die ein Callable entgegennimmt.
+
+Hier finden Sie deren Referenz und Parameter.
+
+Sie können sie direkt von `fastapi` importieren:
+
+```python
+from fastapi import Depends
+```
+
+::: fastapi.Depends
+
+## `Security()`
+
+In vielen Szenarien können Sie die Sicherheit (Autorisierung, Authentifizierung usw.) mit Abhängigkeiten handhaben, indem Sie `Depends()` verwenden.
+
+Wenn Sie jedoch auch OAuth2-Scopes deklarieren möchten, können Sie `Security()` anstelle von `Depends()` verwenden.
+
+Sie können `Security()` direkt von `fastapi` importieren:
+
+```python
+from fastapi import Security
+```
+
+::: fastapi.Security
diff --git a/docs/de/docs/reference/encoders.md b/docs/de/docs/reference/encoders.md
new file mode 100644
index 000000000..2489b8c60
--- /dev/null
+++ b/docs/de/docs/reference/encoders.md
@@ -0,0 +1,3 @@
+# Encoder – `jsonable_encoder`
+
+::: fastapi.encoders.jsonable_encoder
diff --git a/docs/de/docs/reference/exceptions.md b/docs/de/docs/reference/exceptions.md
new file mode 100644
index 000000000..230f902a9
--- /dev/null
+++ b/docs/de/docs/reference/exceptions.md
@@ -0,0 +1,20 @@
+# Exceptions – `HTTPException` und `WebSocketException`
+
+Dies sind die Exceptions, die Sie auslösen können, um dem Client Fehler zu berichten.
+
+Wenn Sie eine Exception auslösen, wird, wie es bei normalem Python der Fall wäre, der Rest der Ausführung abgebrochen. Auf diese Weise können Sie diese Exceptions von überall im Code werfen, um einen Request abzubrechen und den Fehler dem Client anzuzeigen.
+
+Sie können Folgendes verwenden:
+
+* `HTTPException`
+* `WebSocketException`
+
+Diese Exceptions können direkt von `fastapi` importiert werden:
+
+```python
+from fastapi import HTTPException, WebSocketException
+```
+
+::: fastapi.HTTPException
+
+::: fastapi.WebSocketException
diff --git a/docs/de/docs/reference/fastapi.md b/docs/de/docs/reference/fastapi.md
new file mode 100644
index 000000000..4e6a56971
--- /dev/null
+++ b/docs/de/docs/reference/fastapi.md
@@ -0,0 +1,31 @@
+# `FastAPI`-Klasse
+
+Hier sind die Referenzinformationen für die Klasse `FastAPI` mit all ihren Parametern, Attributen und Methoden.
+
+Sie können die `FastAPI`-Klasse direkt von `fastapi` importieren:
+
+```python
+from fastapi import FastAPI
+```
+
+::: fastapi.FastAPI
+ options:
+ members:
+ - openapi_version
+ - webhooks
+ - state
+ - dependency_overrides
+ - openapi
+ - websocket
+ - include_router
+ - get
+ - put
+ - post
+ - delete
+ - options
+ - head
+ - patch
+ - trace
+ - on_event
+ - middleware
+ - exception_handler
diff --git a/docs/de/docs/reference/httpconnection.md b/docs/de/docs/reference/httpconnection.md
new file mode 100644
index 000000000..32a9696fa
--- /dev/null
+++ b/docs/de/docs/reference/httpconnection.md
@@ -0,0 +1,11 @@
+# `HTTPConnection`-Klasse
+
+Wenn Sie Abhängigkeiten definieren möchten, die sowohl mit HTTP als auch mit WebSockets kompatibel sein sollen, können Sie einen Parameter definieren, der eine `HTTPConnection` anstelle eines `Request` oder eines `WebSocket` akzeptiert.
+
+Sie können diese von `fastapi.requests` importieren:
+
+```python
+from fastapi.requests import HTTPConnection
+```
+
+::: fastapi.requests.HTTPConnection
diff --git a/docs/de/docs/reference/index.md b/docs/de/docs/reference/index.md
new file mode 100644
index 000000000..e9362b962
--- /dev/null
+++ b/docs/de/docs/reference/index.md
@@ -0,0 +1,8 @@
+# Referenz – Code-API
+
+Hier ist die Referenz oder Code-API, die Klassen, Funktionen, Parameter, Attribute und alle FastAPI-Teile, die Sie in Ihren Anwendungen verwenden können.
+
+Wenn Sie **FastAPI** lernen möchten, ist es viel besser, das [FastAPI-Tutorial](https://fastapi.tiangolo.com/tutorial/) zu lesen.
+
+!!! note "Hinweis Deutsche Übersetzung"
+ Die nachfolgende API wird aus der Quelltext-Dokumentation erstellt, daher sind nur die Einleitungen auf Deutsch.
diff --git a/docs/de/docs/reference/middleware.md b/docs/de/docs/reference/middleware.md
new file mode 100644
index 000000000..d8d2d50fc
--- /dev/null
+++ b/docs/de/docs/reference/middleware.md
@@ -0,0 +1,45 @@
+# Middleware
+
+Es gibt mehrere Middlewares, die direkt von Starlette bereitgestellt werden.
+
+Lesen Sie mehr darüber in der [FastAPI-Dokumentation über Middleware](../advanced/middleware.md).
+
+::: fastapi.middleware.cors.CORSMiddleware
+
+Kann von `fastapi` importiert werden:
+
+```python
+from fastapi.middleware.cors import CORSMiddleware
+```
+
+::: fastapi.middleware.gzip.GZipMiddleware
+
+Kann von `fastapi` importiert werden:
+
+```python
+from fastapi.middleware.gzip import GZipMiddleware
+```
+
+::: fastapi.middleware.httpsredirect.HTTPSRedirectMiddleware
+
+Kann von `fastapi` importiert werden:
+
+```python
+from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware
+```
+
+::: fastapi.middleware.trustedhost.TrustedHostMiddleware
+
+Kann von `fastapi` importiert werden:
+
+```python
+from fastapi.middleware.trustedhost import TrustedHostMiddleware
+```
+
+::: fastapi.middleware.wsgi.WSGIMiddleware
+
+Kann von `fastapi` importiert werden:
+
+```python
+from fastapi.middleware.wsgi import WSGIMiddleware
+```
diff --git a/docs/de/docs/reference/openapi/docs.md b/docs/de/docs/reference/openapi/docs.md
new file mode 100644
index 000000000..3c19ba917
--- /dev/null
+++ b/docs/de/docs/reference/openapi/docs.md
@@ -0,0 +1,11 @@
+# OpenAPI `docs`
+
+Werkzeuge zur Verwaltung der automatischen OpenAPI-UI-Dokumentation, einschließlich Swagger UI (standardmäßig unter `/docs`) und ReDoc (standardmäßig unter `/redoc`).
+
+::: fastapi.openapi.docs.get_swagger_ui_html
+
+::: fastapi.openapi.docs.get_redoc_html
+
+::: fastapi.openapi.docs.get_swagger_ui_oauth2_redirect_html
+
+::: fastapi.openapi.docs.swagger_ui_default_parameters
diff --git a/docs/de/docs/reference/openapi/index.md b/docs/de/docs/reference/openapi/index.md
new file mode 100644
index 000000000..0ae3d67c6
--- /dev/null
+++ b/docs/de/docs/reference/openapi/index.md
@@ -0,0 +1,5 @@
+# OpenAPI
+
+Es gibt mehrere Werkzeuge zur Handhabung von OpenAPI.
+
+Normalerweise müssen Sie diese nicht verwenden, es sei denn, Sie haben einen bestimmten fortgeschrittenen Anwendungsfall, welcher das erfordert.
diff --git a/docs/de/docs/reference/openapi/models.md b/docs/de/docs/reference/openapi/models.md
new file mode 100644
index 000000000..64306b15f
--- /dev/null
+++ b/docs/de/docs/reference/openapi/models.md
@@ -0,0 +1,5 @@
+# OpenAPI-`models`
+
+OpenAPI Pydantic-Modelle, werden zum Generieren und Validieren der generierten OpenAPI verwendet.
+
+::: fastapi.openapi.models
diff --git a/docs/de/docs/reference/parameters.md b/docs/de/docs/reference/parameters.md
new file mode 100644
index 000000000..2638eaf48
--- /dev/null
+++ b/docs/de/docs/reference/parameters.md
@@ -0,0 +1,35 @@
+# Request-Parameter
+
+Hier die Referenzinformationen für die Request-Parameter.
+
+Dies sind die Sonderfunktionen, die Sie mittels `Annotated` in *Pfadoperation-Funktion*-Parameter oder Abhängigkeitsfunktionen einfügen können, um Daten aus dem Request abzurufen.
+
+Dies beinhaltet:
+
+* `Query()`
+* `Path()`
+* `Body()`
+* `Cookie()`
+* `Header()`
+* `Form()`
+* `File()`
+
+Sie können diese alle direkt von `fastapi` importieren:
+
+```python
+from fastapi import Body, Cookie, File, Form, Header, Path, Query
+```
+
+::: fastapi.Query
+
+::: fastapi.Path
+
+::: fastapi.Body
+
+::: fastapi.Cookie
+
+::: fastapi.Header
+
+::: fastapi.Form
+
+::: fastapi.File
diff --git a/docs/de/docs/reference/request.md b/docs/de/docs/reference/request.md
new file mode 100644
index 000000000..b170c1e40
--- /dev/null
+++ b/docs/de/docs/reference/request.md
@@ -0,0 +1,14 @@
+# `Request`-Klasse
+
+Sie können einen Parameter in einer *Pfadoperation-Funktion* oder einer Abhängigkeit als vom Typ `Request` deklarieren und dann direkt auf das Requestobjekt zugreifen, ohne jegliche Validierung, usw.
+
+Sie können es direkt von `fastapi` importieren:
+
+```python
+from fastapi import Request
+```
+
+!!! tip "Tipp"
+ Wenn Sie Abhängigkeiten definieren möchten, die sowohl mit HTTP als auch mit WebSockets kompatibel sein sollen, können Sie einen Parameter definieren, der eine `HTTPConnection` anstelle eines `Request` oder eines `WebSocket` akzeptiert.
+
+::: fastapi.Request
diff --git a/docs/de/docs/reference/response.md b/docs/de/docs/reference/response.md
new file mode 100644
index 000000000..215918931
--- /dev/null
+++ b/docs/de/docs/reference/response.md
@@ -0,0 +1,13 @@
+# `Response`-Klasse
+
+Sie können einen Parameter in einer *Pfadoperation-Funktion* oder einer Abhängigkeit als `Response` deklarieren und dann Daten für die Response wie Header oder Cookies festlegen.
+
+Diese können Sie auch direkt verwenden, um eine Instanz davon zu erstellen und diese von Ihren *Pfadoperationen* zurückzugeben.
+
+Sie können sie direkt von `fastapi` importieren:
+
+```python
+from fastapi import Response
+```
+
+::: fastapi.Response
diff --git a/docs/de/docs/reference/responses.md b/docs/de/docs/reference/responses.md
new file mode 100644
index 000000000..c0e9f07e7
--- /dev/null
+++ b/docs/de/docs/reference/responses.md
@@ -0,0 +1,164 @@
+# Benutzerdefinierte Responseklassen – File, HTML, Redirect, Streaming, usw.
+
+Es gibt mehrere benutzerdefinierte Responseklassen, von denen Sie eine Instanz erstellen und diese direkt von Ihren *Pfadoperationen* zurückgeben können.
+
+Lesen Sie mehr darüber in der [FastAPI-Dokumentation zu benutzerdefinierten Responses – HTML, Stream, Datei, andere](../advanced/custom-response.md).
+
+Sie können diese direkt von `fastapi.responses` importieren:
+
+```python
+from fastapi.responses import (
+ FileResponse,
+ HTMLResponse,
+ JSONResponse,
+ ORJSONResponse,
+ PlainTextResponse,
+ RedirectResponse,
+ Response,
+ StreamingResponse,
+ UJSONResponse,
+)
+```
+
+## FastAPI-Responses
+
+Es gibt einige benutzerdefinierte FastAPI-Responseklassen, welche Sie verwenden können, um die JSON-Performanz zu optimieren.
+
+::: fastapi.responses.UJSONResponse
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.ORJSONResponse
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+## Starlette-Responses
+
+::: fastapi.responses.FileResponse
+ options:
+ members:
+ - chunk_size
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.HTMLResponse
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.JSONResponse
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.PlainTextResponse
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.RedirectResponse
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.Response
+ options:
+ members:
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
+
+::: fastapi.responses.StreamingResponse
+ options:
+ members:
+ - body_iterator
+ - charset
+ - status_code
+ - media_type
+ - body
+ - background
+ - raw_headers
+ - render
+ - init_headers
+ - headers
+ - set_cookie
+ - delete_cookie
diff --git a/docs/de/docs/reference/security/index.md b/docs/de/docs/reference/security/index.md
new file mode 100644
index 000000000..4c2375f2f
--- /dev/null
+++ b/docs/de/docs/reference/security/index.md
@@ -0,0 +1,73 @@
+# Sicherheitstools
+
+Wenn Sie Abhängigkeiten mit OAuth2-Scopes deklarieren müssen, verwenden Sie `Security()`.
+
+Aber Sie müssen immer noch definieren, was das Dependable, das Callable ist, welches Sie als Parameter an `Depends()` oder `Security()` übergeben.
+
+Es gibt mehrere Tools, mit denen Sie diese Dependables erstellen können, und sie werden in OpenAPI integriert, sodass sie in der Oberfläche der automatischen Dokumentation angezeigt werden und von automatisch generierten Clients und SDKs, usw., verwendet werden können.
+
+Sie können sie von `fastapi.security` importieren:
+
+```python
+from fastapi.security import (
+ APIKeyCookie,
+ APIKeyHeader,
+ APIKeyQuery,
+ HTTPAuthorizationCredentials,
+ HTTPBasic,
+ HTTPBasicCredentials,
+ HTTPBearer,
+ HTTPDigest,
+ OAuth2,
+ OAuth2AuthorizationCodeBearer,
+ OAuth2PasswordBearer,
+ OAuth2PasswordRequestForm,
+ OAuth2PasswordRequestFormStrict,
+ OpenIdConnect,
+ SecurityScopes,
+)
+```
+
+## API-Schlüssel-Sicherheitsschemas
+
+::: fastapi.security.APIKeyCookie
+
+::: fastapi.security.APIKeyHeader
+
+::: fastapi.security.APIKeyQuery
+
+## HTTP-Authentifizierungsschemas
+
+::: fastapi.security.HTTPBasic
+
+::: fastapi.security.HTTPBearer
+
+::: fastapi.security.HTTPDigest
+
+## HTTP-Anmeldeinformationen
+
+::: fastapi.security.HTTPAuthorizationCredentials
+
+::: fastapi.security.HTTPBasicCredentials
+
+## OAuth2-Authentifizierung
+
+::: fastapi.security.OAuth2
+
+::: fastapi.security.OAuth2AuthorizationCodeBearer
+
+::: fastapi.security.OAuth2PasswordBearer
+
+## OAuth2-Passwortformulare
+
+::: fastapi.security.OAuth2PasswordRequestForm
+
+::: fastapi.security.OAuth2PasswordRequestFormStrict
+
+## OAuth2-Sicherheitsscopes in Abhängigkeiten
+
+::: fastapi.security.SecurityScopes
+
+## OpenID Connect
+
+::: fastapi.security.OpenIdConnect
diff --git a/docs/de/docs/reference/staticfiles.md b/docs/de/docs/reference/staticfiles.md
new file mode 100644
index 000000000..5629854c6
--- /dev/null
+++ b/docs/de/docs/reference/staticfiles.md
@@ -0,0 +1,13 @@
+# Statische Dateien – `StaticFiles`
+
+Sie können die `StaticFiles`-Klasse verwenden, um statische Dateien wie JavaScript, CSS, Bilder, usw. bereitzustellen.
+
+Lesen Sie mehr darüber in der [FastAPI-Dokumentation zu statischen Dateien](../tutorial/static-files.md).
+
+Sie können sie direkt von `fastapi.staticfiles` importieren:
+
+```python
+from fastapi.staticfiles import StaticFiles
+```
+
+::: fastapi.staticfiles.StaticFiles
diff --git a/docs/de/docs/reference/status.md b/docs/de/docs/reference/status.md
new file mode 100644
index 000000000..1d9458ee9
--- /dev/null
+++ b/docs/de/docs/reference/status.md
@@ -0,0 +1,36 @@
+# Statuscodes
+
+Sie können das Modul `status` von `fastapi` importieren:
+
+```python
+from fastapi import status
+```
+
+`status` wird direkt von Starlette bereitgestellt.
+
+Es enthält eine Gruppe benannter Konstanten (Variablen) mit ganzzahligen Statuscodes.
+
+Zum Beispiel:
+
+* 200: `status.HTTP_200_OK`
+* 403: `status.HTTP_403_FORBIDDEN`
+* usw.
+
+Es kann praktisch sein, schnell auf HTTP- (und WebSocket-)Statuscodes in Ihrer Anwendung zuzugreifen, indem Sie die automatische Vervollständigung für den Namen verwenden, ohne sich die Zahlen für die Statuscodes merken zu müssen.
+
+Lesen Sie mehr darüber in der [FastAPI-Dokumentation zu Response-Statuscodes](../tutorial/response-status-code.md).
+
+## Beispiel
+
+```python
+from fastapi import FastAPI, status
+
+app = FastAPI()
+
+
+@app.get("/items/", status_code=status.HTTP_418_IM_A_TEAPOT)
+def read_items():
+ return [{"name": "Plumbus"}, {"name": "Portal Gun"}]
+```
+
+::: fastapi.status
diff --git a/docs/de/docs/reference/templating.md b/docs/de/docs/reference/templating.md
new file mode 100644
index 000000000..c367a0179
--- /dev/null
+++ b/docs/de/docs/reference/templating.md
@@ -0,0 +1,13 @@
+# Templating – `Jinja2Templates`
+
+Sie können die `Jinja2Templates`-Klasse verwenden, um Jinja-Templates zu rendern.
+
+Lesen Sie mehr darüber in der [FastAPI-Dokumentation zu Templates](../advanced/templates.md).
+
+Sie können die Klasse direkt von `fastapi.templating` importieren:
+
+```python
+from fastapi.templating import Jinja2Templates
+```
+
+::: fastapi.templating.Jinja2Templates
diff --git a/docs/de/docs/reference/testclient.md b/docs/de/docs/reference/testclient.md
new file mode 100644
index 000000000..5bc089c05
--- /dev/null
+++ b/docs/de/docs/reference/testclient.md
@@ -0,0 +1,13 @@
+# Testclient – `TestClient`
+
+Sie können die `TestClient`-Klasse verwenden, um FastAPI-Anwendungen zu testen, ohne eine tatsächliche HTTP- und Socket-Verbindung zu erstellen, Sie kommunizieren einfach direkt mit dem FastAPI-Code.
+
+Lesen Sie mehr darüber in der [FastAPI-Dokumentation über Testen](../tutorial/testing.md).
+
+Sie können sie direkt von `fastapi.testclient` importieren:
+
+```python
+from fastapi.testclient import TestClient
+```
+
+::: fastapi.testclient.TestClient
diff --git a/docs/de/docs/reference/uploadfile.md b/docs/de/docs/reference/uploadfile.md
new file mode 100644
index 000000000..8556edf82
--- /dev/null
+++ b/docs/de/docs/reference/uploadfile.md
@@ -0,0 +1,22 @@
+# `UploadFile`-Klasse
+
+Sie können *Pfadoperation-Funktionsparameter* als Parameter vom Typ `UploadFile` definieren, um Dateien aus dem Request zu erhalten.
+
+Sie können es direkt von `fastapi` importieren:
+
+```python
+from fastapi import UploadFile
+```
+
+::: fastapi.UploadFile
+ options:
+ members:
+ - file
+ - filename
+ - size
+ - headers
+ - content_type
+ - read
+ - write
+ - seek
+ - close
diff --git a/docs/de/docs/reference/websockets.md b/docs/de/docs/reference/websockets.md
new file mode 100644
index 000000000..35657172c
--- /dev/null
+++ b/docs/de/docs/reference/websockets.md
@@ -0,0 +1,64 @@
+# WebSockets
+
+Bei der Definition von WebSockets deklarieren Sie normalerweise einen Parameter vom Typ `WebSocket` und können damit Daten vom Client lesen und an ihn senden. Er wird direkt von Starlette bereitgestellt, Sie können ihn aber von `fastapi` importieren:
+
+```python
+from fastapi import WebSocket
+```
+
+!!! tip "Tipp"
+ Wenn Sie Abhängigkeiten definieren möchten, die sowohl mit HTTP als auch mit WebSockets kompatibel sein sollen, können Sie einen Parameter definieren, der eine `HTTPConnection` anstelle eines `Request` oder eines `WebSocket` akzeptiert.
+
+::: fastapi.WebSocket
+ options:
+ members:
+ - scope
+ - app
+ - url
+ - base_url
+ - headers
+ - query_params
+ - path_params
+ - cookies
+ - client
+ - state
+ - url_for
+ - client_state
+ - application_state
+ - receive
+ - send
+ - accept
+ - receive_text
+ - receive_bytes
+ - receive_json
+ - iter_text
+ - iter_bytes
+ - iter_json
+ - send_text
+ - send_bytes
+ - send_json
+ - close
+
+Wenn ein Client die Verbindung trennt, wird eine `WebSocketDisconnect`-Exception ausgelöst, die Sie abfangen können.
+
+Sie können diese direkt von `fastapi` importieren:
+
+```python
+from fastapi import WebSocketDisconnect
+```
+
+::: fastapi.WebSocketDisconnect
+
+## WebSockets – zusätzliche Klassen
+
+Zusätzliche Klassen für die Handhabung von WebSockets.
+
+Werden direkt von Starlette bereitgestellt, Sie können sie jedoch von `fastapi` importieren:
+
+```python
+from fastapi.websockets import WebSocketDisconnect, WebSocketState
+```
+
+::: fastapi.websockets.WebSocketDisconnect
+
+::: fastapi.websockets.WebSocketState
diff --git a/docs/de/docs/resources/index.md b/docs/de/docs/resources/index.md
new file mode 100644
index 000000000..abf270d9f
--- /dev/null
+++ b/docs/de/docs/resources/index.md
@@ -0,0 +1,3 @@
+# Ressourcen
+
+Zusätzliche Ressourcen, externe Links, Artikel und mehr. ✈️
diff --git a/docs/de/docs/tutorial/bigger-applications.md b/docs/de/docs/tutorial/bigger-applications.md
new file mode 100644
index 000000000..66dee0a9a
--- /dev/null
+++ b/docs/de/docs/tutorial/bigger-applications.md
@@ -0,0 +1,506 @@
+# Größere Anwendungen – mehrere Dateien
+
+Wenn Sie eine Anwendung oder eine Web-API erstellen, ist es selten der Fall, dass Sie alles in einer einzigen Datei unterbringen können.
+
+**FastAPI** bietet ein praktisches Werkzeug zur Strukturierung Ihrer Anwendung bei gleichzeitiger Wahrung der Flexibilität.
+
+!!! info
+ Wenn Sie von Flask kommen, wäre dies das Äquivalent zu Flasks Blueprints.
+
+## Eine Beispiel-Dateistruktur
+
+Nehmen wir an, Sie haben eine Dateistruktur wie diese:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+│ ├── dependencies.py
+│ └── routers
+│ │ ├── __init__.py
+│ │ ├── items.py
+│ │ └── users.py
+│ └── internal
+│ ├── __init__.py
+│ └── admin.py
+```
+
+!!! tip "Tipp"
+ Es gibt mehrere `__init__.py`-Dateien: eine in jedem Verzeichnis oder Unterverzeichnis.
+
+ Das ermöglicht den Import von Code aus einer Datei in eine andere.
+
+ In `app/main.py` könnten Sie beispielsweise eine Zeile wie diese haben:
+
+ ```
+ from app.routers import items
+ ```
+
+* Das Verzeichnis `app` enthält alles. Und es hat eine leere Datei `app/__init__.py`, es handelt sich also um ein „Python-Package“ (eine Sammlung von „Python-Modulen“): `app`.
+* Es enthält eine Datei `app/main.py`. Da sie sich in einem Python-Package (einem Verzeichnis mit einer Datei `__init__.py`) befindet, ist sie ein „Modul“ dieses Packages: `app.main`.
+* Es gibt auch eine Datei `app/dependencies.py`, genau wie `app/main.py` ist sie ein „Modul“: `app.dependencies`.
+* Es gibt ein Unterverzeichnis `app/routers/` mit einer weiteren Datei `__init__.py`, es handelt sich also um ein „Python-Subpackage“: `app.routers`.
+* Die Datei `app/routers/items.py` befindet sich in einem Package, `app/routers/`, also ist sie ein Submodul: `app.routers.items`.
+* Das Gleiche gilt für `app/routers/users.py`, es ist ein weiteres Submodul: `app.routers.users`.
+* Es gibt auch ein Unterverzeichnis `app/internal/` mit einer weiteren Datei `__init__.py`, es handelt sich also um ein weiteres „Python-Subpackage“: `app.internal`.
+* Und die Datei `app/internal/admin.py` ist ein weiteres Submodul: `app.internal.admin`.
+
+
+
+## Den gleichen Router mehrmals mit unterschiedlichem `prefix` inkludieren
+
+Sie können `.include_router()` auch mehrmals mit *demselben* Router und unterschiedlichen Präfixen verwenden.
+
+Dies könnte beispielsweise nützlich sein, um dieselbe API unter verschiedenen Präfixen verfügbar zu machen, z. B. `/api/v1` und `/api/latest`.
+
+Dies ist eine fortgeschrittene Verwendung, die Sie möglicherweise nicht wirklich benötigen, aber für den Fall, dass Sie sie benötigen, ist sie vorhanden.
+
+## Einen `APIRouter` in einen anderen einfügen
+
+Auf die gleiche Weise, wie Sie einen `APIRouter` in eine `FastAPI`-Anwendung einbinden können, können Sie einen `APIRouter` in einen anderen `APIRouter` einbinden, indem Sie Folgendes verwenden:
+
+```Python
+router.include_router(other_router)
+```
+
+Stellen Sie sicher, dass Sie dies tun, bevor Sie `router` in die `FastAPI`-App einbinden, damit auch die *Pfadoperationen* von `other_router` inkludiert werden.
diff --git a/docs/de/docs/tutorial/body-fields.md b/docs/de/docs/tutorial/body-fields.md
new file mode 100644
index 000000000..643be7489
--- /dev/null
+++ b/docs/de/docs/tutorial/body-fields.md
@@ -0,0 +1,115 @@
+# Body – Felder
+
+So wie Sie zusätzliche Validation und Metadaten in Parametern der **Pfadoperation-Funktion** mittels `Query`, `Path` und `Body` deklarieren, können Sie auch innerhalb von Pydantic-Modellen zusätzliche Validation und Metadaten deklarieren, mittels Pydantics `Field`.
+
+## `Field` importieren
+
+Importieren Sie es zuerst:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="2"
+ {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001.py!}
+ ```
+
+!!! warning "Achtung"
+ Beachten Sie, dass `Field` direkt von `pydantic` importiert wird, nicht von `fastapi`, wie die anderen (`Query`, `Path`, `Body`, usw.)
+
+## Modellattribute deklarieren
+
+Dann können Sie `Field` mit Modellattributen deklarieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12-15"
+ {!> ../../../docs_src/body_fields/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9-12"
+ {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001.py!}
+ ```
+
+`Field` funktioniert genauso wie `Query`, `Path` und `Body`, es hat die gleichen Parameter, usw.
+
+!!! note "Technische Details"
+ Tatsächlich erstellen `Query`, `Path` und andere, die sie kennenlernen werden, Instanzen von Unterklassen einer allgemeinen Klasse `Param`, die ihrerseits eine Unterklasse von Pydantics `FieldInfo`-Klasse ist.
+
+ Und Pydantics `Field` gibt ebenfalls eine Instanz von `FieldInfo` zurück.
+
+ `Body` gibt auch Instanzen einer Unterklasse von `FieldInfo` zurück. Und später werden Sie andere sehen, die Unterklassen der `Body`-Klasse sind.
+
+ Denken Sie daran, dass `Query`, `Path` und andere von `fastapi` tatsächlich Funktionen sind, die spezielle Klassen zurückgeben.
+
+!!! tip "Tipp"
+ Beachten Sie, dass jedes Modellattribut mit einem Typ, Defaultwert und `Field` die gleiche Struktur hat wie ein Parameter einer Pfadoperation-Funktion, nur mit `Field` statt `Path`, `Query`, `Body`.
+
+## Zusätzliche Information hinzufügen
+
+Sie können zusätzliche Information in `Field`, `Query`, `Body`, usw. deklarieren. Und es wird im generierten JSON-Schema untergebracht.
+
+Sie werden später mehr darüber lernen, wie man zusätzliche Information unterbringt, wenn Sie lernen, Beispiele zu deklarieren.
+
+!!! warning "Achtung"
+ Extra-Schlüssel, die `Field` überreicht werden, werden auch im resultierenden OpenAPI-Schema Ihrer Anwendung gelistet. Da diese Schlüssel nicht notwendigerweise Teil der OpenAPI-Spezifikation sind, könnten einige OpenAPI-Tools, wie etwa [der OpenAPI-Validator](https://validator.swagger.io/), nicht mit Ihrem generierten Schema funktionieren.
+
+## Zusammenfassung
+
+Sie können Pydantics `Field` verwenden, um zusätzliche Validierungen und Metadaten für Modellattribute zu deklarieren.
+
+Sie können auch Extra-Schlüssel verwenden, um zusätzliche JSON-Schema-Metadaten zu überreichen.
diff --git a/docs/de/docs/tutorial/body-multiple-params.md b/docs/de/docs/tutorial/body-multiple-params.md
new file mode 100644
index 000000000..6a237243e
--- /dev/null
+++ b/docs/de/docs/tutorial/body-multiple-params.md
@@ -0,0 +1,308 @@
+# Body – Mehrere Parameter
+
+Jetzt, da wir gesehen haben, wie `Path` und `Query` verwendet werden, schauen wir uns fortgeschrittenere Verwendungsmöglichkeiten von Requestbody-Deklarationen an.
+
+## `Path`-, `Query`- und Body-Parameter vermischen
+
+Zuerst einmal, Sie können `Path`-, `Query`- und Requestbody-Parameter-Deklarationen frei mischen und **FastAPI** wird wissen, was zu tun ist.
+
+Und Sie können auch Body-Parameter als optional kennzeichnen, indem Sie den Defaultwert auf `None` setzen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="18-20"
+ {!> ../../../docs_src/body_multiple_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18-20"
+ {!> ../../../docs_src/body_multiple_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="19-21"
+ {!> ../../../docs_src/body_multiple_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17-19"
+ {!> ../../../docs_src/body_multiple_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19-21"
+ {!> ../../../docs_src/body_multiple_params/tutorial001.py!}
+ ```
+
+!!! note "Hinweis"
+ Beachten Sie, dass in diesem Fall das `item`, welches vom Body genommen wird, optional ist. Da es `None` als Defaultwert hat.
+
+## Mehrere Body-Parameter
+
+Im vorherigen Beispiel erwartete die *Pfadoperation* einen JSON-Body mit den Attributen eines `Item`s, etwa:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+}
+```
+
+Aber Sie können auch mehrere Body-Parameter deklarieren, z. B. `item` und `user`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/body_multiple_params/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/body_multiple_params/tutorial002.py!}
+ ```
+
+In diesem Fall wird **FastAPI** bemerken, dass es mehr als einen Body-Parameter in der Funktion gibt (zwei Parameter, die Pydantic-Modelle sind).
+
+Es wird deshalb die Parameternamen als Schlüssel (Feldnamen) im Body verwenden, und erwartet einen Body wie folgt:
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ },
+ "user": {
+ "username": "dave",
+ "full_name": "Dave Grohl"
+ }
+}
+```
+
+!!! note "Hinweis"
+ Beachten Sie, dass, obwohl `item` wie zuvor deklariert wurde, es nun unter einem Schlüssel `item` im Body erwartet wird.
+
+**FastAPI** wird die automatische Konvertierung des Requests übernehmen, sodass der Parameter `item` seinen spezifischen Inhalt bekommt, genau so wie der Parameter `user`.
+
+Es wird die Validierung dieser zusammengesetzten Daten übernehmen, und sie im OpenAPI-Schema und der automatischen Dokumentation dokumentieren.
+
+## Einzelne Werte im Body
+
+So wie `Query` und `Path` für Query- und Pfad-Parameter, hat **FastAPI** auch das Äquivalent `Body`, um Extra-Daten für Body-Parameter zu definieren.
+
+Zum Beispiel, das vorherige Modell erweiternd, könnten Sie entscheiden, dass Sie einen weiteren Schlüssel `importance` haben möchten, im selben Body, Seite an Seite mit `item` und `user`.
+
+Wenn Sie diesen Parameter einfach so hinzufügen, wird **FastAPI** annehmen, dass es ein Query-Parameter ist.
+
+Aber Sie können **FastAPI** instruieren, ihn als weiteren Body-Schlüssel zu erkennen, indem Sie `Body` verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="23"
+ {!> ../../../docs_src/body_multiple_params/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="23"
+ {!> ../../../docs_src/body_multiple_params/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24"
+ {!> ../../../docs_src/body_multiple_params/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/body_multiple_params/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/body_multiple_params/tutorial003.py!}
+ ```
+
+In diesem Fall erwartet **FastAPI** einen Body wie:
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ },
+ "user": {
+ "username": "dave",
+ "full_name": "Dave Grohl"
+ },
+ "importance": 5
+}
+```
+
+Wiederum wird es die Daten konvertieren, validieren, dokumentieren, usw.
+
+## Mehrere Body-Parameter und Query-Parameter
+
+Natürlich können Sie auch, wann immer Sie das brauchen, weitere Query-Parameter hinzufügen, zusätzlich zu den Body-Parametern.
+
+Da einfache Werte standardmäßig als Query-Parameter interpretiert werden, müssen Sie `Query` nicht explizit hinzufügen, Sie können einfach schreiben:
+
+```Python
+q: Union[str, None] = None
+```
+
+Oder in Python 3.10 und darüber:
+
+```Python
+q: str | None = None
+```
+
+Zum Beispiel:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="27"
+ {!> ../../../docs_src/body_multiple_params/tutorial004_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="27"
+ {!> ../../../docs_src/body_multiple_params/tutorial004_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="28"
+ {!> ../../../docs_src/body_multiple_params/tutorial004_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="25"
+ {!> ../../../docs_src/body_multiple_params/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="27"
+ {!> ../../../docs_src/body_multiple_params/tutorial004.py!}
+ ```
+
+!!! info
+ `Body` hat die gleichen zusätzlichen Validierungs- und Metadaten-Parameter wie `Query` und `Path` und andere, die Sie später kennenlernen.
+
+## Einen einzelnen Body-Parameter einbetten
+
+Nehmen wir an, Sie haben nur einen einzelnen `item`-Body-Parameter, ein Pydantic-Modell `Item`.
+
+Normalerweise wird **FastAPI** dann seinen JSON-Body direkt erwarten.
+
+Aber wenn Sie möchten, dass es einen JSON-Body erwartet, mit einem Schlüssel `item` und darin den Inhalt des Modells, so wie es das tut, wenn Sie mehrere Body-Parameter deklarieren, dann können Sie den speziellen `Body`-Parameter `embed` setzen:
+
+```Python
+item: Item = Body(embed=True)
+```
+
+so wie in:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/body_multiple_params/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/body_multiple_params/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body_multiple_params/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="15"
+ {!> ../../../docs_src/body_multiple_params/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/body_multiple_params/tutorial005.py!}
+ ```
+
+In diesem Fall erwartet **FastAPI** einen Body wie:
+
+```JSON hl_lines="2"
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ }
+}
+```
+
+statt:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+}
+```
+
+## Zusammenfassung
+
+Sie können mehrere Body-Parameter zu ihrer *Pfadoperation-Funktion* hinzufügen, obwohl ein Request nur einen einzigen Body enthalten kann.
+
+**FastAPI** wird sich darum kümmern, Ihnen korrekte Daten in Ihrer Funktion zu überreichen, und das korrekte Schema in der *Pfadoperation* zu validieren und zu dokumentieren.
+
+Sie können auch einzelne Werte deklarieren, die als Teil des Bodys empfangen werden.
+
+Und Sie können **FastAPI** instruieren, den Body in einem Schlüssel unterzubringen, selbst wenn nur ein einzelner Body-Parameter deklariert ist.
diff --git a/docs/de/docs/tutorial/body-nested-models.md b/docs/de/docs/tutorial/body-nested-models.md
new file mode 100644
index 000000000..a7a15a6c2
--- /dev/null
+++ b/docs/de/docs/tutorial/body-nested-models.md
@@ -0,0 +1,382 @@
+# Body – Verschachtelte Modelle
+
+Mit **FastAPI** können Sie (dank Pydantic) beliebig tief verschachtelte Modelle definieren, validieren und dokumentieren.
+
+## Listen als Felder
+
+Sie können ein Attribut als Kindtyp definieren, zum Beispiel eine Python-`list`e.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/body_nested_models/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/body_nested_models/tutorial001.py!}
+ ```
+
+Das bewirkt, dass `tags` eine Liste ist, wenngleich es nichts über den Typ der Elemente der Liste aussagt.
+
+## Listen mit Typ-Parametern als Felder
+
+Aber Python erlaubt es, Listen mit inneren Typen, auch „Typ-Parameter“ genannt, zu deklarieren.
+
+### `List` von `typing` importieren
+
+In Python 3.9 oder darüber können Sie einfach `list` verwenden, um diese Typannotationen zu deklarieren, wie wir unten sehen werden. 💡
+
+In Python-Versionen vor 3.9 (3.6 und darüber), müssen Sie zuerst `List` von Pythons Standardmodul `typing` importieren.
+
+```Python hl_lines="1"
+{!> ../../../docs_src/body_nested_models/tutorial002.py!}
+```
+
+### Eine `list`e mit einem Typ-Parameter deklarieren
+
+Um Typen wie `list`, `dict`, `tuple` mit inneren Typ-Parametern (inneren Typen) zu deklarieren:
+
+* Wenn Sie eine Python-Version kleiner als 3.9 verwenden, importieren Sie das Äquivalent zum entsprechenden Typ vom `typing`-Modul
+* Überreichen Sie den/die inneren Typ(en) von eckigen Klammern umschlossen, `[` und `]`, als „Typ-Parameter“
+
+In Python 3.9 wäre das:
+
+```Python
+my_list: list[str]
+```
+
+Und in Python-Versionen vor 3.9:
+
+```Python
+from typing import List
+
+my_list: List[str]
+```
+
+Das ist alles Standard-Python-Syntax für Typdeklarationen.
+
+Verwenden Sie dieselbe Standardsyntax für Modellattribute mit inneren Typen.
+
+In unserem Beispiel können wir also bewirken, dass `tags` spezifisch eine „Liste von Strings“ ist:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/body_nested_models/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/body_nested_models/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/body_nested_models/tutorial002.py!}
+ ```
+
+## Set-Typen
+
+Aber dann denken wir darüber nach und stellen fest, dass sich die Tags nicht wiederholen sollen, es sollen eindeutige Strings sein.
+
+Python hat einen Datentyp speziell für Mengen eindeutiger Dinge: das `set`.
+
+Deklarieren wir also `tags` als Set von Strings.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/body_nested_models/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/body_nested_models/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 14"
+ {!> ../../../docs_src/body_nested_models/tutorial003.py!}
+ ```
+
+Jetzt, selbst wenn Sie einen Request mit duplizierten Daten erhalten, werden diese zu einem Set eindeutiger Dinge konvertiert.
+
+Und wann immer Sie diese Daten ausgeben, selbst wenn die Quelle Duplikate hatte, wird es als Set von eindeutigen Dingen ausgegeben.
+
+Und es wird entsprechend annotiert/dokumentiert.
+
+## Verschachtelte Modelle
+
+Jedes Attribut eines Pydantic-Modells hat einen Typ.
+
+Aber dieser Typ kann selbst ein anderes Pydantic-Modell sein.
+
+Sie können also tief verschachtelte JSON-„Objekte“ deklarieren, mit spezifischen Attributnamen, -typen, und -validierungen.
+
+Alles das beliebig tief verschachtelt.
+
+### Ein Kindmodell definieren
+
+Wir können zum Beispiel ein `Image`-Modell definieren.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7-9"
+ {!> ../../../docs_src/body_nested_models/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9-11"
+ {!> ../../../docs_src/body_nested_models/tutorial004_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-11"
+ {!> ../../../docs_src/body_nested_models/tutorial004.py!}
+ ```
+
+### Das Kindmodell als Typ verwenden
+
+Und dann können wir es als Typ eines Attributes verwenden.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body_nested_models/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/body_nested_models/tutorial004_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/body_nested_models/tutorial004.py!}
+ ```
+
+Das würde bedeuten, dass **FastAPI** einen Body erwartet wie:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2,
+ "tags": ["rock", "metal", "bar"],
+ "image": {
+ "url": "http://example.com/baz.jpg",
+ "name": "The Foo live"
+ }
+}
+```
+
+Wiederum, nur mit dieser Deklaration erhalten Sie von **FastAPI**:
+
+* Editor-Unterstützung (Codevervollständigung, usw.), selbst für verschachtelte Modelle
+* Datenkonvertierung
+* Datenvalidierung
+* Automatische Dokumentation
+
+## Spezielle Typen und Validierungen
+
+Abgesehen von normalen einfachen Typen, wie `str`, `int`, `float`, usw. können Sie komplexere einfache Typen verwenden, die von `str` erben.
+
+Um alle Optionen kennenzulernen, die Sie haben, schauen Sie sich Pydantics Typübersicht an. Sie werden im nächsten Kapitel ein paar Beispiele kennenlernen.
+
+Da wir zum Beispiel im `Image`-Modell ein Feld `url` haben, können wir deklarieren, dass das eine Instanz von Pydantics `HttpUrl` sein soll, anstelle eines `str`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="2 8"
+ {!> ../../../docs_src/body_nested_models/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4 10"
+ {!> ../../../docs_src/body_nested_models/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4 10"
+ {!> ../../../docs_src/body_nested_models/tutorial005.py!}
+ ```
+
+Es wird getestet, ob der String eine gültige URL ist, und als solche wird er in JSON Schema / OpenAPI dokumentiert.
+
+## Attribute mit Listen von Kindmodellen
+
+Sie können Pydantic-Modelle auch als Typen innerhalb von `list`, `set`, usw. verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body_nested_models/tutorial006_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/body_nested_models/tutorial006_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/body_nested_models/tutorial006.py!}
+ ```
+
+Das wird einen JSON-Body erwarten (konvertieren, validieren, dokumentieren), wie:
+
+```JSON hl_lines="11"
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2,
+ "tags": [
+ "rock",
+ "metal",
+ "bar"
+ ],
+ "images": [
+ {
+ "url": "http://example.com/baz.jpg",
+ "name": "The Foo live"
+ },
+ {
+ "url": "http://example.com/dave.jpg",
+ "name": "The Baz"
+ }
+ ]
+}
+```
+
+!!! info
+ Beachten Sie, dass der `images`-Schlüssel jetzt eine Liste von Bild-Objekten hat.
+
+## Tief verschachtelte Modelle
+
+Sie können beliebig tief verschachtelte Modelle definieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7 12 18 21 25"
+ {!> ../../../docs_src/body_nested_models/tutorial007_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9 14 20 23 27"
+ {!> ../../../docs_src/body_nested_models/tutorial007_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 14 20 23 27"
+ {!> ../../../docs_src/body_nested_models/tutorial007.py!}
+ ```
+
+!!! info
+ Beachten Sie, wie `Offer` eine Liste von `Item`s hat, von denen jedes seinerseits eine optionale Liste von `Image`s hat.
+
+## Bodys aus reinen Listen
+
+Wenn Sie möchten, dass das äußerste Element des JSON-Bodys ein JSON-`array` (eine Python-`list`e) ist, können Sie den Typ im Funktionsparameter deklarieren, mit der gleichen Syntax wie in Pydantic-Modellen:
+
+```Python
+images: List[Image]
+```
+
+oder in Python 3.9 und darüber:
+
+```Python
+images: list[Image]
+```
+
+so wie in:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/body_nested_models/tutorial008_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="15"
+ {!> ../../../docs_src/body_nested_models/tutorial008.py!}
+ ```
+
+## Editor-Unterstützung überall
+
+Und Sie erhalten Editor-Unterstützung überall.
+
+Selbst für Dinge in Listen:
+
+
+
+Sie würden diese Editor-Unterstützung nicht erhalten, wenn Sie direkt mit `dict`, statt mit Pydantic-Modellen arbeiten würden.
+
+Aber Sie müssen sich auch nicht weiter um die Modelle kümmern, hereinkommende Dicts werden automatisch in sie konvertiert. Und was Sie zurückgeben, wird automatisch nach JSON konvertiert.
+
+## Bodys mit beliebigen `dict`s
+
+Sie können einen Body auch als `dict` deklarieren, mit Schlüsseln eines Typs und Werten eines anderen Typs.
+
+So brauchen Sie vorher nicht zu wissen, wie die Feld-/Attribut-Namen lauten (wie es bei Pydantic-Modellen der Fall wäre).
+
+Das ist nützlich, wenn Sie Schlüssel empfangen, deren Namen Sie nicht bereits kennen.
+
+---
+
+Ein anderer nützlicher Anwendungsfall ist, wenn Sie Schlüssel eines anderen Typs haben wollen, z. B. `int`.
+
+Das schauen wir uns mal an.
+
+Im folgenden Beispiel akzeptieren Sie irgendein `dict`, solange es `int`-Schlüssel und `float`-Werte hat.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/body_nested_models/tutorial009_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/body_nested_models/tutorial009.py!}
+ ```
+
+!!! tip "Tipp"
+ Bedenken Sie, dass JSON nur `str` als Schlüssel unterstützt.
+
+ Aber Pydantic hat automatische Datenkonvertierung.
+
+ Das bedeutet, dass Ihre API-Clients nur Strings senden können, aber solange diese Strings nur Zahlen enthalten, wird Pydantic sie konvertieren und validieren.
+
+ Und das `dict` welches Sie als `weights` erhalten, wird `int`-Schlüssel und `float`-Werte haben.
+
+## Zusammenfassung
+
+Mit **FastAPI** haben Sie die maximale Flexibilität von Pydantic-Modellen, während Ihr Code einfach, kurz und elegant bleibt.
+
+Aber mit all den Vorzügen:
+
+* Editor-Unterstützung (Codevervollständigung überall)
+* Datenkonvertierung (auch bekannt als Parsen, Serialisierung)
+* Datenvalidierung
+* Schema-Dokumentation
+* Automatische Dokumentation
diff --git a/docs/de/docs/tutorial/body-updates.md b/docs/de/docs/tutorial/body-updates.md
new file mode 100644
index 000000000..2b3716d6f
--- /dev/null
+++ b/docs/de/docs/tutorial/body-updates.md
@@ -0,0 +1,165 @@
+# Body – Aktualisierungen
+
+## Ersetzendes Aktualisieren mit `PUT`
+
+Um einen Artikel zu aktualisieren, können Sie die HTTP `PUT` Operation verwenden.
+
+Sie können den `jsonable_encoder` verwenden, um die empfangenen Daten in etwas zu konvertieren, das als JSON gespeichert werden kann (in z. B. einer NoSQL-Datenbank). Zum Beispiel, um ein `datetime` in einen `str` zu konvertieren.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="28-33"
+ {!> ../../../docs_src/body_updates/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="30-35"
+ {!> ../../../docs_src/body_updates/tutorial001_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="30-35"
+ {!> ../../../docs_src/body_updates/tutorial001.py!}
+ ```
+
+`PUT` wird verwendet, um Daten zu empfangen, die die existierenden Daten ersetzen sollen.
+
+### Warnung bezüglich des Ersetzens
+
+Das bedeutet, dass, wenn Sie den Artikel `bar` aktualisieren wollen, mittels `PUT` und folgendem Body:
+
+```Python
+{
+ "name": "Barz",
+ "price": 3,
+ "description": None,
+}
+```
+
+das Eingabemodell nun den Defaultwert `"tax": 10.5` hat, weil Sie das bereits gespeicherte Attribut `"tax": 20.2` nicht mit übergeben haben.
+
+Die Daten werden darum mit einem „neuen“ `tax`-Wert von `10.5` abgespeichert.
+
+## Teilweises Ersetzen mit `PATCH`
+
+Sie können auch die HTTP `PATCH` Operation verwenden, um Daten *teilweise* zu ersetzen.
+
+Das bedeutet, sie senden nur die Daten, die Sie aktualisieren wollen, der Rest bleibt unverändert.
+
+!!! note "Hinweis"
+ `PATCH` wird seltener verwendet und ist weniger bekannt als `PUT`.
+
+ Und viele Teams verwenden ausschließlich `PUT`, selbst für nur Teil-Aktualisierungen.
+
+ Es steht Ihnen **frei**, das zu verwenden, was Sie möchten, **FastAPI** legt Ihnen keine Einschränkungen auf.
+
+ Aber dieser Leitfaden zeigt Ihnen mehr oder weniger, wie die beiden normalerweise verwendet werden.
+
+### Pydantics `exclude_unset`-Parameter verwenden
+
+Wenn Sie Teil-Aktualisierungen entgegennehmen, ist der `exclude_unset`-Parameter in der `.model_dump()`-Methode von Pydantic-Modellen sehr nützlich.
+
+Wie in `item.model_dump(exclude_unset=True)`.
+
+!!! info
+ In Pydantic v1 hieß diese Methode `.dict()`, in Pydantic v2 wurde sie deprecated (aber immer noch unterstützt) und in `.model_dump()` umbenannt.
+
+ Die Beispiele hier verwenden `.dict()` für die Kompatibilität mit Pydantic v1, Sie sollten jedoch stattdessen `.model_dump()` verwenden, wenn Sie Pydantic v2 verwenden können.
+
+Das wird ein `dict` erstellen, mit nur den Daten, die gesetzt wurden als das `item`-Modell erstellt wurde, Defaultwerte ausgeschlossen.
+
+Sie können das verwenden, um ein `dict` zu erstellen, das nur die (im Request) gesendeten Daten enthält, ohne Defaultwerte:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="32"
+ {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="34"
+ {!> ../../../docs_src/body_updates/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="34"
+ {!> ../../../docs_src/body_updates/tutorial002.py!}
+ ```
+
+### Pydantics `update`-Parameter verwenden
+
+Jetzt können Sie eine Kopie des existierenden Modells mittels `.model_copy()` erstellen, wobei Sie dem `update`-Parameter ein `dict` mit den zu ändernden Daten übergeben.
+
+!!! info
+ In Pydantic v1 hieß diese Methode `.copy()`, in Pydantic v2 wurde sie deprecated (aber immer noch unterstützt) und in `.model_copy()` umbenannt.
+
+ Die Beispiele hier verwenden `.copy()` für die Kompatibilität mit Pydantic v1, Sie sollten jedoch stattdessen `.model_copy()` verwenden, wenn Sie Pydantic v2 verwenden können.
+
+Wie in `stored_item_model.model_copy(update=update_data)`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="33"
+ {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="35"
+ {!> ../../../docs_src/body_updates/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="35"
+ {!> ../../../docs_src/body_updates/tutorial002.py!}
+ ```
+
+### Rekapitulation zum teilweisen Ersetzen
+
+Zusammengefasst, um Teil-Ersetzungen vorzunehmen:
+
+* (Optional) verwenden Sie `PATCH` statt `PUT`.
+* Lesen Sie die bereits gespeicherten Daten aus.
+* Fügen Sie diese in ein Pydantic-Modell ein.
+* Erzeugen Sie aus dem empfangenen Modell ein `dict` ohne Defaultwerte (mittels `exclude_unset`).
+ * So ersetzen Sie nur die tatsächlich vom Benutzer gesetzten Werte, statt dass bereits gespeicherte Werte mit Defaultwerten des Modells überschrieben werden.
+* Erzeugen Sie eine Kopie ihres gespeicherten Modells, wobei Sie die Attribute mit den empfangenen Teil-Ersetzungen aktualisieren (mittels des `update`-Parameters).
+* Konvertieren Sie das kopierte Modell zu etwas, das in ihrer Datenbank gespeichert werden kann (indem Sie beispielsweise `jsonable_encoder` verwenden).
+ * Das ist vergleichbar dazu, die `.model_dump()`-Methode des Modells erneut aufzurufen, aber es wird sicherstellen, dass die Werte zu Daten konvertiert werden, die ihrerseits zu JSON konvertiert werden können, zum Beispiel `datetime` zu `str`.
+* Speichern Sie die Daten in Ihrer Datenbank.
+* Geben Sie das aktualisierte Modell zurück.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="28-35"
+ {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="30-37"
+ {!> ../../../docs_src/body_updates/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="30-37"
+ {!> ../../../docs_src/body_updates/tutorial002.py!}
+ ```
+
+!!! tip "Tipp"
+ Sie können tatsächlich die gleiche Technik mit einer HTTP `PUT` Operation verwenden.
+
+ Aber dieses Beispiel verwendet `PATCH`, da dieses für solche Anwendungsfälle geschaffen wurde.
+
+!!! note "Hinweis"
+ Beachten Sie, dass das hereinkommende Modell immer noch validiert wird.
+
+ Wenn Sie also Teil-Aktualisierungen empfangen wollen, die alle Attribute auslassen können, müssen Sie ein Modell haben, dessen Attribute alle als optional gekennzeichnet sind (mit Defaultwerten oder `None`).
+
+ Um zu unterscheiden zwischen Modellen für **Aktualisierungen**, mit lauter optionalen Werten, und solchen für die **Erzeugung**, mit benötigten Werten, können Sie die Techniken verwenden, die in [Extramodelle](extra-models.md){.internal-link target=_blank} beschrieben wurden.
diff --git a/docs/de/docs/tutorial/body.md b/docs/de/docs/tutorial/body.md
new file mode 100644
index 000000000..6611cb51a
--- /dev/null
+++ b/docs/de/docs/tutorial/body.md
@@ -0,0 +1,213 @@
+# Requestbody
+
+Wenn Sie Daten von einem Client (sagen wir, einem Browser) zu Ihrer API senden, dann senden Sie diese als einen **Requestbody** (Deutsch: Anfragekörper).
+
+Ein **Request**body sind Daten, die vom Client zu Ihrer API gesendet werden. Ein **Response**body (Deutsch: Antwortkörper) sind Daten, die Ihre API zum Client sendet.
+
+Ihre API sendet fast immer einen **Response**body. Aber Clients senden nicht unbedingt immer **Request**bodys (sondern nur Metadaten).
+
+Um einen **Request**body zu deklarieren, verwenden Sie Pydantic-Modelle mit allen deren Fähigkeiten und Vorzügen.
+
+!!! info
+ Um Daten zu versenden, sollten Sie eines von: `POST` (meistverwendet), `PUT`, `DELETE` oder `PATCH` verwenden.
+
+ Senden Sie einen Body mit einem `GET`-Request, dann führt das laut Spezifikation zu undefiniertem Verhalten. Trotzdem wird es von FastAPI unterstützt, für sehr komplexe/extreme Anwendungsfälle.
+
+ Da aber davon abgeraten wird, zeigt die interaktive Dokumentation mit Swagger-Benutzeroberfläche die Dokumentation für den Body auch nicht an, wenn `GET` verwendet wird. Dazwischengeschaltete Proxys unterstützen es möglicherweise auch nicht.
+
+## Importieren Sie Pydantics `BaseModel`
+
+Zuerst müssen Sie `BaseModel` von `pydantic` importieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="2"
+ {!> ../../../docs_src/body/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body/tutorial001.py!}
+ ```
+
+## Erstellen Sie Ihr Datenmodell
+
+Dann deklarieren Sie Ihr Datenmodell als eine Klasse, die von `BaseModel` erbt.
+
+Verwenden Sie Standard-Python-Typen für die Klassenattribute:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="5-9"
+ {!> ../../../docs_src/body/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7-11"
+ {!> ../../../docs_src/body/tutorial001.py!}
+ ```
+
+Wie auch bei Query-Parametern gilt, wenn ein Modellattribut einen Defaultwert hat, ist das Attribut nicht erforderlich. Ansonsten ist es erforderlich. Verwenden Sie `None`, um es als optional zu kennzeichnen.
+
+Zum Beispiel deklariert das obige Modell ein JSON "`object`" (oder Python-`dict`) wie dieses:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "An optional description",
+ "price": 45.2,
+ "tax": 3.5
+}
+```
+
+Da `description` und `tax` optional sind (mit `None` als Defaultwert), wäre folgendes JSON "`object`" auch gültig:
+
+```JSON
+{
+ "name": "Foo",
+ "price": 45.2
+}
+```
+
+## Deklarieren Sie es als Parameter
+
+Um es zu Ihrer *Pfadoperation* hinzuzufügen, deklarieren Sie es auf die gleiche Weise, wie Sie Pfad- und Query-Parameter deklariert haben:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/body/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body/tutorial001.py!}
+ ```
+
+... und deklarieren Sie seinen Typ als das Modell, welches Sie erstellt haben, `Item`.
+
+## Resultate
+
+Mit nur dieser Python-Typdeklaration, wird **FastAPI**:
+
+* Den Requestbody als JSON lesen.
+* Die entsprechenden Typen konvertieren (falls nötig).
+* Diese Daten validieren.
+ * Wenn die Daten ungültig sind, einen klar lesbaren Fehler zurückgeben, der anzeigt, wo und was die inkorrekten Daten waren.
+* Ihnen die erhaltenen Daten im Parameter `item` übergeben.
+ * Da Sie diesen in der Funktion als vom Typ `Item` deklariert haben, erhalten Sie die ganze Editor-Unterstützung (Autovervollständigung, usw.) für alle Attribute und deren Typen.
+* Eine JSON Schema Definition für Ihr Modell generieren, welche Sie überall sonst verwenden können, wenn es für Ihr Projekt Sinn macht.
+* Diese Schemas werden Teil des generierten OpenAPI-Schemas und werden von den UIs der automatischen Dokumentation verwendet.
+
+## Automatische Dokumentation
+
+Die JSON-Schemas Ihrer Modelle werden Teil ihrer OpenAPI-generierten Schemas und werden in der interaktiven API Dokumentation angezeigt:
+
+
+
+Und werden auch verwendet in der API-Dokumentation innerhalb jeder *Pfadoperation*, welche sie braucht:
+
+
+
+## Editor Unterstützung
+
+In Ihrem Editor, innerhalb Ihrer Funktion, erhalten Sie Typhinweise und Code-Vervollständigung überall (was nicht der Fall wäre, wenn Sie ein `dict` anstelle eines Pydantic Modells erhalten hätten):
+
+
+
+Sie bekommen auch Fehler-Meldungen für inkorrekte Typoperationen:
+
+
+
+Das ist nicht zufällig so, das ganze Framework wurde um dieses Design herum aufgebaut.
+
+Und es wurde in der Designphase gründlich getestet, vor der Implementierung, um sicherzustellen, dass es mit jedem Editor funktioniert.
+
+Es gab sogar ein paar Änderungen an Pydantic selbst, um das zu unterstützen.
+
+Die vorherigen Screenshots zeigten Visual Studio Code.
+
+Aber Sie bekommen die gleiche Editor-Unterstützung in PyCharm und in den meisten anderen Python-Editoren:
+
+
+
+!!! tip "Tipp"
+ Wenn Sie PyCharm als Ihren Editor verwenden, probieren Sie das Pydantic PyCharm Plugin aus.
+
+ Es verbessert die Editor-Unterstützung für Pydantic-Modelle, mit:
+
+ * Code-Vervollständigung
+ * Typüberprüfungen
+ * Refaktorisierung
+ * Suchen
+ * Inspektionen
+
+## Das Modell verwenden
+
+Innerhalb der Funktion können Sie alle Attribute des Modells direkt verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/body/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="21"
+ {!> ../../../docs_src/body/tutorial002.py!}
+ ```
+
+## Requestbody- + Pfad-Parameter
+
+Sie können Pfad- und Requestbody-Parameter gleichzeitig deklarieren.
+
+**FastAPI** erkennt, dass Funktionsparameter, die mit Pfad-Parametern übereinstimmen, **vom Pfad genommen** werden sollen, und dass Funktionsparameter, welche Pydantic-Modelle sind, **vom Requestbody genommen** werden sollen.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="15-16"
+ {!> ../../../docs_src/body/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17-18"
+ {!> ../../../docs_src/body/tutorial003.py!}
+ ```
+
+## Requestbody- + Pfad- + Query-Parameter
+
+Sie können auch zur gleichen Zeit **Body-**, **Pfad-** und **Query-Parameter** deklarieren.
+
+**FastAPI** wird jeden Parameter korrekt erkennen und die Daten vom richtigen Ort holen.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/body/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body/tutorial004.py!}
+ ```
+
+Die Funktionsparameter werden wie folgt erkannt:
+
+* Wenn der Parameter auch im **Pfad** deklariert wurde, wird er als Pfad-Parameter interpretiert.
+* Wenn der Parameter ein **einfacher Typ** ist (wie `int`, `float`, `str`, `bool`, usw.), wird er als **Query**-Parameter interpretiert.
+* Wenn der Parameter vom Typ eines **Pydantic-Modells** ist, wird er als Request**body** interpretiert.
+
+!!! note "Hinweis"
+ FastAPI weiß, dass der Wert von `q` nicht erforderlich ist, wegen des definierten Defaultwertes `= None`
+
+ Das `Union` in `Union[str, None]` wird von FastAPI nicht verwendet, aber es erlaubt Ihrem Editor, Sie besser zu unterstützen und Fehler zu erkennen.
+
+## Ohne Pydantic
+
+Wenn Sie keine Pydantic-Modelle verwenden wollen, können Sie auch **Body**-Parameter nehmen. Siehe die Dokumentation unter [Body – Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=\_blank}.
diff --git a/docs/de/docs/tutorial/cookie-params.md b/docs/de/docs/tutorial/cookie-params.md
new file mode 100644
index 000000000..c95e28c7d
--- /dev/null
+++ b/docs/de/docs/tutorial/cookie-params.md
@@ -0,0 +1,97 @@
+# Cookie-Parameter
+
+So wie `Query`- und `Path`-Parameter können Sie auch Cookie-Parameter definieren.
+
+## `Cookie` importieren
+
+Importieren Sie zuerst `Cookie`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+## `Cookie`-Parameter deklarieren
+
+Dann deklarieren Sie Ihre Cookie-Parameter, auf die gleiche Weise, wie Sie auch `Path`- und `Query`-Parameter deklarieren.
+
+Der erste Wert ist der Typ. Sie können `Cookie` die gehabten Extra Validierungs- und Beschreibungsparameter hinzufügen. Danach können Sie einen Defaultwert vergeben:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+!!! note "Technische Details"
+ `Cookie` ist eine Schwesterklasse von `Path` und `Query`. Sie erbt von derselben gemeinsamen `Param`-Elternklasse.
+
+ Aber erinnern Sie sich, dass, wenn Sie `Query`, `Path`, `Cookie` und andere von `fastapi` importieren, diese tatsächlich Funktionen sind, welche spezielle Klassen zurückgeben.
+
+!!! info
+ Um Cookies zu deklarieren, müssen Sie `Cookie` verwenden, da diese Parameter sonst als Query-Parameter interpretiert werden würden.
+
+## Zusammenfassung
+
+Deklarieren Sie Cookies mittels `Cookie`, auf die gleiche Weise wie bei `Query` und `Path`.
diff --git a/docs/de/docs/tutorial/dependencies/classes-as-dependencies.md b/docs/de/docs/tutorial/dependencies/classes-as-dependencies.md
new file mode 100644
index 000000000..9faaed715
--- /dev/null
+++ b/docs/de/docs/tutorial/dependencies/classes-as-dependencies.md
@@ -0,0 +1,481 @@
+# Klassen als Abhängigkeiten
+
+Bevor wir tiefer in das **Dependency Injection** System eintauchen, lassen Sie uns das vorherige Beispiel verbessern.
+
+## Ein `dict` aus dem vorherigen Beispiel
+
+Im vorherigen Beispiel haben wir ein `dict` von unserer Abhängigkeit („Dependable“) zurückgegeben:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+Aber dann haben wir ein `dict` im Parameter `commons` der *Pfadoperation-Funktion*.
+
+Und wir wissen, dass Editoren nicht viel Unterstützung (wie etwa Code-Vervollständigung) für `dict`s bieten können, weil sie ihre Schlüssel- und Werttypen nicht kennen.
+
+Das können wir besser machen ...
+
+## Was macht eine Abhängigkeit aus
+
+Bisher haben Sie Abhängigkeiten gesehen, die als Funktionen deklariert wurden.
+
+Das ist jedoch nicht die einzige Möglichkeit, Abhängigkeiten zu deklarieren (obwohl es wahrscheinlich die gebräuchlichste ist).
+
+Der springende Punkt ist, dass eine Abhängigkeit aufrufbar („callable“) sein sollte.
+
+Ein „**Callable**“ in Python ist etwas, das wie eine Funktion aufgerufen werden kann („to call“).
+
+Wenn Sie also ein Objekt `something` haben (das möglicherweise _keine_ Funktion ist) und Sie es wie folgt aufrufen (ausführen) können:
+
+```Python
+something()
+```
+
+oder
+
+```Python
+something(some_argument, some_keyword_argument="foo")
+```
+
+dann ist das ein „Callable“ (ein „Aufrufbares“).
+
+## Klassen als Abhängigkeiten
+
+Möglicherweise stellen Sie fest, dass Sie zum Erstellen einer Instanz einer Python-Klasse die gleiche Syntax verwenden.
+
+Zum Beispiel:
+
+```Python
+class Cat:
+ def __init__(self, name: str):
+ self.name = name
+
+
+fluffy = Cat(name="Mr Fluffy")
+```
+
+In diesem Fall ist `fluffy` eine Instanz der Klasse `Cat`.
+
+Und um `fluffy` zu erzeugen, rufen Sie `Cat` auf.
+
+Eine Python-Klasse ist also auch ein **Callable**.
+
+Darum können Sie in **FastAPI** auch eine Python-Klasse als Abhängigkeit verwenden.
+
+Was FastAPI tatsächlich prüft, ist, ob es sich um ein „Callable“ (Funktion, Klasse oder irgendetwas anderes) handelt und ob die Parameter definiert sind.
+
+Wenn Sie **FastAPI** ein „Callable“ als Abhängigkeit übergeben, analysiert es die Parameter dieses „Callables“ und verarbeitet sie auf die gleiche Weise wie die Parameter einer *Pfadoperation-Funktion*. Einschließlich Unterabhängigkeiten.
+
+Das gilt auch für Callables ohne Parameter. So wie es auch für *Pfadoperation-Funktionen* ohne Parameter gilt.
+
+Dann können wir das „Dependable“ `common_parameters` der Abhängigkeit von oben in die Klasse `CommonQueryParams` ändern:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="11-15"
+ {!> ../../../docs_src/dependencies/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11-15"
+ {!> ../../../docs_src/dependencies/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12-16"
+ {!> ../../../docs_src/dependencies/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9-13"
+ {!> ../../../docs_src/dependencies/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11-15"
+ {!> ../../../docs_src/dependencies/tutorial002.py!}
+ ```
+
+Achten Sie auf die Methode `__init__`, die zum Erstellen der Instanz der Klasse verwendet wird:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/dependencies/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/dependencies/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/dependencies/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/dependencies/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/dependencies/tutorial002.py!}
+ ```
+
+... sie hat die gleichen Parameter wie unsere vorherige `common_parameters`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="6"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+Diese Parameter werden von **FastAPI** verwendet, um die Abhängigkeit „aufzulösen“.
+
+In beiden Fällen wird sie haben:
+
+* Einen optionalen `q`-Query-Parameter, der ein `str` ist.
+* Einen `skip`-Query-Parameter, der ein `int` ist, mit einem Defaultwert `0`.
+* Einen `limit`-Query-Parameter, der ein `int` ist, mit einem Defaultwert `100`.
+
+In beiden Fällen werden die Daten konvertiert, validiert, im OpenAPI-Schema dokumentiert, usw.
+
+## Verwendung
+
+Jetzt können Sie Ihre Abhängigkeit mithilfe dieser Klasse deklarieren.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/dependencies/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial002.py!}
+ ```
+
+**FastAPI** ruft die Klasse `CommonQueryParams` auf. Dadurch wird eine „Instanz“ dieser Klasse erstellt und die Instanz wird als Parameter `commons` an Ihre Funktion überreicht.
+
+## Typannotation vs. `Depends`
+
+Beachten Sie, wie wir `CommonQueryParams` im obigen Code zweimal schreiben:
+
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ commons: CommonQueryParams = Depends(CommonQueryParams)
+ ```
+
+Das letzte `CommonQueryParams`, in:
+
+```Python
+... Depends(CommonQueryParams)
+```
+
+... ist das, was **FastAPI** tatsächlich verwendet, um die Abhängigkeit zu ermitteln.
+
+Aus diesem extrahiert FastAPI die deklarierten Parameter, und dieses ist es, was FastAPI auch aufruft.
+
+---
+
+In diesem Fall hat das erste `CommonQueryParams` in:
+
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, ...
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ commons: CommonQueryParams ...
+ ```
+
+... keine besondere Bedeutung für **FastAPI**. FastAPI verwendet es nicht für die Datenkonvertierung, -validierung, usw. (da es dafür `Depends(CommonQueryParams)` verwendet).
+
+Sie könnten tatsächlich einfach schreiben:
+
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[Any, Depends(CommonQueryParams)]
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ commons = Depends(CommonQueryParams)
+ ```
+
+... wie in:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/dependencies/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial003.py!}
+ ```
+
+Es wird jedoch empfohlen, den Typ zu deklarieren, da Ihr Editor so weiß, was als Parameter `commons` übergeben wird, und Ihnen dann bei der Codevervollständigung, Typprüfungen, usw. helfen kann:
+
+
+
+## Abkürzung
+
+Aber Sie sehen, dass wir hier etwas Codeduplizierung haben, indem wir `CommonQueryParams` zweimal schreiben:
+
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ commons: CommonQueryParams = Depends(CommonQueryParams)
+ ```
+
+**FastAPI** bietet eine Abkürzung für diese Fälle, wo die Abhängigkeit *speziell* eine Klasse ist, welche **FastAPI** aufruft, um eine Instanz der Klasse selbst zu erstellen.
+
+In diesem speziellen Fall können Sie Folgendes tun:
+
+Anstatt zu schreiben:
+
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ commons: CommonQueryParams = Depends(CommonQueryParams)
+ ```
+
+... schreiben Sie:
+
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, Depends()]
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ commons: CommonQueryParams = Depends()
+ ```
+
+Sie deklarieren die Abhängigkeit als Typ des Parameters und verwenden `Depends()` ohne Parameter, anstatt die vollständige Klasse *erneut* in `Depends(CommonQueryParams)` schreiben zu müssen.
+
+Dasselbe Beispiel würde dann so aussehen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial004_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial004_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/dependencies/tutorial004_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial004.py!}
+ ```
+
+... und **FastAPI** wird wissen, was zu tun ist.
+
+!!! tip "Tipp"
+ Wenn Sie das eher verwirrt, als Ihnen zu helfen, ignorieren Sie es, Sie *brauchen* es nicht.
+
+ Es ist nur eine Abkürzung. Es geht **FastAPI** darum, Ihnen dabei zu helfen, Codeverdoppelung zu minimieren.
diff --git a/docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md b/docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
new file mode 100644
index 000000000..2919aebaf
--- /dev/null
+++ b/docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
@@ -0,0 +1,139 @@
+# Abhängigkeiten in Pfadoperation-Dekoratoren
+
+Manchmal benötigen Sie den Rückgabewert einer Abhängigkeit innerhalb Ihrer *Pfadoperation-Funktion* nicht wirklich.
+
+Oder die Abhängigkeit gibt keinen Wert zurück.
+
+Aber Sie müssen Sie trotzdem ausführen/auflösen.
+
+In diesen Fällen können Sie, anstatt einen Parameter der *Pfadoperation-Funktion* mit `Depends` zu deklarieren, eine `list`e von `dependencies` zum *Pfadoperation-Dekorator* hinzufügen.
+
+## `dependencies` zum *Pfadoperation-Dekorator* hinzufügen
+
+Der *Pfadoperation-Dekorator* erhält ein optionales Argument `dependencies`.
+
+Es sollte eine `list`e von `Depends()` sein:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+Diese Abhängigkeiten werden auf die gleiche Weise wie normale Abhängigkeiten ausgeführt/aufgelöst. Aber ihr Wert (falls sie einen zurückgeben) wird nicht an Ihre *Pfadoperation-Funktion* übergeben.
+
+!!! tip "Tipp"
+ Einige Editoren prüfen, ob Funktionsparameter nicht verwendet werden, und zeigen das als Fehler an.
+
+ Wenn Sie `dependencies` im *Pfadoperation-Dekorator* verwenden, stellen Sie sicher, dass sie ausgeführt werden, während gleichzeitig Ihr Editor/Ihre Tools keine Fehlermeldungen ausgeben.
+
+ Damit wird auch vermieden, neue Entwickler möglicherweise zu verwirren, die einen nicht verwendeten Parameter in Ihrem Code sehen und ihn für unnötig halten könnten.
+
+!!! info
+ In diesem Beispiel verwenden wir zwei erfundene benutzerdefinierte Header `X-Key` und `X-Token`.
+
+ Aber in realen Fällen würden Sie bei der Implementierung von Sicherheit mehr Vorteile durch die Verwendung der integrierten [Sicherheits-Werkzeuge (siehe nächstes Kapitel)](../security/index.md){.internal-link target=_blank} erzielen.
+
+## Abhängigkeitsfehler und -Rückgabewerte
+
+Sie können dieselben Abhängigkeits-*Funktionen* verwenden, die Sie normalerweise verwenden.
+
+### Abhängigkeitsanforderungen
+
+Sie können Anforderungen für einen Request (wie Header) oder andere Unterabhängigkeiten deklarieren:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7 12"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="6 11"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+### Exceptions auslösen
+
+Die Abhängigkeiten können Exceptions `raise`n, genau wie normale Abhängigkeiten:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 14"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+### Rückgabewerte
+
+Und sie können Werte zurückgeben oder nicht, die Werte werden nicht verwendet.
+
+Sie können also eine normale Abhängigkeit (die einen Wert zurückgibt), die Sie bereits an anderer Stelle verwenden, wiederverwenden, und auch wenn der Wert nicht verwendet wird, wird die Abhängigkeit ausgeführt:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9 14"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+## Abhängigkeiten für eine Gruppe von *Pfadoperationen*
+
+Wenn Sie später lesen, wie Sie größere Anwendungen strukturieren ([Größere Anwendungen – Mehrere Dateien](../../tutorial/bigger-applications.md){.internal-link target=_blank}), möglicherweise mit mehreren Dateien, lernen Sie, wie Sie einen einzelnen `dependencies`-Parameter für eine Gruppe von *Pfadoperationen* deklarieren.
+
+## Globale Abhängigkeiten
+
+Als Nächstes werden wir sehen, wie man Abhängigkeiten zur gesamten `FastAPI`-Anwendung hinzufügt, sodass sie für jede *Pfadoperation* gelten.
diff --git a/docs/de/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/de/docs/tutorial/dependencies/dependencies-with-yield.md
new file mode 100644
index 000000000..e29e87156
--- /dev/null
+++ b/docs/de/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -0,0 +1,284 @@
+# Abhängigkeiten mit yield
+
+FastAPI unterstützt Abhängigkeiten, die nach Abschluss einige zusätzliche Schritte ausführen.
+
+Verwenden Sie dazu `yield` statt `return` und schreiben Sie die zusätzlichen Schritte / den zusätzlichen Code danach.
+
+!!! tip "Tipp"
+ Stellen Sie sicher, dass Sie `yield` nur einmal pro Abhängigkeit verwenden.
+
+!!! note "Technische Details"
+ Jede Funktion, die dekoriert werden kann mit:
+
+ * `@contextlib.contextmanager` oder
+ * `@contextlib.asynccontextmanager`
+
+ kann auch als gültige **FastAPI**-Abhängigkeit verwendet werden.
+
+ Tatsächlich verwendet FastAPI diese beiden Dekoratoren intern.
+
+## Eine Datenbank-Abhängigkeit mit `yield`.
+
+Sie könnten damit beispielsweise eine Datenbanksession erstellen und diese nach Abschluss schließen.
+
+Nur der Code vor und einschließlich der `yield`-Anweisung wird ausgeführt, bevor eine Response erzeugt wird:
+
+```Python hl_lines="2-4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+Der ge`yield`ete Wert ist das, was in *Pfadoperationen* und andere Abhängigkeiten eingefügt wird:
+
+```Python hl_lines="4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+Der auf die `yield`-Anweisung folgende Code wird ausgeführt, nachdem die Response gesendet wurde:
+
+```Python hl_lines="5-6"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+!!! tip "Tipp"
+ Sie können `async`hrone oder reguläre Funktionen verwenden.
+
+ **FastAPI** wird bei jeder das Richtige tun, so wie auch bei normalen Abhängigkeiten.
+
+## Eine Abhängigkeit mit `yield` und `try`.
+
+Wenn Sie einen `try`-Block in einer Abhängigkeit mit `yield` verwenden, empfangen Sie alle Exceptions, die bei Verwendung der Abhängigkeit geworfen wurden.
+
+Wenn beispielsweise ein Code irgendwann in der Mitte, in einer anderen Abhängigkeit oder in einer *Pfadoperation*, ein „Rollback“ einer Datenbanktransaktion oder einen anderen Fehler verursacht, empfangen Sie die resultierende Exception in Ihrer Abhängigkeit.
+
+Sie können also mit `except SomeException` diese bestimmte Exception innerhalb der Abhängigkeit handhaben.
+
+Auf die gleiche Weise können Sie `finally` verwenden, um sicherzustellen, dass die Exit-Schritte ausgeführt werden, unabhängig davon, ob eine Exception geworfen wurde oder nicht.
+
+```Python hl_lines="3 5"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+## Unterabhängigkeiten mit `yield`.
+
+Sie können Unterabhängigkeiten und „Bäume“ von Unterabhängigkeiten beliebiger Größe und Form haben, und einige oder alle davon können `yield` verwenden.
+
+**FastAPI** stellt sicher, dass der „Exit-Code“ in jeder Abhängigkeit mit `yield` in der richtigen Reihenfolge ausgeführt wird.
+
+Beispielsweise kann `dependency_c` von `dependency_b` und `dependency_b` von `dependency_a` abhängen:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="6 14 22"
+ {!> ../../../docs_src/dependencies/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="5 13 21"
+ {!> ../../../docs_src/dependencies/tutorial008_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="4 12 20"
+ {!> ../../../docs_src/dependencies/tutorial008.py!}
+ ```
+
+Und alle können `yield` verwenden.
+
+In diesem Fall benötigt `dependency_c` zum Ausführen seines Exit-Codes, dass der Wert von `dependency_b` (hier `dep_b` genannt) verfügbar ist.
+
+Und wiederum benötigt `dependency_b` den Wert von `dependency_a` (hier `dep_a` genannt) für seinen Exit-Code.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18-19 26-27"
+ {!> ../../../docs_src/dependencies/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17-18 25-26"
+ {!> ../../../docs_src/dependencies/tutorial008_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="16-17 24-25"
+ {!> ../../../docs_src/dependencies/tutorial008.py!}
+ ```
+
+Auf die gleiche Weise könnten Sie einige Abhängigkeiten mit `yield` und einige andere Abhängigkeiten mit `return` haben, und alle können beliebig voneinander abhängen.
+
+Und Sie könnten eine einzelne Abhängigkeit haben, die auf mehreren ge`yield`eten Abhängigkeiten basiert, usw.
+
+Sie können beliebige Kombinationen von Abhängigkeiten haben.
+
+**FastAPI** stellt sicher, dass alles in der richtigen Reihenfolge ausgeführt wird.
+
+!!! note "Technische Details"
+ Dieses funktioniert dank Pythons Kontextmanager.
+
+ **FastAPI** verwendet sie intern, um das zu erreichen.
+
+## Abhängigkeiten mit `yield` und `HTTPException`.
+
+Sie haben gesehen, dass Ihre Abhängigkeiten `yield` verwenden können und `try`-Blöcke haben können, die Exceptions abfangen.
+
+Auf die gleiche Weise könnten Sie im Exit-Code nach dem `yield` eine `HTTPException` oder ähnliches auslösen.
+
+!!! tip "Tipp"
+
+ Dies ist eine etwas fortgeschrittene Technik, die Sie in den meisten Fällen nicht wirklich benötigen, da Sie Exceptions (einschließlich `HTTPException`) innerhalb des restlichen Anwendungscodes auslösen können, beispielsweise in der *Pfadoperation-Funktion*.
+
+ Aber es ist für Sie da, wenn Sie es brauchen. 🤓
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18-22 31"
+ {!> ../../../docs_src/dependencies/tutorial008b_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17-21 30"
+ {!> ../../../docs_src/dependencies/tutorial008b_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="16-20 29"
+ {!> ../../../docs_src/dependencies/tutorial008b.py!}
+ ```
+
+Eine Alternative zum Abfangen von Exceptions (und möglicherweise auch zum Auslösen einer weiteren `HTTPException`) besteht darin, einen [benutzerdefinierten Exceptionhandler](../handling-errors.md#benutzerdefinierte-exceptionhandler-definieren){.internal-link target=_blank} zu erstellen.
+
+## Ausführung von Abhängigkeiten mit `yield`
+
+Die Ausführungsreihenfolge ähnelt mehr oder weniger dem folgenden Diagramm. Die Zeit verläuft von oben nach unten. Und jede Spalte ist einer der interagierenden oder Code-ausführenden Teilnehmer.
+
+```mermaid
+sequenceDiagram
+
+participant client as Client
+participant handler as Exceptionhandler
+participant dep as Abhängigkeit mit yield
+participant operation as Pfadoperation
+participant tasks as Hintergrundtasks
+
+ Note over client,operation: Kann Exceptions auslösen, inklusive HTTPException
+ client ->> dep: Startet den Request
+ Note over dep: Führt den Code bis zum yield aus
+ opt Löst Exception aus
+ dep -->> handler: Löst Exception aus
+ handler -->> client: HTTP-Error-Response
+ end
+ dep ->> operation: Führt Abhängigkeit aus, z. B. DB-Session
+ opt Löst aus
+ operation -->> dep: Löst Exception aus (z. B. HTTPException)
+ opt Handhabt
+ dep -->> dep: Kann Exception abfangen, eine neue HTTPException auslösen, andere Exceptions auslösen
+ dep -->> handler: Leitet Exception automatisch weiter
+ end
+ handler -->> client: HTTP-Error-Response
+ end
+ operation ->> client: Sendet Response an Client
+ Note over client,operation: Response wurde gesendet, kann nicht mehr geändert werden
+ opt Tasks
+ operation -->> tasks: Sendet Hintergrundtasks
+ end
+ opt Löst andere Exception aus
+ tasks -->> tasks: Handhabt Exception im Hintergrundtask-Code
+ end
+```
+
+!!! info
+ Es wird nur **eine Response** an den Client gesendet. Es kann eine Error-Response oder die Response der *Pfadoperation* sein.
+
+ Nachdem eine dieser Responses gesendet wurde, kann keine weitere Response gesendet werden.
+
+!!! tip "Tipp"
+ Obiges Diagramm verwendet `HTTPException`, aber Sie können auch jede andere Exception auslösen, die Sie in einer Abhängigkeit mit `yield` abfangen, oder mit einem [benutzerdefinierten Exceptionhandler](../handling-errors.md#benutzerdefinierte-exceptionhandler-definieren){.internal-link target=_blank} erstellt haben.
+
+ Wenn Sie eine Exception auslösen, wird diese mit yield an die Abhängigkeiten übergeben, einschließlich `HTTPException`, und dann **erneut** an die Exceptionhandler. Wenn es für diese Exception keinen Exceptionhandler gibt, wird sie von der internen Default-`ServerErrorMiddleware` gehandhabt, was einen HTTP-Statuscode 500 zurückgibt, um den Client darüber zu informieren, dass ein Fehler auf dem Server aufgetreten ist.
+
+## Abhängigkeiten mit `yield`, `HTTPException` und Hintergrundtasks
+
+!!! warning "Achtung"
+ Sie benötigen diese technischen Details höchstwahrscheinlich nicht, Sie können diesen Abschnitt überspringen und weiter unten fortfahren.
+
+ Diese Details sind vor allem dann nützlich, wenn Sie eine Version von FastAPI vor 0.106.0 verwendet haben und Ressourcen aus Abhängigkeiten mit `yield` in Hintergrundtasks verwendet haben.
+
+Vor FastAPI 0.106.0 war das Auslösen von Exceptions nach `yield` nicht möglich, der Exit-Code in Abhängigkeiten mit `yield` wurde ausgeführt, *nachdem* die Response gesendet wurde, die [Exceptionhandler](../handling-errors.md#benutzerdefinierte-exceptionhandler-definieren){.internal-link target=_blank} wären also bereits ausgeführt worden.
+
+Dies wurde hauptsächlich so konzipiert, damit die gleichen Objekte, die durch Abhängigkeiten ge`yield`et werden, innerhalb von Hintergrundtasks verwendet werden können, da der Exit-Code ausgeführt wird, nachdem die Hintergrundtasks abgeschlossen sind.
+
+Da dies jedoch bedeuten würde, darauf zu warten, dass die Response durch das Netzwerk reist, während eine Ressource unnötigerweise in einer Abhängigkeit mit yield gehalten wird (z. B. eine Datenbankverbindung), wurde dies in FastAPI 0.106.0 geändert.
+
+!!! tip "Tipp"
+
+ Darüber hinaus handelt es sich bei einem Hintergrundtask normalerweise um einen unabhängigen Satz von Logik, der separat behandelt werden sollte, mit eigenen Ressourcen (z. B. einer eigenen Datenbankverbindung).
+
+ Auf diese Weise erhalten Sie wahrscheinlich saubereren Code.
+
+Wenn Sie sich früher auf dieses Verhalten verlassen haben, sollten Sie jetzt die Ressourcen für Hintergrundtasks innerhalb des Hintergrundtasks selbst erstellen und intern nur Daten verwenden, die nicht von den Ressourcen von Abhängigkeiten mit `yield` abhängen.
+
+Anstatt beispielsweise dieselbe Datenbanksitzung zu verwenden, würden Sie eine neue Datenbanksitzung innerhalb des Hintergrundtasks erstellen und die Objekte mithilfe dieser neuen Sitzung aus der Datenbank abrufen. Und anstatt das Objekt aus der Datenbank als Parameter an die Hintergrundtask-Funktion zu übergeben, würden Sie die ID dieses Objekts übergeben und das Objekt dann innerhalb der Hintergrundtask-Funktion erneut laden.
+
+## Kontextmanager
+
+### Was sind „Kontextmanager“
+
+„Kontextmanager“ (Englisch „Context Manager“) sind bestimmte Python-Objekte, die Sie in einer `with`-Anweisung verwenden können.
+
+Beispielsweise können Sie `with` verwenden, um eine Datei auszulesen:
+
+```Python
+with open("./somefile.txt") as f:
+ contents = f.read()
+ print(contents)
+```
+
+Im Hintergrund erstellt das `open("./somefile.txt")` ein Objekt, das als „Kontextmanager“ bezeichnet wird.
+
+Dieser stellt sicher dass, wenn der `with`-Block beendet ist, die Datei geschlossen wird, auch wenn Exceptions geworfen wurden.
+
+Wenn Sie eine Abhängigkeit mit `yield` erstellen, erstellt **FastAPI** dafür intern einen Kontextmanager und kombiniert ihn mit einigen anderen zugehörigen Tools.
+
+### Kontextmanager in Abhängigkeiten mit `yield` verwenden
+
+!!! warning "Achtung"
+ Dies ist mehr oder weniger eine „fortgeschrittene“ Idee.
+
+ Wenn Sie gerade erst mit **FastAPI** beginnen, möchten Sie das vielleicht vorerst überspringen.
+
+In Python können Sie Kontextmanager erstellen, indem Sie eine Klasse mit zwei Methoden erzeugen: `__enter__()` und `__exit__()`.
+
+Sie können solche auch innerhalb von **FastAPI**-Abhängigkeiten mit `yield` verwenden, indem Sie `with`- oder `async with`-Anweisungen innerhalb der Abhängigkeits-Funktion verwenden:
+
+```Python hl_lines="1-9 13"
+{!../../../docs_src/dependencies/tutorial010.py!}
+```
+
+!!! tip "Tipp"
+ Andere Möglichkeiten, einen Kontextmanager zu erstellen, sind:
+
+ * `@contextlib.contextmanager` oder
+ * `@contextlib.asynccontextmanager`
+
+ Verwenden Sie diese, um eine Funktion zu dekorieren, die ein einziges `yield` hat.
+
+ Das ist es auch, was **FastAPI** intern für Abhängigkeiten mit `yield` verwendet.
+
+ Aber Sie müssen die Dekoratoren nicht für FastAPI-Abhängigkeiten verwenden (und das sollten Sie auch nicht).
+
+ FastAPI erledigt das intern für Sie.
diff --git a/docs/de/docs/tutorial/dependencies/global-dependencies.md b/docs/de/docs/tutorial/dependencies/global-dependencies.md
new file mode 100644
index 000000000..8aa0899b8
--- /dev/null
+++ b/docs/de/docs/tutorial/dependencies/global-dependencies.md
@@ -0,0 +1,34 @@
+# Globale Abhängigkeiten
+
+Bei einigen Anwendungstypen möchten Sie möglicherweise Abhängigkeiten zur gesamten Anwendung hinzufügen.
+
+Ähnlich wie Sie [`dependencies` zu den *Pfadoperation-Dekoratoren* hinzufügen](dependencies-in-path-operation-decorators.md){.internal-link target=_blank} können, können Sie sie auch zur `FastAPI`-Anwendung hinzufügen.
+
+In diesem Fall werden sie auf alle *Pfadoperationen* in der Anwendung angewendet:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/dependencies/tutorial012_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/dependencies/tutorial012_an.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="15"
+ {!> ../../../docs_src/dependencies/tutorial012.py!}
+ ```
+
+Und alle Ideen aus dem Abschnitt über das [Hinzufügen von `dependencies` zu den *Pfadoperation-Dekoratoren*](dependencies-in-path-operation-decorators.md){.internal-link target=_blank} gelten weiterhin, aber in diesem Fall für alle *Pfadoperationen* in der Anwendung.
+
+## Abhängigkeiten für Gruppen von *Pfadoperationen*
+
+Wenn Sie später lesen, wie Sie größere Anwendungen strukturieren ([Bigger Applications - Multiple Files](../../tutorial/bigger-applications.md){.internal-link target=_blank}), möglicherweise mit mehreren Dateien, lernen Sie, wie Sie einen einzelnen `dependencies`-Parameter für eine Gruppe von *Pfadoperationen* deklarieren.
diff --git a/docs/de/docs/tutorial/dependencies/index.md b/docs/de/docs/tutorial/dependencies/index.md
new file mode 100644
index 000000000..6254e976d
--- /dev/null
+++ b/docs/de/docs/tutorial/dependencies/index.md
@@ -0,0 +1,352 @@
+# Abhängigkeiten
+
+**FastAPI** hat ein sehr mächtiges, aber intuitives **Dependency Injection** System.
+
+Es ist so konzipiert, sehr einfach zu verwenden zu sein und es jedem Entwickler sehr leicht zu machen, andere Komponenten mit **FastAPI** zu integrieren.
+
+## Was ist „Dependency Injection“
+
+**„Dependency Injection“** bedeutet in der Programmierung, dass es für Ihren Code (in diesem Fall Ihre *Pfadoperation-Funktionen*) eine Möglichkeit gibt, Dinge zu deklarieren, die er verwenden möchte und die er zum Funktionieren benötigt: „Abhängigkeiten“ – „Dependencies“.
+
+Das System (in diesem Fall **FastAPI**) kümmert sich dann darum, Ihren Code mit den erforderlichen Abhängigkeiten zu versorgen („die Abhängigkeiten einfügen“ – „inject the dependencies“).
+
+Das ist sehr nützlich, wenn Sie:
+
+* Eine gemeinsame Logik haben (die gleiche Code-Logik immer und immer wieder).
+* Datenbankverbindungen teilen.
+* Sicherheit, Authentifizierung, Rollenanforderungen, usw. durchsetzen.
+* Und viele andere Dinge ...
+
+All dies, während Sie Codeverdoppelung minimieren.
+
+## Erste Schritte
+
+Sehen wir uns ein sehr einfaches Beispiel an. Es ist so einfach, dass es vorerst nicht sehr nützlich ist.
+
+Aber so können wir uns besser auf die Funktionsweise des **Dependency Injection** Systems konzentrieren.
+
+### Erstellen Sie eine Abhängigkeit („Dependable“)
+
+Konzentrieren wir uns zunächst auf die Abhängigkeit - die Dependency.
+
+Es handelt sich einfach um eine Funktion, die die gleichen Parameter entgegennimmt wie eine *Pfadoperation-Funktion*:
+=== "Python 3.10+"
+
+ ```Python hl_lines="8-9"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8-11"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-12"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="6-7"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8-11"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+Das war's schon.
+
+**Zwei Zeilen**.
+
+Und sie hat die gleiche Form und Struktur wie alle Ihre *Pfadoperation-Funktionen*.
+
+Sie können sie sich als *Pfadoperation-Funktion* ohne den „Dekorator“ (ohne `@app.get("/some-path")`) vorstellen.
+
+Und sie kann alles zurückgeben, was Sie möchten.
+
+In diesem Fall erwartet diese Abhängigkeit:
+
+* Einen optionalen Query-Parameter `q`, der ein `str` ist.
+* Einen optionalen Query-Parameter `skip`, der ein `int` ist und standardmäßig `0` ist.
+* Einen optionalen Query-Parameter `limit`, der ein `int` ist und standardmäßig `100` ist.
+
+Und dann wird einfach ein `dict` zurückgegeben, welches diese Werte enthält.
+
+!!! info
+ FastAPI unterstützt (und empfiehlt die Verwendung von) `Annotated` seit Version 0.95.0.
+
+ Wenn Sie eine ältere Version haben, werden Sie Fehler angezeigt bekommen, wenn Sie versuchen, `Annotated` zu verwenden.
+
+ Bitte [aktualisieren Sie FastAPI](../../deployment/versions.md#upgrade-der-fastapi-versionen){.internal-link target=_blank} daher mindestens zu Version 0.95.1, bevor Sie `Annotated` verwenden.
+
+### `Depends` importieren
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+### Deklarieren der Abhängigkeit im „Dependant“
+
+So wie auch `Body`, `Query`, usw., verwenden Sie `Depends` mit den Parametern Ihrer *Pfadoperation-Funktion*:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="13 18"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="15 20"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="16 21"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="15 20"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+Obwohl Sie `Depends` in den Parametern Ihrer Funktion genauso verwenden wie `Body`, `Query`, usw., funktioniert `Depends` etwas anders.
+
+Sie übergeben `Depends` nur einen einzigen Parameter.
+
+Dieser Parameter muss so etwas wie eine Funktion sein.
+
+Sie **rufen diese nicht direkt auf** (fügen Sie am Ende keine Klammern hinzu), sondern übergeben sie einfach als Parameter an `Depends()`.
+
+Und diese Funktion akzeptiert Parameter auf die gleiche Weise wie *Pfadoperation-Funktionen*.
+
+!!! tip "Tipp"
+ Im nächsten Kapitel erfahren Sie, welche anderen „Dinge“, außer Funktionen, Sie als Abhängigkeiten verwenden können.
+
+Immer wenn ein neuer Request eintrifft, kümmert sich **FastAPI** darum:
+
+* Ihre Abhängigkeitsfunktion („Dependable“) mit den richtigen Parametern aufzurufen.
+* Sich das Ergebnis von dieser Funktion zu holen.
+* Dieses Ergebnis dem Parameter Ihrer *Pfadoperation-Funktion* zuzuweisen.
+
+```mermaid
+graph TB
+
+common_parameters(["common_parameters"])
+read_items["/items/"]
+read_users["/users/"]
+
+common_parameters --> read_items
+common_parameters --> read_users
+```
+
+Auf diese Weise schreiben Sie gemeinsam genutzten Code nur einmal, und **FastAPI** kümmert sich darum, ihn für Ihre *Pfadoperationen* aufzurufen.
+
+!!! check
+ Beachten Sie, dass Sie keine spezielle Klasse erstellen und diese irgendwo an **FastAPI** übergeben müssen, um sie zu „registrieren“ oder so ähnlich.
+
+ Sie übergeben es einfach an `Depends` und **FastAPI** weiß, wie der Rest erledigt wird.
+
+## `Annotated`-Abhängigkeiten wiederverwenden
+
+In den Beispielen oben sehen Sie, dass es ein kleines bisschen **Codeverdoppelung** gibt.
+
+Wenn Sie die Abhängigkeit `common_parameters()` verwenden, müssen Sie den gesamten Parameter mit der Typannotation und `Depends()` schreiben:
+
+```Python
+commons: Annotated[dict, Depends(common_parameters)]
+```
+
+Da wir jedoch `Annotated` verwenden, können wir diesen `Annotated`-Wert in einer Variablen speichern und an mehreren Stellen verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12 16 21"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14 18 23"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="15 19 24"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an.py!}
+ ```
+
+!!! tip "Tipp"
+ Das ist schlicht Standard-Python, es wird als „Typalias“ bezeichnet und ist eigentlich nicht **FastAPI**-spezifisch.
+
+ Da **FastAPI** jedoch auf Standard-Python, einschließlich `Annotated`, basiert, können Sie diesen Trick in Ihrem Code verwenden. 😎
+
+Die Abhängigkeiten funktionieren weiterhin wie erwartet, und das **Beste daran** ist, dass die **Typinformationen erhalten bleiben**, was bedeutet, dass Ihr Editor Ihnen weiterhin **automatische Vervollständigung**, **Inline-Fehler**, usw. bieten kann. Das Gleiche gilt für andere Tools wie `mypy`.
+
+Das ist besonders nützlich, wenn Sie es in einer **großen Codebasis** verwenden, in der Sie in **vielen *Pfadoperationen*** immer wieder **dieselben Abhängigkeiten** verwenden.
+
+## `async` oder nicht `async`
+
+Da Abhängigkeiten auch von **FastAPI** aufgerufen werden (so wie Ihre *Pfadoperation-Funktionen*), gelten beim Definieren Ihrer Funktionen die gleichen Regeln.
+
+Sie können `async def` oder einfach `def` verwenden.
+
+Und Sie können Abhängigkeiten mit `async def` innerhalb normaler `def`-*Pfadoperation-Funktionen* oder `def`-Abhängigkeiten innerhalb von `async def`-*Pfadoperation-Funktionen*, usw. deklarieren.
+
+Es spielt keine Rolle. **FastAPI** weiß, was zu tun ist.
+
+!!! note "Hinweis"
+ Wenn Ihnen das nichts sagt, lesen Sie den [Async: *„In Eile?“*](../../async.md#in-eile){.internal-link target=_blank}-Abschnitt über `async` und `await` in der Dokumentation.
+
+## Integriert in OpenAPI
+
+Alle Requestdeklarationen, -validierungen und -anforderungen Ihrer Abhängigkeiten (und Unterabhängigkeiten) werden in dasselbe OpenAPI-Schema integriert.
+
+Die interaktive Dokumentation enthält also auch alle Informationen aus diesen Abhängigkeiten:
+
+
+
+## Einfache Verwendung
+
+Näher betrachtet, werden *Pfadoperation-Funktionen* deklariert, um verwendet zu werden, wann immer ein *Pfad* und eine *Operation* übereinstimmen, und dann kümmert sich **FastAPI** darum, die Funktion mit den richtigen Parametern aufzurufen, die Daten aus der Anfrage extrahierend.
+
+Tatsächlich funktionieren alle (oder die meisten) Webframeworks auf die gleiche Weise.
+
+Sie rufen diese Funktionen niemals direkt auf. Sie werden von Ihrem Framework aufgerufen (in diesem Fall **FastAPI**).
+
+Mit dem Dependency Injection System können Sie **FastAPI** ebenfalls mitteilen, dass Ihre *Pfadoperation-Funktion* von etwas anderem „abhängt“, das vor Ihrer *Pfadoperation-Funktion* ausgeführt werden soll, und **FastAPI** kümmert sich darum, es auszuführen und die Ergebnisse zu „injizieren“.
+
+Andere gebräuchliche Begriffe für dieselbe Idee der „Abhängigkeitsinjektion“ sind:
+
+* Ressourcen
+* Provider
+* Services
+* Injectables
+* Komponenten
+
+## **FastAPI**-Plugins
+
+Integrationen und „Plugins“ können mit dem **Dependency Injection** System erstellt werden. Aber tatsächlich besteht **keine Notwendigkeit, „Plugins“ zu erstellen**, da es durch die Verwendung von Abhängigkeiten möglich ist, eine unendliche Anzahl von Integrationen und Interaktionen zu deklarieren, die dann für Ihre *Pfadoperation-Funktionen* verfügbar sind.
+
+Und Abhängigkeiten können auf sehr einfache und intuitive Weise erstellt werden, sodass Sie einfach die benötigten Python-Packages importieren und sie in wenigen Codezeilen, *im wahrsten Sinne des Wortes*, mit Ihren API-Funktionen integrieren.
+
+Beispiele hierfür finden Sie in den nächsten Kapiteln zu relationalen und NoSQL-Datenbanken, Sicherheit usw.
+
+## **FastAPI**-Kompatibilität
+
+Die Einfachheit des Dependency Injection Systems macht **FastAPI** kompatibel mit:
+
+* allen relationalen Datenbanken
+* NoSQL-Datenbanken
+* externen Packages
+* externen APIs
+* Authentifizierungs- und Autorisierungssystemen
+* API-Nutzungs-Überwachungssystemen
+* Responsedaten-Injektionssystemen
+* usw.
+
+## Einfach und leistungsstark
+
+Obwohl das hierarchische Dependency Injection System sehr einfach zu definieren und zu verwenden ist, ist es dennoch sehr mächtig.
+
+Sie können Abhängigkeiten definieren, die selbst wiederum Abhängigkeiten definieren können.
+
+Am Ende wird ein hierarchischer Baum von Abhängigkeiten erstellt, und das **Dependency Injection** System kümmert sich darum, alle diese Abhängigkeiten (und deren Unterabhängigkeiten) für Sie aufzulösen und die Ergebnisse bei jedem Schritt einzubinden (zu injizieren).
+
+Nehmen wir zum Beispiel an, Sie haben vier API-Endpunkte (*Pfadoperationen*):
+
+* `/items/public/`
+* `/items/private/`
+* `/users/{user_id}/activate`
+* `/items/pro/`
+
+Dann könnten Sie für jeden davon unterschiedliche Berechtigungsanforderungen hinzufügen, nur mit Abhängigkeiten und Unterabhängigkeiten:
+
+```mermaid
+graph TB
+
+current_user(["current_user"])
+active_user(["active_user"])
+admin_user(["admin_user"])
+paying_user(["paying_user"])
+
+public["/items/public/"]
+private["/items/private/"]
+activate_user["/users/{user_id}/activate"]
+pro_items["/items/pro/"]
+
+current_user --> active_user
+active_user --> admin_user
+active_user --> paying_user
+
+current_user --> public
+active_user --> private
+admin_user --> activate_user
+paying_user --> pro_items
+```
+
+## Integriert mit **OpenAPI**
+
+Alle diese Abhängigkeiten, während sie ihre Anforderungen deklarieren, fügen auch Parameter, Validierungen, usw. zu Ihren *Pfadoperationen* hinzu.
+
+**FastAPI** kümmert sich darum, alles zum OpenAPI-Schema hinzuzufügen, damit es in den interaktiven Dokumentationssystemen angezeigt wird.
diff --git a/docs/de/docs/tutorial/dependencies/sub-dependencies.md b/docs/de/docs/tutorial/dependencies/sub-dependencies.md
new file mode 100644
index 000000000..0fa2af839
--- /dev/null
+++ b/docs/de/docs/tutorial/dependencies/sub-dependencies.md
@@ -0,0 +1,194 @@
+# Unterabhängigkeiten
+
+Sie können Abhängigkeiten erstellen, die **Unterabhängigkeiten** haben.
+
+Diese können so **tief** verschachtelt sein, wie nötig.
+
+**FastAPI** kümmert sich darum, sie aufzulösen.
+
+## Erste Abhängigkeit, „Dependable“
+
+Sie könnten eine erste Abhängigkeit („Dependable“) wie folgt erstellen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8-9"
+ {!> ../../../docs_src/dependencies/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8-9"
+ {!> ../../../docs_src/dependencies/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-10"
+ {!> ../../../docs_src/dependencies/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="6-7"
+ {!> ../../../docs_src/dependencies/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8-9"
+ {!> ../../../docs_src/dependencies/tutorial005.py!}
+ ```
+
+Diese deklariert einen optionalen Abfrageparameter `q` vom Typ `str` und gibt ihn dann einfach zurück.
+
+Das ist recht einfach (nicht sehr nützlich), hilft uns aber dabei, uns auf die Funktionsweise der Unterabhängigkeiten zu konzentrieren.
+
+## Zweite Abhängigkeit, „Dependable“ und „Dependant“
+
+Dann können Sie eine weitere Abhängigkeitsfunktion (ein „Dependable“) erstellen, die gleichzeitig eine eigene Abhängigkeit deklariert (also auch ein „Dependant“ ist):
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/dependencies/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/dependencies/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/dependencies/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/dependencies/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/dependencies/tutorial005.py!}
+ ```
+
+Betrachten wir die deklarierten Parameter:
+
+* Obwohl diese Funktion selbst eine Abhängigkeit ist („Dependable“, etwas hängt von ihr ab), deklariert sie auch eine andere Abhängigkeit („Dependant“, sie hängt von etwas anderem ab).
+ * Sie hängt von `query_extractor` ab und weist den von diesem zurückgegebenen Wert dem Parameter `q` zu.
+* Sie deklariert außerdem ein optionales `last_query`-Cookie, ein `str`.
+ * Wenn der Benutzer keine Query `q` übermittelt hat, verwenden wir die zuletzt übermittelte Query, die wir zuvor in einem Cookie gespeichert haben.
+
+## Die Abhängigkeit verwenden
+
+Diese Abhängigkeit verwenden wir nun wie folgt:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="23"
+ {!> ../../../docs_src/dependencies/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="23"
+ {!> ../../../docs_src/dependencies/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24"
+ {!> ../../../docs_src/dependencies/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/dependencies/tutorial005.py!}
+ ```
+
+!!! info
+ Beachten Sie, dass wir in der *Pfadoperation-Funktion* nur eine einzige Abhängigkeit deklarieren, den `query_or_cookie_extractor`.
+
+ Aber **FastAPI** wird wissen, dass es zuerst `query_extractor` auflösen muss, um dessen Resultat `query_or_cookie_extractor` zu übergeben, wenn dieses aufgerufen wird.
+
+```mermaid
+graph TB
+
+query_extractor(["query_extractor"])
+query_or_cookie_extractor(["query_or_cookie_extractor"])
+
+read_query["/items/"]
+
+query_extractor --> query_or_cookie_extractor --> read_query
+```
+
+## Dieselbe Abhängigkeit mehrmals verwenden
+
+Wenn eine Ihrer Abhängigkeiten mehrmals für dieselbe *Pfadoperation* deklariert wird, beispielsweise wenn mehrere Abhängigkeiten eine gemeinsame Unterabhängigkeit haben, wird **FastAPI** diese Unterabhängigkeit nur einmal pro Request aufrufen.
+
+Und es speichert den zurückgegebenen Wert in einem „Cache“ und übergibt diesen gecachten Wert an alle „Dependanten“, die ihn in diesem spezifischen Request benötigen, anstatt die Abhängigkeit mehrmals für denselben Request aufzurufen.
+
+In einem fortgeschrittenen Szenario, bei dem Sie wissen, dass die Abhängigkeit bei jedem Schritt (möglicherweise mehrmals) in derselben Anfrage aufgerufen werden muss, anstatt den zwischengespeicherten Wert zu verwenden, können Sie den Parameter `use_cache=False` festlegen, wenn Sie `Depends` verwenden:
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1"
+ async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]):
+ return {"fresh_value": fresh_value}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ async def needy_dependency(fresh_value: str = Depends(get_value, use_cache=False)):
+ return {"fresh_value": fresh_value}
+ ```
+
+## Zusammenfassung
+
+Abgesehen von all den ausgefallenen Wörtern, die hier verwendet werden, ist das **Dependency Injection**-System recht simpel.
+
+Einfach Funktionen, die genauso aussehen wie *Pfadoperation-Funktionen*.
+
+Dennoch ist es sehr mächtig und ermöglicht Ihnen die Deklaration beliebig tief verschachtelter Abhängigkeits-„Graphen“ (Bäume).
+
+!!! tip "Tipp"
+ All dies scheint angesichts dieser einfachen Beispiele möglicherweise nicht so nützlich zu sein.
+
+ Aber Sie werden in den Kapiteln über **Sicherheit** sehen, wie nützlich das ist.
+
+ Und Sie werden auch sehen, wie viel Code Sie dadurch einsparen.
diff --git a/docs/de/docs/tutorial/encoder.md b/docs/de/docs/tutorial/encoder.md
new file mode 100644
index 000000000..12f73bd12
--- /dev/null
+++ b/docs/de/docs/tutorial/encoder.md
@@ -0,0 +1,42 @@
+# JSON-kompatibler Encoder
+
+Es gibt Fälle, da möchten Sie einen Datentyp (etwa ein Pydantic-Modell) in etwas konvertieren, das kompatibel mit JSON ist (etwa ein `dict`, eine `list`e, usw.).
+
+Zum Beispiel, wenn Sie es in einer Datenbank speichern möchten.
+
+Dafür bietet **FastAPI** eine Funktion `jsonable_encoder()`.
+
+## `jsonable_encoder` verwenden
+
+Stellen wir uns vor, Sie haben eine Datenbank `fake_db`, die nur JSON-kompatible Daten entgegennimmt.
+
+Sie akzeptiert zum Beispiel keine `datetime`-Objekte, da die nicht kompatibel mit JSON sind.
+
+Ein `datetime`-Objekt müsste also in einen `str` umgewandelt werden, der die Daten im ISO-Format enthält.
+
+Genauso würde die Datenbank kein Pydantic-Modell (ein Objekt mit Attributen) akzeptieren, sondern nur ein `dict`.
+
+Sie können für diese Fälle `jsonable_encoder` verwenden.
+
+Es nimmt ein Objekt entgegen, wie etwa ein Pydantic-Modell, und gibt eine JSON-kompatible Version zurück:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4 21"
+ {!> ../../../docs_src/encoder/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="5 22"
+ {!> ../../../docs_src/encoder/tutorial001.py!}
+ ```
+
+In diesem Beispiel wird das Pydantic-Modell in ein `dict`, und das `datetime`-Objekt in ein `str` konvertiert.
+
+Das Resultat dieses Aufrufs ist etwas, das mit Pythons Standard-`json.dumps()` kodiert werden kann.
+
+Es wird also kein großer `str` zurückgegeben, der die Daten im JSON-Format (als String) enthält. Es wird eine Python-Standarddatenstruktur (z. B. ein `dict`) zurückgegeben, mit Werten und Unterwerten, die alle mit JSON kompatibel sind.
+
+!!! note "Hinweis"
+ `jsonable_encoder` wird tatsächlich von **FastAPI** intern verwendet, um Daten zu konvertieren. Aber es ist in vielen anderen Szenarien hilfreich.
diff --git a/docs/de/docs/tutorial/extra-data-types.md b/docs/de/docs/tutorial/extra-data-types.md
new file mode 100644
index 000000000..0fcb20683
--- /dev/null
+++ b/docs/de/docs/tutorial/extra-data-types.md
@@ -0,0 +1,130 @@
+# Zusätzliche Datentypen
+
+Bisher haben Sie gängige Datentypen verwendet, wie zum Beispiel:
+
+* `int`
+* `float`
+* `str`
+* `bool`
+
+Sie können aber auch komplexere Datentypen verwenden.
+
+Und Sie haben immer noch dieselbe Funktionalität wie bisher gesehen:
+
+* Großartige Editor-Unterstützung.
+* Datenkonvertierung bei eingehenden Requests.
+* Datenkonvertierung für Response-Daten.
+* Datenvalidierung.
+* Automatische Annotation und Dokumentation.
+
+## Andere Datentypen
+
+Hier sind einige der zusätzlichen Datentypen, die Sie verwenden können:
+
+* `UUID`:
+ * Ein standardmäßiger „universell eindeutiger Bezeichner“ („Universally Unique Identifier“), der in vielen Datenbanken und Systemen als ID üblich ist.
+ * Wird in Requests und Responses als `str` dargestellt.
+* `datetime.datetime`:
+ * Ein Python-`datetime.datetime`.
+ * Wird in Requests und Responses als `str` im ISO 8601-Format dargestellt, etwa: `2008-09-15T15:53:00+05:00`.
+* `datetime.date`:
+ * Python-`datetime.date`.
+ * Wird in Requests und Responses als `str` im ISO 8601-Format dargestellt, etwa: `2008-09-15`.
+* `datetime.time`:
+ * Ein Python-`datetime.time`.
+ * Wird in Requests und Responses als `str` im ISO 8601-Format dargestellt, etwa: `14:23:55.003`.
+* `datetime.timedelta`:
+ * Ein Python-`datetime.timedelta`.
+ * Wird in Requests und Responses als `float` der Gesamtsekunden dargestellt.
+ * Pydantic ermöglicht auch die Darstellung als „ISO 8601 Zeitdifferenz-Kodierung“, Weitere Informationen finden Sie in der Dokumentation.
+* `frozenset`:
+ * Wird in Requests und Responses wie ein `set` behandelt:
+ * Bei Requests wird eine Liste gelesen, Duplikate entfernt und in ein `set` umgewandelt.
+ * Bei Responses wird das `set` in eine `list`e umgewandelt.
+ * Das generierte Schema zeigt an, dass die `set`-Werte eindeutig sind (unter Verwendung von JSON Schemas `uniqueItems`).
+* `bytes`:
+ * Standard-Python-`bytes`.
+ * In Requests und Responses werden sie als `str` behandelt.
+ * Das generierte Schema wird anzeigen, dass es sich um einen `str` mit `binary` „Format“ handelt.
+* `Decimal`:
+ * Standard-Python-`Decimal`.
+ * In Requests und Responses wird es wie ein `float` behandelt.
+* Sie können alle gültigen Pydantic-Datentypen hier überprüfen: Pydantic data types.
+
+## Beispiel
+
+Hier ist ein Beispiel für eine *Pfadoperation* mit Parametern, die einige der oben genannten Typen verwenden.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1 3 12-16"
+ {!> ../../../docs_src/extra_data_types/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1 3 12-16"
+ {!> ../../../docs_src/extra_data_types/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 3 13-17"
+ {!> ../../../docs_src/extra_data_types/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1 2 11-15"
+ {!> ../../../docs_src/extra_data_types/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1 2 12-16"
+ {!> ../../../docs_src/extra_data_types/tutorial001.py!}
+ ```
+
+Beachten Sie, dass die Parameter innerhalb der Funktion ihren natürlichen Datentyp haben und Sie beispielsweise normale Datumsmanipulationen durchführen können, wie zum Beispiel:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="18-19"
+ {!> ../../../docs_src/extra_data_types/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18-19"
+ {!> ../../../docs_src/extra_data_types/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="19-20"
+ {!> ../../../docs_src/extra_data_types/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17-18"
+ {!> ../../../docs_src/extra_data_types/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="18-19"
+ {!> ../../../docs_src/extra_data_types/tutorial001.py!}
+ ```
diff --git a/docs/de/docs/tutorial/extra-models.md b/docs/de/docs/tutorial/extra-models.md
new file mode 100644
index 000000000..cdf16c4ba
--- /dev/null
+++ b/docs/de/docs/tutorial/extra-models.md
@@ -0,0 +1,257 @@
+# Extramodelle
+
+Fahren wir beim letzten Beispiel fort. Es gibt normalerweise mehrere zusammengehörende Modelle.
+
+Insbesondere Benutzermodelle, denn:
+
+* Das **hereinkommende Modell** sollte ein Passwort haben können.
+* Das **herausgehende Modell** sollte kein Passwort haben.
+* Das **Datenbankmodell** sollte wahrscheinlich ein gehashtes Passwort haben.
+
+!!! danger "Gefahr"
+ Speichern Sie niemals das Klartext-Passwort eines Benutzers. Speichern Sie immer den „sicheren Hash“, den Sie verifizieren können.
+
+ Falls Ihnen das nichts sagt, in den [Sicherheits-Kapiteln](security/simple-oauth2.md#passwort-hashing){.internal-link target=_blank} werden Sie lernen, was ein „Passwort-Hash“ ist.
+
+## Mehrere Modelle
+
+Hier der generelle Weg, wie die Modelle mit ihren Passwort-Feldern aussehen könnten, und an welchen Orten sie verwendet werden würden.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7 9 14 20 22 27-28 31-33 38-39"
+ {!> ../../../docs_src/extra_models/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 11 16 22 24 29-30 33-35 40-41"
+ {!> ../../../docs_src/extra_models/tutorial001.py!}
+ ```
+
+!!! info
+ In Pydantic v1 hieß diese Methode `.dict()`, in Pydantic v2 wurde sie deprecated (aber immer noch unterstützt) und in `.model_dump()` umbenannt.
+
+ Die Beispiele hier verwenden `.dict()` für die Kompatibilität mit Pydantic v1, Sie sollten jedoch stattdessen `.model_dump()` verwenden, wenn Sie Pydantic v2 verwenden können.
+
+### Über `**user_in.dict()`
+
+#### Pydantic's `.dict()`
+
+`user_in` ist ein Pydantic-Modell der Klasse `UserIn`.
+
+Pydantic-Modelle haben eine `.dict()`-Methode, die ein `dict` mit den Daten des Modells zurückgibt.
+
+Wenn wir also ein Pydantic-Objekt `user_in` erstellen, etwa so:
+
+```Python
+user_in = UserIn(username="john", password="secret", email="john.doe@example.com")
+```
+
+und wir rufen seine `.dict()`-Methode auf:
+
+```Python
+user_dict = user_in.dict()
+```
+
+dann haben wir jetzt in der Variable `user_dict` ein `dict` mit den gleichen Daten (es ist ein `dict` statt eines Pydantic-Modellobjekts).
+
+Wenn wir es ausgeben:
+
+```Python
+print(user_dict)
+```
+
+bekommen wir ein Python-`dict`:
+
+```Python
+{
+ 'username': 'john',
+ 'password': 'secret',
+ 'email': 'john.doe@example.com',
+ 'full_name': None,
+}
+```
+
+#### Ein `dict` entpacken
+
+Wenn wir ein `dict` wie `user_dict` nehmen, und es einer Funktion (oder Klassenmethode) mittels `**user_dict` übergeben, wird Python es „entpacken“. Es wird die Schlüssel und Werte von `user_dict` direkt als Schlüsselwort-Argumente übergeben.
+
+Wenn wir also das `user_dict` von oben nehmen und schreiben:
+
+```Python
+UserInDB(**user_dict)
+```
+
+dann ist das ungefähr äquivalent zu:
+
+```Python
+UserInDB(
+ username="john",
+ password="secret",
+ email="john.doe@example.com",
+ full_name=None,
+)
+```
+
+Oder, präziser, `user_dict` wird direkt verwendet, welche Werte es auch immer haben mag:
+
+```Python
+UserInDB(
+ username = user_dict["username"],
+ password = user_dict["password"],
+ email = user_dict["email"],
+ full_name = user_dict["full_name"],
+)
+```
+
+#### Ein Pydantic-Modell aus den Inhalten eines anderen erstellen.
+
+Da wir in obigem Beispiel `user_dict` mittels `user_in.dict()` erzeugt haben, ist dieser Code:
+
+```Python
+user_dict = user_in.dict()
+UserInDB(**user_dict)
+```
+
+äquivalent zu:
+
+```Python
+UserInDB(**user_in.dict())
+```
+
+... weil `user_in.dict()` ein `dict` ist, und dann lassen wir Python es „entpacken“, indem wir es `UserInDB` übergeben, mit vorangestelltem `**`.
+
+Wir erhalten also ein Pydantic-Modell aus den Daten eines anderen Pydantic-Modells.
+
+#### Ein `dict` entpacken und zusätzliche Schlüsselwort-Argumente
+
+Und dann fügen wir ein noch weiteres Schlüsselwort-Argument hinzu, `hashed_password=hashed_password`:
+
+```Python
+UserInDB(**user_in.dict(), hashed_password=hashed_password)
+```
+
+... was am Ende ergibt:
+
+```Python
+UserInDB(
+ username = user_dict["username"],
+ password = user_dict["password"],
+ email = user_dict["email"],
+ full_name = user_dict["full_name"],
+ hashed_password = hashed_password,
+)
+```
+
+!!! warning "Achtung"
+ Die Hilfsfunktionen `fake_password_hasher` und `fake_save_user` demonstrieren nur den möglichen Fluss der Daten und bieten natürlich keine echte Sicherheit.
+
+## Verdopplung vermeiden
+
+Reduzierung von Code-Verdoppelung ist eine der Kern-Ideen von **FastAPI**.
+
+Weil Verdoppelung von Code die Wahrscheinlichkeit von Fehlern, Sicherheitsproblemen, Desynchronisation (Code wird nur an einer Stelle verändert, aber nicht an einer anderen), usw. erhöht.
+
+Unsere Modelle teilen alle eine Menge der Daten und verdoppeln Attribut-Namen und -Typen.
+
+Das können wir besser machen.
+
+Wir deklarieren ein `UserBase`-Modell, das als Basis für unsere anderen Modelle dient. Dann können wir Unterklassen erstellen, die seine Attribute (Typdeklarationen, Validierungen, usw.) erben.
+
+Die ganze Datenkonvertierung, -validierung, -dokumentation, usw. wird immer noch wie gehabt funktionieren.
+
+Auf diese Weise beschreiben wir nur noch die Unterschiede zwischen den Modellen (mit Klartext-`password`, mit `hashed_password`, und ohne Passwort):
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7 13-14 17-18 21-22"
+ {!> ../../../docs_src/extra_models/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 15-16 19-20 23-24"
+ {!> ../../../docs_src/extra_models/tutorial002.py!}
+ ```
+
+## `Union`, oder `anyOf`
+
+Sie können deklarieren, dass eine Response eine `Union` mehrerer Typen ist, sprich, einer dieser Typen.
+
+Das wird in OpenAPI mit `anyOf` angezeigt.
+
+Um das zu tun, verwenden Sie Pythons Standard-Typhinweis `typing.Union`:
+
+!!! note "Hinweis"
+ Listen Sie, wenn Sie eine `Union` definieren, denjenigen Typ zuerst, der am spezifischsten ist, gefolgt von den weniger spezifischen Typen. Im Beispiel oben, in `Union[PlaneItem, CarItem]` also den spezifischeren `PlaneItem` vor dem weniger spezifischen `CarItem`.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1 14-15 18-20 33"
+ {!> ../../../docs_src/extra_models/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 14-15 18-20 33"
+ {!> ../../../docs_src/extra_models/tutorial003.py!}
+ ```
+
+### `Union` in Python 3.10
+
+In diesem Beispiel übergeben wir dem Argument `response_model` den Wert `Union[PlaneItem, CarItem]`.
+
+Da wir es als **Wert einem Argument überreichen**, statt es als **Typannotation** zu verwenden, müssen wir `Union` verwenden, selbst in Python 3.10.
+
+Wenn es eine Typannotation gewesen wäre, hätten wir auch den vertikalen Trennstrich verwenden können, wie in:
+
+```Python
+some_variable: PlaneItem | CarItem
+```
+
+Aber wenn wir das in der Zuweisung `response_model=PlaneItem | CarItem` machen, erhalten wir eine Fehlermeldung, da Python versucht, eine **ungültige Operation** zwischen `PlaneItem` und `CarItem` durchzuführen, statt es als Typannotation zu interpretieren.
+
+## Listen von Modellen
+
+Genauso können Sie eine Response deklarieren, die eine Liste von Objekten ist.
+
+Verwenden Sie dafür Pythons Standard `typing.List` (oder nur `list` in Python 3.9 und darüber):
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/extra_models/tutorial004_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 20"
+ {!> ../../../docs_src/extra_models/tutorial004.py!}
+ ```
+
+## Response mit beliebigem `dict`
+
+Sie könne auch eine Response deklarieren, die ein beliebiges `dict` zurückgibt, bei dem nur die Typen der Schlüssel und der Werte bekannt sind, ohne ein Pydantic-Modell zu verwenden.
+
+Das ist nützlich, wenn Sie die gültigen Feld-/Attribut-Namen von vorneherein nicht wissen (was für ein Pydantic-Modell notwendig ist).
+
+In diesem Fall können Sie `typing.Dict` verwenden (oder nur `dict` in Python 3.9 und darüber):
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="6"
+ {!> ../../../docs_src/extra_models/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1 8"
+ {!> ../../../docs_src/extra_models/tutorial005.py!}
+ ```
+
+## Zusammenfassung
+
+Verwenden Sie gerne mehrere Pydantic-Modelle und vererben Sie je nach Bedarf.
+
+Sie brauchen kein einzelnes Datenmodell pro Einheit, wenn diese Einheit verschiedene Zustände annehmen kann. So wie unsere Benutzer-„Einheit“, welche einen Zustand mit `password`, einen mit `password_hash` und einen ohne Passwort hatte.
diff --git a/docs/de/docs/tutorial/handling-errors.md b/docs/de/docs/tutorial/handling-errors.md
new file mode 100644
index 000000000..af658b971
--- /dev/null
+++ b/docs/de/docs/tutorial/handling-errors.md
@@ -0,0 +1,259 @@
+# Fehlerbehandlung
+
+Es gibt viele Situationen, in denen Sie einem Client, der Ihre API benutzt, einen Fehler zurückgeben müssen.
+
+Dieser Client könnte ein Browser mit einem Frontend, Code von jemand anderem, ein IoT-Gerät, usw., sein.
+
+Sie müssten beispielsweise einem Client sagen:
+
+* Dass er nicht die notwendigen Berechtigungen hat, eine Aktion auszuführen.
+* Dass er zu einer Ressource keinen Zugriff hat.
+* Dass die Ressource, auf die er zugreifen möchte, nicht existiert.
+* usw.
+
+In diesen Fällen geben Sie normalerweise einen **HTTP-Statuscode** im Bereich **400** (400 bis 499) zurück.
+
+Das ist vergleichbar mit den HTTP-Statuscodes im Bereich 200 (von 200 bis 299). Diese „200“er Statuscodes bedeuten, dass der Request in einem bestimmten Aspekt ein „Success“ („Erfolg“) war.
+
+Die Statuscodes im 400er-Bereich bedeuten hingegen, dass es einen Fehler gab.
+
+Erinnern Sie sich an all diese **404 Not Found** Fehler (und Witze)?
+
+## `HTTPException` verwenden
+
+Um HTTP-Responses mit Fehlern zum Client zurückzugeben, verwenden Sie `HTTPException`.
+
+### `HTTPException` importieren
+
+```Python hl_lines="1"
+{!../../../docs_src/handling_errors/tutorial001.py!}
+```
+
+### Eine `HTTPException` in Ihrem Code auslösen
+
+`HTTPException` ist eine normale Python-Exception mit einigen zusätzlichen Daten, die für APIs relevant sind.
+
+Weil es eine Python-Exception ist, geben Sie sie nicht zurück, (`return`), sondern Sie lösen sie aus (`raise`).
+
+Das bedeutet auch, wenn Sie in einer Hilfsfunktion sind, die Sie von ihrer *Pfadoperation-Funktion* aus aufrufen, und Sie lösen eine `HTTPException` von innerhalb dieser Hilfsfunktion aus, dann wird der Rest der *Pfadoperation-Funktion* nicht ausgeführt, sondern der Request wird sofort abgebrochen und der HTTP-Error der `HTTP-Exception` wird zum Client gesendet.
+
+Der Vorteil, eine Exception auszulösen (`raise`), statt sie zurückzugeben (`return`) wird im Abschnitt über Abhängigkeiten und Sicherheit klarer werden.
+
+Im folgenden Beispiel lösen wir, wenn der Client eine ID anfragt, die nicht existiert, eine Exception mit dem Statuscode `404` aus.
+
+```Python hl_lines="11"
+{!../../../docs_src/handling_errors/tutorial001.py!}
+```
+
+### Die resultierende Response
+
+Wenn der Client `http://example.com/items/foo` anfragt (ein `item_id` `"foo"`), erhält dieser Client einen HTTP-Statuscode 200 und folgende JSON-Response:
+
+```JSON
+{
+ "item": "The Foo Wrestlers"
+}
+```
+
+Aber wenn der Client `http://example.com/items/bar` anfragt (ein nicht-existierendes `item_id` `"bar"`), erhält er einen HTTP-Statuscode 404 (der „Not Found“-Fehler), und eine JSON-Response wie folgt:
+
+```JSON
+{
+ "detail": "Item not found"
+}
+```
+
+!!! tip "Tipp"
+ Wenn Sie eine `HTTPException` auslösen, können Sie dem Parameter `detail` jeden Wert übergeben, der nach JSON konvertiert werden kann, nicht nur `str`.
+
+ Zum Beispiel ein `dict`, eine `list`, usw.
+
+ Das wird automatisch von **FastAPI** gehandhabt und der Wert nach JSON konvertiert.
+
+## Benutzerdefinierte Header hinzufügen
+
+Es gibt Situationen, da ist es nützlich, dem HTTP-Error benutzerdefinierte Header hinzufügen zu können, etwa in einigen Sicherheitsszenarien.
+
+Sie müssen das wahrscheinlich nicht direkt in ihrem Code verwenden.
+
+Aber falls es in einem fortgeschrittenen Szenario notwendig ist, können Sie benutzerdefinierte Header wie folgt hinzufügen:
+
+```Python hl_lines="14"
+{!../../../docs_src/handling_errors/tutorial002.py!}
+```
+
+## Benutzerdefinierte Exceptionhandler definieren
+
+Sie können benutzerdefinierte Exceptionhandler hinzufügen, mithilfe derselben Werkzeuge für Exceptions von Starlette.
+
+Nehmen wir an, Sie haben eine benutzerdefinierte Exception `UnicornException`, die Sie (oder eine Bibliothek, die Sie verwenden) `raise`n könnten.
+
+Und Sie möchten diese Exception global mit FastAPI handhaben.
+
+Sie könnten einen benutzerdefinierten Exceptionhandler mittels `@app.exception_handler()` hinzufügen:
+
+```Python hl_lines="5-7 13-18 24"
+{!../../../docs_src/handling_errors/tutorial003.py!}
+```
+
+Wenn Sie nun `/unicorns/yolo` anfragen, `raise`d die *Pfadoperation* eine `UnicornException`.
+
+Aber diese wird von `unicorn_exception_handler` gehandhabt.
+
+Sie erhalten also einen sauberen Error mit einem Statuscode `418` und dem JSON-Inhalt:
+
+```JSON
+{"message": "Oops! yolo did something. There goes a rainbow..."}
+```
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.requests import Request` und `from starlette.responses import JSONResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette. Das Gleiche gilt für `Request`.
+
+## Die Default-Exceptionhandler überschreiben
+
+**FastAPI** hat einige Default-Exceptionhandler.
+
+Diese Handler kümmern sich darum, Default-JSON-Responses zurückzugeben, wenn Sie eine `HTTPException` `raise`n, und wenn der Request ungültige Daten enthält.
+
+Sie können diese Exceptionhandler mit ihren eigenen überschreiben.
+
+### Requestvalidierung-Exceptions überschreiben
+
+Wenn ein Request ungültige Daten enthält, löst **FastAPI** intern einen `RequestValidationError` aus.
+
+Und bietet auch einen Default-Exceptionhandler dafür.
+
+Um diesen zu überschreiben, importieren Sie den `RequestValidationError` und verwenden Sie ihn in `@app.exception_handler(RequestValidationError)`, um Ihren Exceptionhandler zu dekorieren.
+
+Der Exceptionhandler wird einen `Request` und die Exception entgegennehmen.
+
+```Python hl_lines="2 14-16"
+{!../../../docs_src/handling_errors/tutorial004.py!}
+```
+
+Wenn Sie nun `/items/foo` besuchen, erhalten Sie statt des Default-JSON-Errors:
+
+```JSON
+{
+ "detail": [
+ {
+ "loc": [
+ "path",
+ "item_id"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ]
+}
+```
+
+eine Textversion:
+
+```
+1 validation error
+path -> item_id
+ value is not a valid integer (type=type_error.integer)
+```
+
+#### `RequestValidationError` vs. `ValidationError`
+
+!!! warning "Achtung"
+ Das folgende sind technische Details, die Sie überspringen können, wenn sie für Sie nicht wichtig sind.
+
+`RequestValidationError` ist eine Unterklasse von Pydantics `ValidationError`.
+
+**FastAPI** verwendet diesen, sodass Sie, wenn Sie ein Pydantic-Modell für `response_model` verwenden, und ihre Daten fehlerhaft sind, einen Fehler in ihrem Log sehen.
+
+Aber der Client/Benutzer sieht ihn nicht. Stattdessen erhält der Client einen „Internal Server Error“ mit einem HTTP-Statuscode `500`.
+
+Das ist, wie es sein sollte, denn wenn Sie einen Pydantic-`ValidationError` in Ihrer *Response* oder irgendwo sonst in ihrem Code haben (es sei denn, im *Request* des Clients), ist das tatsächlich ein Bug in ihrem Code.
+
+Und während Sie den Fehler beheben, sollten ihre Clients/Benutzer keinen Zugriff auf interne Informationen über den Fehler haben, da das eine Sicherheitslücke aufdecken könnte.
+
+### den `HTTPException`-Handler überschreiben
+
+Genauso können Sie den `HTTPException`-Handler überschreiben.
+
+Zum Beispiel könnten Sie eine Klartext-Response statt JSON für diese Fehler zurückgeben wollen:
+
+```Python hl_lines="3-4 9-11 22"
+{!../../../docs_src/handling_errors/tutorial004.py!}
+```
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import PlainTextResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
+
+### Den `RequestValidationError`-Body verwenden
+
+Der `RequestValidationError` enthält den empfangenen `body` mit den ungültigen Daten.
+
+Sie könnten diesen verwenden, während Sie Ihre Anwendung entwickeln, um den Body zu loggen und zu debuggen, ihn zum Benutzer zurückzugeben, usw.
+
+```Python hl_lines="14"
+{!../../../docs_src/handling_errors/tutorial005.py!}
+```
+
+Jetzt versuchen Sie, einen ungültigen Artikel zu senden:
+
+```JSON
+{
+ "title": "towel",
+ "size": "XL"
+}
+```
+
+Sie erhalten eine Response, die Ihnen sagt, dass die Daten ungültig sind, und welche den empfangenen Body enthält.
+
+```JSON hl_lines="12-15"
+{
+ "detail": [
+ {
+ "loc": [
+ "body",
+ "size"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ],
+ "body": {
+ "title": "towel",
+ "size": "XL"
+ }
+}
+```
+
+#### FastAPIs `HTTPException` vs. Starlettes `HTTPException`
+
+**FastAPI** hat seine eigene `HTTPException`.
+
+Und **FastAPI**s `HTTPException`-Fehlerklasse erbt von Starlettes `HTTPException`-Fehlerklasse.
+
+Der einzige Unterschied besteht darin, dass **FastAPIs** `HTTPException` alles für das Feld `detail` akzeptiert, was nach JSON konvertiert werden kann, während Starlettes `HTTPException` nur Strings zulässt.
+
+Sie können also weiterhin **FastAPI**s `HTTPException` wie üblich in Ihrem Code auslösen.
+
+Aber wenn Sie einen Exceptionhandler registrieren, registrieren Sie ihn für Starlettes `HTTPException`.
+
+Auf diese Weise wird Ihr Handler, wenn irgendein Teil von Starlettes internem Code, oder eine Starlette-Erweiterung, oder -Plugin eine Starlette-`HTTPException` auslöst, in der Lage sein, diese zu fangen und zu handhaben.
+
+Damit wir in diesem Beispiel beide `HTTPException`s im selben Code haben können, benennen wir Starlettes Exception um zu `StarletteHTTPException`:
+
+```Python
+from starlette.exceptions import HTTPException as StarletteHTTPException
+```
+
+### **FastAPI**s Exceptionhandler wiederverwenden
+
+Wenn Sie die Exception zusammen mit denselben Default-Exceptionhandlern von **FastAPI** verwenden möchten, können Sie die Default-Exceptionhandler von `fastapi.Exception_handlers` importieren und wiederverwenden:
+
+```Python hl_lines="2-5 15 21"
+{!../../../docs_src/handling_errors/tutorial006.py!}
+```
+
+In diesem Beispiel `print`en Sie nur den Fehler mit einer sehr ausdrucksstarken Nachricht, aber Sie sehen, worauf wir hinauswollen. Sie können mit der Exception etwas machen und dann einfach die Default-Exceptionhandler wiederverwenden.
diff --git a/docs/de/docs/tutorial/header-params.md b/docs/de/docs/tutorial/header-params.md
new file mode 100644
index 000000000..3c9807f47
--- /dev/null
+++ b/docs/de/docs/tutorial/header-params.md
@@ -0,0 +1,227 @@
+# Header-Parameter
+
+So wie `Query`-, `Path`-, und `Cookie`-Parameter können Sie auch Header-Parameter definieren.
+
+## `Header` importieren
+
+Importieren Sie zuerst `Header`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/header_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/header_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/header_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/header_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/header_params/tutorial001.py!}
+ ```
+
+## `Header`-Parameter deklarieren
+
+Dann deklarieren Sie Ihre Header-Parameter, auf die gleiche Weise, wie Sie auch `Path`-, `Query`-, und `Cookie`-Parameter deklarieren.
+
+Der erste Wert ist der Typ. Sie können `Header` die gehabten Extra Validierungs- und Beschreibungsparameter hinzufügen. Danach können Sie einen Defaultwert vergeben:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/header_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/header_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial001.py!}
+ ```
+
+!!! note "Technische Details"
+ `Header` ist eine Schwesterklasse von `Path`, `Query` und `Cookie`. Sie erbt von derselben gemeinsamen `Param`-Elternklasse.
+
+ Aber erinnern Sie sich, dass, wenn Sie `Query`, `Path`, `Header` und andere von `fastapi` importieren, diese tatsächlich Funktionen sind, welche spezielle Klassen zurückgeben.
+
+!!! info
+ Um Header zu deklarieren, müssen Sie `Header` verwenden, da diese Parameter sonst als Query-Parameter interpretiert werden würden.
+
+## Automatische Konvertierung
+
+`Header` hat weitere Funktionalität, zusätzlich zu der, die `Path`, `Query` und `Cookie` bereitstellen.
+
+Die meisten Standard-Header benutzen als Trennzeichen einen Bindestrich, auch bekannt als das „Minus-Symbol“ (`-`).
+
+Aber eine Variable wie `user-agent` ist in Python nicht gültig.
+
+Darum wird `Header` standardmäßig in Parameternamen den Unterstrich (`_`) zu einem Bindestrich (`-`) konvertieren.
+
+HTTP-Header sind außerdem unabhängig von Groß-/Kleinschreibung, darum können Sie sie mittels der Standard-Python-Schreibweise deklarieren (auch bekannt als "snake_case").
+
+Sie können also `user_agent` schreiben, wie Sie es normalerweise in Python-Code machen würden, statt etwa die ersten Buchstaben groß zu schreiben, wie in `User_Agent`.
+
+Wenn Sie aus irgendeinem Grund das automatische Konvertieren von Unterstrichen zu Bindestrichen abschalten möchten, setzen Sie den Parameter `convert_underscores` auf `False`.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/header_params/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/header_params/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/header_params/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/header_params/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/header_params/tutorial002.py!}
+ ```
+
+!!! warning "Achtung"
+ Bevor Sie `convert_underscores` auf `False` setzen, bedenken Sie, dass manche HTTP-Proxys und Server die Verwendung von Headern mit Unterstrichen nicht erlauben.
+
+## Doppelte Header
+
+Es ist möglich, doppelte Header zu empfangen. Also den gleichen Header mit unterschiedlichen Werten.
+
+Sie können solche Fälle deklarieren, indem Sie in der Typdeklaration eine Liste verwenden.
+
+Sie erhalten dann alle Werte von diesem doppelten Header als Python-`list`e.
+
+Um zum Beispiel einen Header `X-Token` zu deklarieren, der mehrmals vorkommen kann, schreiben Sie:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/header_params/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/header_params/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/header_params/tutorial003.py!}
+ ```
+
+Wenn Sie mit einer *Pfadoperation* kommunizieren, die zwei HTTP-Header sendet, wie:
+
+```
+X-Token: foo
+X-Token: bar
+```
+
+Dann wäre die Response:
+
+```JSON
+{
+ "X-Token values": [
+ "bar",
+ "foo"
+ ]
+}
+```
+
+## Zusammenfassung
+
+Deklarieren Sie Header mittels `Header`, auf die gleiche Weise wie bei `Query`, `Path` und `Cookie`.
+
+Machen Sie sich keine Sorgen um Unterstriche in ihren Variablen, **FastAPI** wird sich darum kümmern, diese zu konvertieren.
diff --git a/docs/de/docs/tutorial/index.md b/docs/de/docs/tutorial/index.md
index dd7ed43bd..93a30d1b3 100644
--- a/docs/de/docs/tutorial/index.md
+++ b/docs/de/docs/tutorial/index.md
@@ -1,6 +1,6 @@
-# Tutorial - Benutzerhandbuch - Intro
+# Tutorial – Benutzerhandbuch
-Diese Anleitung zeigt Ihnen Schritt für Schritt, wie Sie **FastAPI** mit den meisten Funktionen nutzen können.
+Dieses Tutorial zeigt Ihnen Schritt für Schritt, wie Sie **FastAPI** und die meisten seiner Funktionen verwenden können.
Jeder Abschnitt baut schrittweise auf den vorhergehenden auf. Diese Abschnitte sind aber nach einzelnen Themen gegliedert, sodass Sie direkt zu einem bestimmten Thema übergehen können, um Ihre speziellen API-Anforderungen zu lösen.
@@ -12,7 +12,7 @@ Dadurch können Sie jederzeit zurückkommen und sehen genau das, was Sie benöt
Alle Codeblöcke können kopiert und direkt verwendet werden (da es sich um getestete Python-Dateien handelt).
-Um eines der Beispiele auszuführen, kopieren Sie den Code in die Datei `main.py`, und starten Sie `uvicorn` mit:
+Um eines der Beispiele auszuführen, kopieren Sie den Code in eine Datei `main.py`, und starten Sie `uvicorn` mit:
contact-Felder| Parameter | Typ | Beschreibung |
|---|---|---|
name | str | Der identifizierende Name der Kontaktperson/Organisation. |
url | str | Die URL, die auf die Kontaktinformationen verweist. MUSS im Format einer URL vorliegen. |
email | str | Die E-Mail-Adresse der Kontaktperson/Organisation. MUSS im Format einer E-Mail-Adresse vorliegen. |
license_info-Felder| Parameter | Typ | Beschreibung |
|---|---|---|
name | str | ERFORDERLICH (wenn eine license_info festgelegt ist). Der für die API verwendete Lizenzname. |
identifier | str | Ein SPDX-Lizenzausdruck für die API. Das Feld identifier und das Feld url schließen sich gegenseitig aus. Verfügbar seit OpenAPI 3.1.0, FastAPI 0.99.0. |
url | str | Eine URL zur Lizenz, die für die API verwendet wird. MUSS im Format einer URL vorliegen. |
+
+## Lizenz-ID
+
+Seit OpenAPI 3.1.0 und FastAPI 0.99.0 können Sie die `license_info` auch mit einem `identifier` anstelle einer `url` festlegen.
+
+Zum Beispiel:
+
+```Python hl_lines="31"
+{!../../../docs_src/metadata/tutorial001_1.py!}
+```
+
+## Metadaten für Tags
+
+Sie können mit dem Parameter `openapi_tags` auch zusätzliche Metadaten für die verschiedenen Tags hinzufügen, die zum Gruppieren Ihrer Pfadoperationen verwendet werden.
+
+Es wird eine Liste benötigt, die für jedes Tag ein Dict enthält.
+
+Jedes Dict kann Folgendes enthalten:
+
+* `name` (**erforderlich**): ein `str` mit demselben Tag-Namen, den Sie im Parameter `tags` in Ihren *Pfadoperationen* und `APIRouter`n verwenden.
+* `description`: ein `str` mit einer kurzen Beschreibung für das Tag. Sie kann Markdown enthalten und wird in der Benutzeroberfläche der Dokumentation angezeigt.
+* `externalDocs`: ein `dict`, das externe Dokumentation beschreibt mit:
+ * `description`: ein `str` mit einer kurzen Beschreibung für die externe Dokumentation.
+ * `url` (**erforderlich**): ein `str` mit der URL für die externe Dokumentation.
+
+### Metadaten für Tags erstellen
+
+Versuchen wir das an einem Beispiel mit Tags für `users` und `items`.
+
+Erstellen Sie Metadaten für Ihre Tags und übergeben Sie sie an den Parameter `openapi_tags`:
+
+```Python hl_lines="3-16 18"
+{!../../../docs_src/metadata/tutorial004.py!}
+```
+
+Beachten Sie, dass Sie Markdown in den Beschreibungen verwenden können. Beispielsweise wird „login“ in Fettschrift (**login**) und „fancy“ in Kursivschrift (_fancy_) angezeigt.
+
+!!! tip "Tipp"
+ Sie müssen nicht für alle von Ihnen verwendeten Tags Metadaten hinzufügen.
+
+### Ihre Tags verwenden
+
+Verwenden Sie den Parameter `tags` mit Ihren *Pfadoperationen* (und `APIRouter`n), um diese verschiedenen Tags zuzuweisen:
+
+```Python hl_lines="21 26"
+{!../../../docs_src/metadata/tutorial004.py!}
+```
+
+!!! info
+ Lesen Sie mehr zu Tags unter [Pfadoperation-Konfiguration](path-operation-configuration.md#tags){.internal-link target=_blank}.
+
+### Die Dokumentation anschauen
+
+Wenn Sie nun die Dokumentation ansehen, werden dort alle zusätzlichen Metadaten angezeigt:
+
+
+
+### Reihenfolge der Tags
+
+Die Reihenfolge der Tag-Metadaten-Dicts definiert auch die Reihenfolge, in der diese in der Benutzeroberfläche der Dokumentation angezeigt werden.
+
+Auch wenn beispielsweise `users` im Alphabet nach `items` kommt, wird es vor diesen angezeigt, da wir seine Metadaten als erstes Dict der Liste hinzugefügt haben.
+
+## OpenAPI-URL
+
+Standardmäßig wird das OpenAPI-Schema unter `/openapi.json` bereitgestellt.
+
+Sie können das aber mit dem Parameter `openapi_url` konfigurieren.
+
+Um beispielsweise festzulegen, dass es unter `/api/v1/openapi.json` bereitgestellt wird:
+
+```Python hl_lines="3"
+{!../../../docs_src/metadata/tutorial002.py!}
+```
+
+Wenn Sie das OpenAPI-Schema vollständig deaktivieren möchten, können Sie `openapi_url=None` festlegen, wodurch auch die Dokumentationsbenutzeroberflächen deaktiviert werden, die es verwenden.
+
+## URLs der Dokumentationen
+
+Sie können die beiden enthaltenen Dokumentationsbenutzeroberflächen konfigurieren:
+
+* **Swagger UI**: bereitgestellt unter `/docs`.
+ * Sie können deren URL mit dem Parameter `docs_url` festlegen.
+ * Sie können sie deaktivieren, indem Sie `docs_url=None` festlegen.
+* **ReDoc**: bereitgestellt unter `/redoc`.
+ * Sie können deren URL mit dem Parameter `redoc_url` festlegen.
+ * Sie können sie deaktivieren, indem Sie `redoc_url=None` festlegen.
+
+Um beispielsweise Swagger UI so einzustellen, dass sie unter `/documentation` bereitgestellt wird, und ReDoc zu deaktivieren:
+
+```Python hl_lines="3"
+{!../../../docs_src/metadata/tutorial003.py!}
+```
diff --git a/docs/de/docs/tutorial/middleware.md b/docs/de/docs/tutorial/middleware.md
new file mode 100644
index 000000000..7d6e6b71a
--- /dev/null
+++ b/docs/de/docs/tutorial/middleware.md
@@ -0,0 +1,61 @@
+# Middleware
+
+Sie können Middleware zu **FastAPI**-Anwendungen hinzufügen.
+
+Eine „Middleware“ ist eine Funktion, die mit jedem **Request** arbeitet, bevor er von einer bestimmten *Pfadoperation* verarbeitet wird. Und auch mit jeder **Response**, bevor sie zurückgegeben wird.
+
+* Sie nimmt jeden **Request** entgegen, der an Ihre Anwendung gesendet wird.
+* Sie kann dann etwas mit diesem **Request** tun oder beliebigen Code ausführen.
+* Dann gibt sie den **Request** zur Verarbeitung durch den Rest der Anwendung weiter (durch eine bestimmte *Pfadoperation*).
+* Sie nimmt dann die **Response** entgegen, die von der Anwendung generiert wurde (durch eine bestimmte *Pfadoperation*).
+* Sie kann etwas mit dieser **Response** tun oder beliebigen Code ausführen.
+* Dann gibt sie die **Response** zurück.
+
+!!! note "Technische Details"
+ Wenn Sie Abhängigkeiten mit `yield` haben, wird der Exit-Code *nach* der Middleware ausgeführt.
+
+ Wenn es Hintergrundaufgaben gab (später dokumentiert), werden sie *nach* allen Middlewares ausgeführt.
+
+## Erstellung einer Middleware
+
+Um eine Middleware zu erstellen, verwenden Sie den Dekorator `@app.middleware("http")` über einer Funktion.
+
+Die Middleware-Funktion erhält:
+
+* Den `request`.
+* Eine Funktion `call_next`, die den `request` als Parameter erhält.
+ * Diese Funktion gibt den `request` an die entsprechende *Pfadoperation* weiter.
+ * Dann gibt es die von der entsprechenden *Pfadoperation* generierte `response` zurück.
+* Sie können die `response` dann weiter modifizieren, bevor Sie sie zurückgeben.
+
+```Python hl_lines="8-9 11 14"
+{!../../../docs_src/middleware/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Beachten Sie, dass benutzerdefinierte proprietäre Header hinzugefügt werden können. Verwenden Sie dafür das Präfix 'X-'.
+
+ Wenn Sie jedoch benutzerdefinierte Header haben, die ein Client in einem Browser sehen soll, müssen Sie sie zu Ihrer CORS-Konfigurationen ([CORS (Cross-Origin Resource Sharing)](cors.md){.internal-link target=_blank}) hinzufügen, indem Sie den Parameter `expose_headers` verwenden, der in der Starlette-CORS-Dokumentation dokumentiert ist.
+
+!!! note "Technische Details"
+ Sie könnten auch `from starlette.requests import Request` verwenden.
+
+ **FastAPI** bietet es als Komfort für Sie, den Entwickler, an. Aber es stammt direkt von Starlette.
+
+### Vor und nach der `response`
+
+Sie können Code hinzufügen, der mit dem `request` ausgeführt wird, bevor dieser von einer beliebigen *Pfadoperation* empfangen wird.
+
+Und auch nachdem die `response` generiert wurde, bevor sie zurückgegeben wird.
+
+Sie könnten beispielsweise einen benutzerdefinierten Header `X-Process-Time` hinzufügen, der die Zeit in Sekunden enthält, die benötigt wurde, um den Request zu verarbeiten und eine Response zu generieren:
+
+```Python hl_lines="10 12-13"
+{!../../../docs_src/middleware/tutorial001.py!}
+```
+
+## Andere Middlewares
+
+Sie können später mehr über andere Middlewares in [Handbuch für fortgeschrittene Benutzer: Fortgeschrittene Middleware](../advanced/middleware.md){.internal-link target=_blank} lesen.
+
+In der nächsten Sektion erfahren Sie, wie Sie CORS mit einer Middleware behandeln können.
diff --git a/docs/de/docs/tutorial/path-operation-configuration.md b/docs/de/docs/tutorial/path-operation-configuration.md
new file mode 100644
index 000000000..80a4fadc9
--- /dev/null
+++ b/docs/de/docs/tutorial/path-operation-configuration.md
@@ -0,0 +1,179 @@
+# Pfadoperation-Konfiguration
+
+Es gibt mehrere Konfigurations-Parameter, die Sie Ihrem *Pfadoperation-Dekorator* übergeben können.
+
+!!! warning "Achtung"
+ Beachten Sie, dass diese Parameter direkt dem *Pfadoperation-Dekorator* übergeben werden, nicht der *Pfadoperation-Funktion*.
+
+## Response-Statuscode
+
+Sie können den (HTTP-)`status_code` definieren, den die Response Ihrer *Pfadoperation* verwenden soll.
+
+Sie können direkt den `int`-Code übergeben, etwa `404`.
+
+Aber falls Sie sich nicht mehr erinnern, wofür jede Nummer steht, können Sie die Abkürzungs-Konstanten in `status` verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1 15"
+ {!> ../../../docs_src/path_operation_configuration/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3 17"
+ {!> ../../../docs_src/path_operation_configuration/tutorial001_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3 17"
+ {!> ../../../docs_src/path_operation_configuration/tutorial001.py!}
+ ```
+
+Dieser Statuscode wird in der Response verwendet und zum OpenAPI-Schema hinzugefügt.
+
+!!! note "Technische Details"
+ Sie können auch `from starlette import status` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.status`-Codes auch via `fastapi.status` an, als Annehmlichkeit für Sie, den Entwickler. Sie kommen aber direkt von Starlette.
+
+## Tags
+
+Sie können Ihrer *Pfadoperation* Tags hinzufügen, mittels des Parameters `tags`, dem eine `list`e von `str`s übergeben wird (in der Regel nur ein `str`):
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="15 20 25"
+ {!> ../../../docs_src/path_operation_configuration/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="17 22 27"
+ {!> ../../../docs_src/path_operation_configuration/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17 22 27"
+ {!> ../../../docs_src/path_operation_configuration/tutorial002.py!}
+ ```
+
+Diese werden zum OpenAPI-Schema hinzugefügt und von den automatischen Dokumentations-Benutzeroberflächen verwendet:
+
+
+
+### Tags mittels Enumeration
+
+Wenn Sie eine große Anwendung haben, können sich am Ende **viele Tags** anhäufen, und Sie möchten sicherstellen, dass Sie für verwandte *Pfadoperationen* immer den **gleichen Tag** nehmen.
+
+In diesem Fall macht es Sinn, die Tags in einem `Enum` zu speichern.
+
+**FastAPI** unterstützt diese genauso wie einfache Strings:
+
+```Python hl_lines="1 8-10 13 18"
+{!../../../docs_src/path_operation_configuration/tutorial002b.py!}
+```
+
+## Zusammenfassung und Beschreibung
+
+Sie können eine Zusammenfassung (`summary`) und eine Beschreibung (`description`) hinzufügen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="18-19"
+ {!> ../../../docs_src/path_operation_configuration/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="20-21"
+ {!> ../../../docs_src/path_operation_configuration/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20-21"
+ {!> ../../../docs_src/path_operation_configuration/tutorial003.py!}
+ ```
+
+## Beschreibung mittels Docstring
+
+Da Beschreibungen oft mehrere Zeilen lang sind, können Sie die Beschreibung der *Pfadoperation* im Docstring der Funktion deklarieren, und **FastAPI** wird sie daraus auslesen.
+
+Sie können im Docstring Markdown schreiben, es wird korrekt interpretiert und angezeigt (die Einrückung des Docstring beachtend).
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="17-25"
+ {!> ../../../docs_src/path_operation_configuration/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19-27"
+ {!> ../../../docs_src/path_operation_configuration/tutorial004_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="19-27"
+ {!> ../../../docs_src/path_operation_configuration/tutorial004.py!}
+ ```
+
+In der interaktiven Dokumentation sieht das dann so aus:
+
+
+
+## Beschreibung der Response
+
+Die Response können Sie mit dem Parameter `response_description` beschreiben:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/path_operation_configuration/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="21"
+ {!> ../../../docs_src/path_operation_configuration/tutorial005_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="21"
+ {!> ../../../docs_src/path_operation_configuration/tutorial005.py!}
+ ```
+
+!!! info
+ beachten Sie, dass sich `response_description` speziell auf die Response bezieht, während `description` sich generell auf die *Pfadoperation* bezieht.
+
+!!! check
+ OpenAPI verlangt, dass jede *Pfadoperation* über eine Beschreibung der Response verfügt.
+
+ Daher, wenn Sie keine vergeben, wird **FastAPI** automatisch eine für „Erfolgreiche Response“ erstellen.
+
+
+
+## Eine *Pfadoperation* deprecaten
+
+Wenn Sie eine *Pfadoperation* als deprecated kennzeichnen möchten, ohne sie zu entfernen, fügen Sie den Parameter `deprecated` hinzu:
+
+```Python hl_lines="16"
+{!../../../docs_src/path_operation_configuration/tutorial006.py!}
+```
+
+Sie wird in der interaktiven Dokumentation gut sichtbar als deprecated markiert werden:
+
+
+
+Vergleichen Sie, wie deprecatete und nicht-deprecatete *Pfadoperationen* aussehen:
+
+
+
+## Zusammenfassung
+
+Sie können auf einfache Weise Metadaten für Ihre *Pfadoperationen* definieren, indem Sie den *Pfadoperation-Dekoratoren* Parameter hinzufügen.
diff --git a/docs/de/docs/tutorial/path-params-numeric-validations.md b/docs/de/docs/tutorial/path-params-numeric-validations.md
new file mode 100644
index 000000000..aa3b59b8b
--- /dev/null
+++ b/docs/de/docs/tutorial/path-params-numeric-validations.md
@@ -0,0 +1,293 @@
+# Pfad-Parameter und Validierung von Zahlen
+
+So wie Sie mit `Query` für Query-Parameter zusätzliche Validierungen und Metadaten hinzufügen können, können Sie das mittels `Path` auch für Pfad-Parameter tun.
+
+## `Path` importieren
+
+Importieren Sie zuerst `Path` von `fastapi`, und importieren Sie `Annotated`.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="1 3"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="1 3"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3-4"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!}
+ ```
+
+!!! info
+ FastAPI unterstützt (und empfiehlt die Verwendung von) `Annotated` seit Version 0.95.0.
+
+ Wenn Sie eine ältere Version haben, werden Sie Fehler angezeigt bekommen, wenn Sie versuchen, `Annotated` zu verwenden.
+
+ Bitte [aktualisieren Sie FastAPI](../deployment/versions.md#upgrade-der-fastapi-versionen){.internal-link target=_blank} daher mindestens zu Version 0.95.1, bevor Sie `Annotated` verwenden.
+
+## Metadaten deklarieren
+
+Sie können die gleichen Parameter deklarieren wie für `Query`.
+
+Um zum Beispiel einen `title`-Metadaten-Wert für den Pfad-Parameter `item_id` zu deklarieren, schreiben Sie:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!}
+ ```
+
+!!! note "Hinweis"
+ Ein Pfad-Parameter ist immer erforderlich, weil er Teil des Pfads sein muss.
+
+ Sie sollten ihn daher mit `...` deklarieren, um ihn als erforderlich auszuzeichnen.
+
+ Doch selbst wenn Sie ihn mit `None` deklarieren, oder einen Defaultwert setzen, bewirkt das nichts, er bleibt immer erforderlich.
+
+## Sortieren Sie die Parameter, wie Sie möchten
+
+!!! tip "Tipp"
+ Wenn Sie `Annotated` verwenden, ist das folgende nicht so wichtig / nicht notwendig.
+
+Nehmen wir an, Sie möchten den Query-Parameter `q` als erforderlichen `str` deklarieren.
+
+Und Sie müssen sonst nichts anderes für den Parameter deklarieren, Sie brauchen also nicht wirklich `Query`.
+
+Aber Sie brauchen `Path` für den `item_id`-Pfad-Parameter. Und Sie möchten aus irgendeinem Grund nicht `Annotated` verwenden.
+
+Python wird sich beschweren, wenn Sie einen Parameter mit Defaultwert vor einen Parameter ohne Defaultwert setzen.
+
+Aber Sie können die Reihenfolge der Parameter ändern, den Query-Parameter ohne Defaultwert zuerst.
+
+Für **FastAPI** ist es nicht wichtig. Es erkennt die Parameter anhand ihres Namens, ihrer Typen, und ihrer Defaultwerte (`Query`, `Path`, usw.). Es kümmert sich nicht um die Reihenfolge.
+
+Sie können Ihre Funktion also so deklarieren:
+
+=== "Python 3.8 nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial002.py!}
+ ```
+
+Aber bedenken Sie, dass Sie dieses Problem nicht haben, wenn Sie `Annotated` verwenden, da Sie nicht die Funktions-Parameter-Defaultwerte für `Query()` oder `Path()` verwenden.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial002_an.py!}
+ ```
+
+## Sortieren Sie die Parameter wie Sie möchten: Tricks
+
+!!! tip "Tipp"
+ Wenn Sie `Annotated` verwenden, ist das folgende nicht so wichtig / nicht notwendig.
+
+Hier ein **kleiner Trick**, der nützlich sein kann, aber Sie werden ihn nicht oft brauchen.
+
+Wenn Sie eines der folgenden Dinge tun möchten:
+
+* den `q`-Parameter ohne `Query` oder irgendeinem Defaultwert deklarieren
+* den Pfad-Parameter `item_id` mittels `Path` deklarieren
+* die Parameter in einer unterschiedlichen Reihenfolge haben
+* `Annotated` nicht verwenden
+
+... dann hat Python eine kleine Spezial-Syntax für Sie.
+
+Übergeben Sie der Funktion `*` als ersten Parameter.
+
+Python macht nichts mit diesem `*`, aber es wird wissen, dass alle folgenden Parameter als Keyword-Argumente (Schlüssel-Wert-Paare), auch bekannt als kwargs, verwendet werden. Selbst wenn diese keinen Defaultwert haben.
+
+```Python hl_lines="7"
+{!../../../docs_src/path_params_numeric_validations/tutorial003.py!}
+```
+
+### Besser mit `Annotated`
+
+Bedenken Sie, dass Sie, wenn Sie `Annotated` verwenden, dieses Problem nicht haben, weil Sie keine Defaultwerte für Ihre Funktionsparameter haben. Sie müssen daher wahrscheinlich auch nicht `*` verwenden.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial003_an.py!}
+ ```
+
+## Validierung von Zahlen: Größer oder gleich
+
+Mit `Query` und `Path` (und anderen, die Sie später kennenlernen), können Sie Zahlenbeschränkungen deklarieren.
+
+Hier, mit `ge=1`, wird festgelegt, dass `item_id` eine Ganzzahl benötigt, die größer oder gleich `1` ist (`g`reater than or `e`qual).
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial004_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial004_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial004.py!}
+ ```
+
+## Validierung von Zahlen: Größer und kleiner oder gleich
+
+Das Gleiche trifft zu auf:
+
+* `gt`: `g`reater `t`han – größer als
+* `le`: `l`ess than or `e`qual – kleiner oder gleich
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial005_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial005.py!}
+ ```
+
+## Validierung von Zahlen: Floats, größer und kleiner
+
+Zahlenvalidierung funktioniert auch für `float`-Werte.
+
+Hier wird es wichtig, in der Lage zu sein, gt zu deklarieren, und nicht nur ge, da Sie hiermit bestimmen können, dass ein Wert, zum Beispiel, größer als `0` sein muss, obwohl er kleiner als `1` ist.
+
+`0.5` wäre also ein gültiger Wert, aber nicht `0.0` oder `0`.
+
+Das gleiche gilt für lt.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/path_params_numeric_validations/tutorial006.py!}
+ ```
+
+## Zusammenfassung
+
+Mit `Query` und `Path` (und anderen, die Sie noch nicht gesehen haben) können Sie Metadaten und Stringvalidierungen deklarieren, so wie in [Query-Parameter und Stringvalidierungen](query-params-str-validations.md){.internal-link target=_blank} beschrieben.
+
+Und Sie können auch Validierungen für Zahlen deklarieren:
+
+* `gt`: `g`reater `t`han – größer als
+* `ge`: `g`reater than or `e`qual – größer oder gleich
+* `lt`: `l`ess `t`han – kleiner als
+* `le`: `l`ess than or `e`qual – kleiner oder gleich
+
+!!! info
+ `Query`, `Path`, und andere Klassen, die Sie später kennenlernen, sind Unterklassen einer allgemeinen `Param`-Klasse.
+
+ Sie alle teilen die gleichen Parameter für zusätzliche Validierung und Metadaten, die Sie gesehen haben.
+
+!!! note "Technische Details"
+ `Query`, `Path` und andere, die Sie von `fastapi` importieren, sind tatsächlich Funktionen.
+
+ Die, wenn sie aufgerufen werden, Instanzen der Klassen mit demselben Namen zurückgeben.
+
+ Sie importieren also `Query`, welches eine Funktion ist. Aber wenn Sie es aufrufen, gibt es eine Instanz der Klasse zurück, die auch `Query` genannt wird.
+
+ Diese Funktionen existieren (statt die Klassen direkt zu verwenden), damit Ihr Editor keine Fehlermeldungen über ihre Typen ausgibt.
+
+ Auf diese Weise können Sie Ihren Editor und Ihre Programmier-Tools verwenden, ohne besondere Einstellungen vornehmen zu müssen, um diese Fehlermeldungen stummzuschalten.
diff --git a/docs/de/docs/tutorial/path-params.md b/docs/de/docs/tutorial/path-params.md
new file mode 100644
index 000000000..8c8f2e008
--- /dev/null
+++ b/docs/de/docs/tutorial/path-params.md
@@ -0,0 +1,254 @@
+# Pfad-Parameter
+
+Sie können Pfad-„Parameter“ oder -„Variablen“ mit der gleichen Syntax deklarieren, welche in Python-Format-Strings verwendet wird:
+
+```Python hl_lines="6-7"
+{!../../../docs_src/path_params/tutorial001.py!}
+```
+
+Der Wert des Pfad-Parameters `item_id` wird Ihrer Funktion als das Argument `item_id` übergeben.
+
+Wenn Sie dieses Beispiel ausführen und auf http://127.0.0.1:8000/items/foo gehen, sehen Sie als Response:
+
+```JSON
+{"item_id":"foo"}
+```
+
+## Pfad-Parameter mit Typen
+
+Sie können den Typ eines Pfad-Parameters in der Argumentliste der Funktion deklarieren, mit Standard-Python-Typannotationen:
+
+```Python hl_lines="7"
+{!../../../docs_src/path_params/tutorial002.py!}
+```
+
+In diesem Fall wird `item_id` als `int` deklariert, also als Ganzzahl.
+
+!!! check
+ Dadurch erhalten Sie Editor-Unterstützung innerhalb Ihrer Funktion, mit Fehlerprüfungen, Codevervollständigung, usw.
+
+## Daten-Konversion
+
+Wenn Sie dieses Beispiel ausführen und Ihren Browser unter http://127.0.0.1:8000/items/3 öffnen, sehen Sie als Response:
+
+```JSON
+{"item_id":3}
+```
+
+!!! check
+ Beachten Sie, dass der Wert, den Ihre Funktion erhält und zurückgibt, die Zahl `3` ist, also ein `int`. Nicht der String `"3"`, also ein `str`.
+
+ Sprich, mit dieser Typdeklaration wird **FastAPI** die Anfrage automatisch „parsen“.
+
+## Datenvalidierung
+
+Wenn Sie aber im Browser http://127.0.0.1:8000/items/foo besuchen, erhalten Sie eine hübsche HTTP-Fehlermeldung:
+
+```JSON
+{
+ "detail": [
+ {
+ "type": "int_parsing",
+ "loc": [
+ "path",
+ "item_id"
+ ],
+ "msg": "Input should be a valid integer, unable to parse string as an integer",
+ "input": "foo",
+ "url": "https://errors.pydantic.dev/2.1/v/int_parsing"
+ }
+ ]
+}
+```
+
+Der Pfad-Parameter `item_id` hatte den Wert `"foo"`, was kein `int` ist.
+
+Die gleiche Fehlermeldung würde angezeigt werden, wenn Sie ein `float` (also eine Kommazahl) statt eines `int`s übergeben würden, wie etwa in: http://127.0.0.1:8000/items/4.2
+
+!!! check
+ Sprich, mit der gleichen Python-Typdeklaration gibt Ihnen **FastAPI** Datenvalidierung.
+
+ Beachten Sie, dass die Fehlermeldung auch direkt die Stelle anzeigt, wo die Validierung nicht erfolgreich war.
+
+ Das ist unglaublich hilfreich, wenn Sie Code entwickeln und debuggen, welcher mit ihrer API interagiert.
+
+## Dokumentation
+
+Wenn Sie die Seite http://127.0.0.1:8000/docs in Ihrem Browser öffnen, sehen Sie eine automatische, interaktive API-Dokumentation:
+
+
+
+!!! check
+ Wiederum, mit dieser gleichen Python-Typdeklaration gibt Ihnen **FastAPI** eine automatische, interaktive Dokumentation (verwendet die Swagger-Benutzeroberfläche).
+
+ Beachten Sie, dass der Pfad-Parameter dort als Ganzzahl deklariert ist.
+
+## Nützliche Standards. Alternative Dokumentation
+
+Und weil das generierte Schema vom OpenAPI-Standard kommt, gibt es viele kompatible Tools.
+
+Zum Beispiel bietet **FastAPI** selbst eine alternative API-Dokumentation (verwendet ReDoc), welche Sie unter http://127.0.0.1:8000/redoc einsehen können:
+
+
+
+Und viele weitere kompatible Tools. Inklusive Codegenerierung für viele Sprachen.
+
+## Pydantic
+
+Die ganze Datenvalidierung wird hinter den Kulissen von Pydantic durchgeführt, Sie profitieren also von dessen Vorteilen. Und Sie wissen, dass Sie in guten Händen sind.
+
+Sie können für Typ Deklarationen auch `str`, `float`, `bool` und viele andere komplexe Datentypen verwenden.
+
+Mehrere davon werden wir in den nächsten Kapiteln erkunden.
+
+## Die Reihenfolge ist wichtig
+
+Wenn Sie *Pfadoperationen* erstellen, haben Sie manchmal einen fixen Pfad.
+
+Etwa `/users/me`, um Daten über den aktuellen Benutzer zu erhalten.
+
+Und Sie haben auch einen Pfad `/users/{user_id}`, um Daten über einen spezifischen Benutzer zu erhalten, mittels einer Benutzer-ID.
+
+Weil *Pfadoperationen* in ihrer Reihenfolge ausgewertet werden, müssen Sie sicherstellen, dass der Pfad `/users/me` vor `/users/{user_id}` deklariert wurde:
+
+```Python hl_lines="6 11"
+{!../../../docs_src/path_params/tutorial003.py!}
+```
+
+Ansonsten würde der Pfad für `/users/{user_id}` auch `/users/me` auswerten, und annehmen, dass ein Parameter `user_id` mit dem Wert `"me"` übergeben wurde.
+
+Sie können eine Pfadoperation auch nicht erneut definieren:
+
+```Python hl_lines="6 11"
+{!../../../docs_src/path_params/tutorial003b.py!}
+```
+
+Die erste Definition wird immer verwendet werden, da ihr Pfad zuerst übereinstimmt.
+
+## Vordefinierte Parameterwerte
+
+Wenn Sie eine *Pfadoperation* haben, welche einen *Pfad-Parameter* hat, aber Sie wollen, dass dessen gültige Werte vordefiniert sind, können Sie ein Standard-Python `Enum` verwenden.
+
+### Erstellen Sie eine `Enum`-Klasse
+
+Importieren Sie `Enum` und erstellen Sie eine Unterklasse, die von `str` und `Enum` erbt.
+
+Indem Sie von `str` erben, weiß die API Dokumentation, dass die Werte des Enums vom Typ `str` sein müssen, und wird in der Lage sein, korrekt zu rendern.
+
+Erstellen Sie dann Klassen-Attribute mit festgelegten Werten, welches die erlaubten Werte sein werden:
+
+```Python hl_lines="1 6-9"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+!!! info
+ Enumerationen (oder kurz Enums) gibt es in Python seit Version 3.4.
+
+!!! tip "Tipp"
+ Falls Sie sich fragen, was „AlexNet“, „ResNet“ und „LeNet“ ist, das sind Namen von Modellen für maschinelles Lernen.
+
+### Deklarieren Sie einen *Pfad-Parameter*
+
+Dann erstellen Sie einen *Pfad-Parameter*, der als Typ die gerade erstellte Enum-Klasse hat (`ModelName`):
+
+```Python hl_lines="16"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+### Testen Sie es in der API-Dokumentation
+
+Weil die erlaubten Werte für den *Pfad-Parameter* nun vordefiniert sind, kann die interaktive Dokumentation sie als Auswahl-Drop-Down anzeigen:
+
+
+
+### Mit Python-*Enums* arbeiten
+
+Der *Pfad-Parameter* wird ein *Member eines Enums* sein.
+
+#### *Enum-Member* vergleichen
+
+Sie können ihn mit einem Member Ihres Enums `ModelName` vergleichen:
+
+```Python hl_lines="17"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+#### *Enum-Wert* erhalten
+
+Den tatsächlichen Wert (in diesem Fall ein `str`) erhalten Sie via `model_name.value`, oder generell, `ihr_enum_member.value`:
+
+```Python hl_lines="20"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+!!! tip "Tipp"
+ Sie können den Wert `"lenet"` außerdem mittels `ModelName.lenet.value` abrufen.
+
+#### *Enum-Member* zurückgeben
+
+Sie können *Enum-Member* in ihrer *Pfadoperation* zurückgeben, sogar verschachtelt in einem JSON-Body (z. B. als `dict`).
+
+Diese werden zu ihren entsprechenden Werten konvertiert (in diesem Fall Strings), bevor sie zum Client übertragen werden:
+
+```Python hl_lines="18 21 23"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+In Ihrem Client erhalten Sie eine JSON-Response, wie etwa:
+
+```JSON
+{
+ "model_name": "alexnet",
+ "message": "Deep Learning FTW!"
+}
+```
+
+## Pfad Parameter die Pfade enthalten
+
+Angenommen, Sie haben eine *Pfadoperation* mit einem Pfad `/files/{file_path}`.
+
+Aber `file_path` soll selbst einen *Pfad* enthalten, etwa `home/johndoe/myfile.txt`.
+
+Sprich, die URL für diese Datei wäre etwas wie: `/files/home/johndoe/myfile.txt`.
+
+### OpenAPI Unterstützung
+
+OpenAPI bietet nicht die Möglichkeit, dass ein *Pfad-Parameter* seinerseits einen *Pfad* enthalten kann, das würde zu Szenarios führen, die schwierig zu testen und zu definieren sind.
+
+Trotzdem können Sie das in **FastAPI** tun, indem Sie eines der internen Tools von Starlette verwenden.
+
+Die Dokumentation würde weiterhin funktionieren, allerdings wird nicht dokumentiert werden, dass der Parameter ein Pfad sein sollte.
+
+### Pfad Konverter
+
+Mittels einer Option direkt von Starlette können Sie einen *Pfad-Parameter* deklarieren, der einen Pfad enthalten soll, indem Sie eine URL wie folgt definieren:
+
+```
+/files/{file_path:path}
+```
+
+In diesem Fall ist der Name des Parameters `file_path`. Der letzte Teil, `:path`, sagt aus, dass der Parameter ein *Pfad* sein soll.
+
+Sie verwenden das also wie folgt:
+
+```Python hl_lines="6"
+{!../../../docs_src/path_params/tutorial004.py!}
+```
+
+!!! tip "Tipp"
+ Der Parameter könnte einen führenden Schrägstrich (`/`) haben, wie etwa in `/home/johndoe/myfile.txt`.
+
+ In dem Fall wäre die URL: `/files//home/johndoe/myfile.txt`, mit einem doppelten Schrägstrich (`//`) zwischen `files` und `home`.
+
+## Zusammenfassung
+
+In **FastAPI** erhalten Sie mittels kurzer, intuitiver Typdeklarationen:
+
+* Editor-Unterstützung: Fehlerprüfungen, Codevervollständigung, usw.
+* Daten "parsen"
+* Datenvalidierung
+* API-Annotationen und automatische Dokumentation
+
+Und Sie müssen sie nur einmal deklarieren.
+
+Das ist wahrscheinlich der sichtbarste Unterschied zwischen **FastAPI** und alternativen Frameworks (abgesehen von der reinen Performanz).
diff --git a/docs/de/docs/tutorial/query-params-str-validations.md b/docs/de/docs/tutorial/query-params-str-validations.md
new file mode 100644
index 000000000..92f2bbe7c
--- /dev/null
+++ b/docs/de/docs/tutorial/query-params-str-validations.md
@@ -0,0 +1,914 @@
+# Query-Parameter und Stringvalidierung
+
+**FastAPI** erlaubt es Ihnen, Ihre Parameter zusätzlich zu validieren, und zusätzliche Informationen hinzuzufügen.
+
+Nehmen wir als Beispiel die folgende Anwendung:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial001.py!}
+ ```
+
+Der Query-Parameter `q` hat den Typ `Union[str, None]` (oder `str | None` in Python 3.10), was bedeutet, er ist entweder ein `str` oder `None`. Der Defaultwert ist `None`, also weiß FastAPI, der Parameter ist nicht erforderlich.
+
+!!! note "Hinweis"
+ FastAPI weiß nur dank des definierten Defaultwertes `=None`, dass der Wert von `q` nicht erforderlich ist
+
+ `Union[str, None]` hingegen erlaubt ihren Editor, Sie besser zu unterstützen und Fehler zu erkennen.
+
+## Zusätzliche Validierung
+
+Wir werden bewirken, dass, obwohl `q` optional ist, wenn es gegeben ist, **seine Länge 50 Zeichen nicht überschreitet**.
+
+### `Query` und `Annotated` importieren
+
+Importieren Sie zuerst:
+
+* `Query` von `fastapi`
+* `Annotated` von `typing` (oder von `typing_extensions` in Python unter 3.9)
+
+=== "Python 3.10+"
+
+ In Python 3.9 oder darüber, ist `Annotated` Teil der Standardbibliothek, also können Sie es von `typing` importieren.
+
+ ```Python hl_lines="1 3"
+ {!> ../../../docs_src/query_params_str_validations/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ In Versionen unter Python 3.9 importieren Sie `Annotated` von `typing_extensions`.
+
+ Es wird bereits mit FastAPI installiert sein.
+
+ ```Python hl_lines="3-4"
+ {!> ../../../docs_src/query_params_str_validations/tutorial002_an.py!}
+ ```
+
+!!! info
+ FastAPI unterstützt (und empfiehlt die Verwendung von) `Annotated` seit Version 0.95.0.
+
+ Wenn Sie eine ältere Version haben, werden Sie Fehler angezeigt bekommen, wenn Sie versuchen, `Annotated` zu verwenden.
+
+ Bitte [aktualisieren Sie FastAPI](../deployment/versions.md#upgrade-der-fastapi-versionen){.internal-link target=_blank} daher mindestens zu Version 0.95.1, bevor Sie `Annotated` verwenden.
+
+## `Annotated` im Typ des `q`-Parameters verwenden
+
+Erinnern Sie sich, wie ich in [Einführung in Python-Typen](../python-types.md#typhinweise-mit-metadaten-annotationen){.internal-link target=_blank} sagte, dass Sie mittels `Annotated` Metadaten zu Ihren Parametern hinzufügen können?
+
+Jetzt ist es an der Zeit, das mit FastAPI auszuprobieren. 🚀
+
+Wir hatten diese Typannotation:
+
+=== "Python 3.10+"
+
+ ```Python
+ q: str | None = None
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ q: Union[str, None] = None
+ ```
+
+Wir wrappen das nun in `Annotated`, sodass daraus wird:
+
+=== "Python 3.10+"
+
+ ```Python
+ q: Annotated[str | None] = None
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ q: Annotated[Union[str, None]] = None
+ ```
+
+Beide Versionen bedeuten dasselbe: `q` ist ein Parameter, der `str` oder `None` sein kann. Standardmäßig ist er `None`.
+
+Wenden wir uns jetzt den spannenden Dingen zu. 🎉
+
+## `Query` zu `Annotated` im `q`-Parameter hinzufügen
+
+Jetzt, da wir `Annotated` für unsere Metadaten deklariert haben, fügen Sie `Query` hinzu, und setzen Sie den Parameter `max_length` auf `50`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial002_an.py!}
+ ```
+
+Beachten Sie, dass der Defaultwert immer noch `None` ist, sodass der Parameter immer noch optional ist.
+
+Aber jetzt, mit `Query(max_length=50)` innerhalb von `Annotated`, sagen wir FastAPI, dass es diesen Wert aus den Query-Parametern extrahieren soll (das hätte es sowieso gemacht 🤷) und dass wir eine **zusätzliche Validierung** für diesen Wert haben wollen (darum machen wir das, um die zusätzliche Validierung zu bekommen). 😎
+
+FastAPI wird nun:
+
+* Die Daten **validieren** und sicherstellen, dass sie nicht länger als 50 Zeichen sind
+* Dem Client einen **verständlichen Fehler** anzeigen, wenn die Daten ungültig sind
+* Den Parameter in der OpenAPI-Schema-*Pfadoperation* **dokumentieren** (sodass er in der **automatischen Dokumentation** angezeigt wird)
+
+## Alternativ (alt): `Query` als Defaultwert
+
+Frühere Versionen von FastAPI (vor 0.95.0) benötigten `Query` als Defaultwert des Parameters, statt es innerhalb von `Annotated` unterzubringen. Die Chance ist groß, dass Sie Quellcode sehen, der das immer noch so macht, darum erkläre ich es Ihnen.
+
+!!! tip "Tipp"
+ Verwenden Sie für neuen Code, und wann immer möglich, `Annotated`, wie oben erklärt. Es gibt mehrere Vorteile (unten erläutert) und keine Nachteile. 🍰
+
+So würden Sie `Query()` als Defaultwert Ihres Funktionsparameters verwenden, den Parameter `max_length` auf 50 gesetzt:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial002.py!}
+ ```
+
+Da wir in diesem Fall (ohne die Verwendung von `Annotated`) den Parameter-Defaultwert `None` mit `Query()` ersetzen, müssen wir nun dessen Defaultwert mit dem Parameter `Query(default=None)` deklarieren. Das dient demselben Zweck, `None` als Defaultwert für den Funktionsparameter zu setzen (zumindest für FastAPI).
+
+Sprich:
+
+```Python
+q: Union[str, None] = Query(default=None)
+```
+
+... macht den Parameter optional, mit dem Defaultwert `None`, genauso wie:
+
+```Python
+q: Union[str, None] = None
+```
+
+Und in Python 3.10 und darüber macht:
+
+```Python
+q: str | None = Query(default=None)
+```
+
+... den Parameter optional, mit dem Defaultwert `None`, genauso wie:
+
+```Python
+q: str | None = None
+```
+
+Nur, dass die `Query`-Versionen den Parameter explizit als Query-Parameter deklarieren.
+
+!!! info
+ Bedenken Sie, dass:
+
+ ```Python
+ = None
+ ```
+
+ oder:
+
+ ```Python
+ = Query(default=None)
+ ```
+
+ der wichtigste Teil ist, um einen Parameter optional zu machen, da dieses `None` der Defaultwert ist, und das ist es, was diesen Parameter **nicht erforderlich** macht.
+
+ Der Teil mit `Union[str, None]` erlaubt es Ihrem Editor, Sie besser zu unterstützen, aber er sagt FastAPI nicht, dass dieser Parameter optional ist.
+
+Jetzt können wir `Query` weitere Parameter übergeben. Fangen wir mit dem `max_length` Parameter an, der auf Strings angewendet wird:
+
+```Python
+q: Union[str, None] = Query(default=None, max_length=50)
+```
+
+Das wird die Daten validieren, einen verständlichen Fehler ausgeben, wenn die Daten nicht gültig sind, und den Parameter in der OpenAPI-Schema-*Pfadoperation* dokumentieren.
+
+### `Query` als Defaultwert oder in `Annotated`
+
+Bedenken Sie, dass wenn Sie `Query` innerhalb von `Annotated` benutzen, Sie den `default`-Parameter für `Query` nicht verwenden dürfen.
+
+Setzen Sie stattdessen den Defaultwert des Funktionsparameters, sonst wäre es inkonsistent.
+
+Zum Beispiel ist das nicht erlaubt:
+
+```Python
+q: Annotated[str, Query(default="rick")] = "morty"
+```
+
+... denn es wird nicht klar, ob der Defaultwert `"rick"` oder `"morty"` sein soll.
+
+Sie würden also (bevorzugt) schreiben:
+
+```Python
+q: Annotated[str, Query()] = "rick"
+```
+
+In älterem Code werden Sie auch finden:
+
+```Python
+q: str = Query(default="rick")
+```
+
+### Vorzüge von `Annotated`
+
+**Es wird empfohlen, `Annotated` zu verwenden**, statt des Defaultwertes im Funktionsparameter, das ist aus mehreren Gründen **besser**: 🤓
+
+Der **Default**wert des **Funktionsparameters** ist der **tatsächliche Default**wert, das spielt generell intuitiver mit Python zusammen. 😌
+
+Sie können die Funktion ohne FastAPI an **anderen Stellen aufrufen**, und es wird **wie erwartet funktionieren**. Wenn es einen **erforderlichen** Parameter gibt (ohne Defaultwert), und Sie führen die Funktion ohne den benötigten Parameter aus, dann wird Ihr **Editor** Sie das mit einem Fehler wissen lassen, und **Python** wird sich auch beschweren.
+
+Wenn Sie aber nicht `Annotated` benutzen und stattdessen die **(alte) Variante mit einem Defaultwert**, dann müssen Sie, wenn Sie die Funktion ohne FastAPI an **anderen Stellen** aufrufen, sich daran **erinnern**, die Argumente der Funktion zu übergeben, damit es richtig funktioniert. Ansonsten erhalten Sie unerwartete Werte (z. B. `QueryInfo` oder etwas Ähnliches, statt `str`). Ihr Editor kann ihnen nicht helfen, und Python wird die Funktion ohne Beschwerden ausführen, es sei denn, die Operationen innerhalb lösen einen Fehler aus.
+
+Da `Annotated` mehrere Metadaten haben kann, können Sie dieselbe Funktion auch mit anderen Tools verwenden, wie etwa Typer. 🚀
+
+## Mehr Validierungen hinzufügen
+
+Sie können auch einen Parameter `min_length` hinzufügen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial003.py!}
+ ```
+
+## Reguläre Ausdrücke hinzufügen
+
+Sie können einen Regulären Ausdruck `pattern` definieren, mit dem der Parameter übereinstimmen muss:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial004_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial004_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/query_params_str_validations/tutorial004_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial004.py!}
+ ```
+
+Dieses bestimmte reguläre Suchmuster prüft, ob der erhaltene Parameter-Wert:
+
+* `^`: mit den nachfolgenden Zeichen startet, keine Zeichen davor hat.
+* `fixedquery`: den exakten Text `fixedquery` hat.
+* `$`: danach endet, keine weiteren Zeichen hat als `fixedquery`.
+
+Wenn Sie sich verloren fühlen bei all diesen **„Regulärer Ausdruck“**-Konzepten, keine Sorge. Reguläre Ausdrücke sind für viele Menschen ein schwieriges Thema. Sie können auch ohne reguläre Ausdrücke eine ganze Menge machen.
+
+Aber wenn Sie sie brauchen und sie lernen, wissen Sie, dass Sie sie bereits direkt in **FastAPI** verwenden können.
+
+### Pydantic v1 `regex` statt `pattern`
+
+Vor Pydantic Version 2 und vor FastAPI Version 0.100.0, war der Name des Parameters `regex` statt `pattern`, aber das ist jetzt deprecated.
+
+Sie könnten immer noch Code sehen, der den alten Namen verwendet:
+
+=== "Python 3.10+ Pydantic v1"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial004_an_py310_regex.py!}
+ ```
+
+Beachten Sie aber, dass das deprecated ist, und zum neuen Namen `pattern` geändert werden sollte. 🤓
+
+## Defaultwerte
+
+Sie können natürlich andere Defaultwerte als `None` verwenden.
+
+Beispielsweise könnten Sie den `q` Query-Parameter so deklarieren, dass er eine `min_length` von `3` hat, und den Defaultwert `"fixedquery"`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params_str_validations/tutorial005_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial005.py!}
+ ```
+
+!!! note "Hinweis"
+ Ein Parameter ist optional (nicht erforderlich), wenn er irgendeinen Defaultwert, auch `None`, hat.
+
+## Erforderliche Parameter
+
+Wenn wir keine Validierungen oder Metadaten haben, können wir den `q` Query-Parameter erforderlich machen, indem wir einfach keinen Defaultwert deklarieren, wie in:
+
+```Python
+q: str
+```
+
+statt:
+
+```Python
+q: Union[str, None] = None
+```
+
+Aber jetzt deklarieren wir den Parameter mit `Query`, wie in:
+
+=== "Annotiert"
+
+ ```Python
+ q: Annotated[Union[str, None], Query(min_length=3)] = None
+ ```
+
+=== "Nicht annotiert"
+
+ ```Python
+ q: Union[str, None] = Query(default=None, min_length=3)
+ ```
+
+Wenn Sie einen Parameter erforderlich machen wollen, während Sie `Query` verwenden, deklarieren Sie ebenfalls einfach keinen Defaultwert:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006.py!}
+ ```
+
+ !!! tip "Tipp"
+ Beachten Sie, dass, obwohl in diesem Fall `Query()` der Funktionsparameter-Defaultwert ist, wir nicht `default=None` zu `Query()` hinzufügen.
+
+ Verwenden Sie bitte trotzdem die `Annotated`-Version. 😉
+
+### Erforderlich mit Ellipse (`...`)
+
+Es gibt eine Alternative, die explizit deklariert, dass ein Wert erforderlich ist. Sie können als Default das Literal `...` setzen:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006b_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006b_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006b.py!}
+ ```
+
+!!! info
+ Falls Sie das `...` bisher noch nicht gesehen haben: Es ist ein spezieller einzelner Wert, Teil von Python und wird „Ellipsis“ genannt (Deutsch: Ellipse).
+
+ Es wird von Pydantic und FastAPI verwendet, um explizit zu deklarieren, dass ein Wert erforderlich ist.
+
+Dies wird **FastAPI** wissen lassen, dass dieser Parameter erforderlich ist.
+
+### Erforderlich, kann `None` sein
+
+Sie können deklarieren, dass ein Parameter `None` akzeptiert, aber dennoch erforderlich ist. Das zwingt Clients, den Wert zu senden, selbst wenn er `None` ist.
+
+Um das zu machen, deklarieren Sie, dass `None` ein gültiger Typ ist, aber verwenden Sie dennoch `...` als Default:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006c_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006c_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006c_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006c_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial006c.py!}
+ ```
+
+!!! tip "Tipp"
+ Pydantic, welches die gesamte Datenvalidierung und Serialisierung in FastAPI antreibt, hat ein spezielles Verhalten, wenn Sie `Optional` oder `Union[Something, None]` ohne Defaultwert verwenden, Sie können mehr darüber in der Pydantic-Dokumentation unter Required fields erfahren.
+
+!!! tip "Tipp"
+ Denken Sie daran, dass Sie in den meisten Fällen, wenn etwas erforderlich ist, einfach den Defaultwert weglassen können. Sie müssen also normalerweise `...` nicht verwenden.
+
+## Query-Parameter-Liste / Mehrere Werte
+
+Wenn Sie einen Query-Parameter explizit mit `Query` auszeichnen, können Sie ihn auch eine Liste von Werten empfangen lassen, oder anders gesagt, mehrere Werte.
+
+Um zum Beispiel einen Query-Parameter `q` zu deklarieren, der mehrere Male in der URL vorkommen kann, schreiben Sie:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial011_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial011_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial011_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial011_py310.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial011_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial011.py!}
+ ```
+
+Dann, mit einer URL wie:
+
+```
+http://localhost:8000/items/?q=foo&q=bar
+```
+
+bekommen Sie alle `q`-*Query-Parameter*-Werte (`foo` und `bar`) in einer Python-Liste – `list` – in ihrer *Pfadoperation-Funktion*, im Funktionsparameter `q`, überreicht.
+
+Die Response für diese URL wäre also:
+
+```JSON
+{
+ "q": [
+ "foo",
+ "bar"
+ ]
+}
+```
+
+!!! tip "Tipp"
+ Um einen Query-Parameter vom Typ `list` zu deklarieren, wie im Beispiel oben, müssen Sie explizit `Query` verwenden, sonst würde der Parameter als Requestbody interpretiert werden.
+
+Die interaktive API-Dokumentation wird entsprechend aktualisiert und erlaubt jetzt mehrere Werte.
+
+
+
+### Query-Parameter-Liste / Mehrere Werte mit Defaults
+
+Und Sie können auch eine Default-`list`e von Werten definieren, wenn keine übergeben werden:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial012_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial012_an.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial012_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial012.py!}
+ ```
+
+Wenn Sie auf:
+
+```
+http://localhost:8000/items/
+```
+
+gehen, wird der Default für `q` verwendet: `["foo", "bar"]`, und als Response erhalten Sie:
+
+```JSON
+{
+ "q": [
+ "foo",
+ "bar"
+ ]
+}
+```
+
+#### `list` alleine verwenden
+
+Sie können auch `list` direkt verwenden, anstelle von `List[str]` (oder `list[str]` in Python 3.9+):
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial013_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params_str_validations/tutorial013_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial013.py!}
+ ```
+
+!!! note "Hinweis"
+ Beachten Sie, dass FastAPI in diesem Fall den Inhalt der Liste nicht überprüft.
+
+ Zum Beispiel würde `List[int]` überprüfen (und dokumentieren) dass die Liste Ganzzahlen enthält. `list` alleine macht das nicht.
+
+## Deklarieren von mehr Metadaten
+
+Sie können mehr Informationen zum Parameter hinzufügen.
+
+Diese Informationen werden zur generierten OpenAPI hinzugefügt, und von den Dokumentations-Oberflächen und von externen Tools verwendet.
+
+!!! note "Hinweis"
+ Beachten Sie, dass verschiedene Tools OpenAPI möglicherweise unterschiedlich gut unterstützen.
+
+ Einige könnten noch nicht alle zusätzlichen Informationen anzeigen, die Sie deklariert haben, obwohl in den meisten Fällen geplant ist, das fehlende Feature zu implementieren.
+
+Sie können einen Titel hinzufügen – `title`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial007_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial007_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial007_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params_str_validations/tutorial007_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial007.py!}
+ ```
+
+Und eine Beschreibung – `description`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/query_params_str_validations/tutorial008_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/query_params_str_validations/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="15"
+ {!> ../../../docs_src/query_params_str_validations/tutorial008_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial008_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/query_params_str_validations/tutorial008.py!}
+ ```
+
+## Alias-Parameter
+
+Stellen Sie sich vor, der Parameter soll `item-query` sein.
+
+Wie in:
+
+```
+http://127.0.0.1:8000/items/?item-query=foobaritems
+```
+
+Aber `item-query` ist kein gültiger Name für eine Variable in Python.
+
+Am ähnlichsten wäre `item_query`.
+
+Aber Sie möchten dennoch exakt `item-query` verwenden.
+
+Dann können Sie einen `alias` deklarieren, und dieser Alias wird verwendet, um den Parameter-Wert zu finden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial009_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial009_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial009_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params_str_validations/tutorial009_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params_str_validations/tutorial009.py!}
+ ```
+
+## Parameter als deprecated ausweisen
+
+Nehmen wir an, Sie mögen diesen Parameter nicht mehr.
+
+Sie müssen ihn eine Weile dort belassen, weil Clients ihn benutzen, aber Sie möchten, dass die Dokumentation klar anzeigt, dass er deprecated ist.
+
+In diesem Fall fügen Sie den Parameter `deprecated=True` zu `Query` hinzu.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/query_params_str_validations/tutorial010_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/query_params_str_validations/tutorial010_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20"
+ {!> ../../../docs_src/query_params_str_validations/tutorial010_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/query_params_str_validations/tutorial010_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/query_params_str_validations/tutorial010.py!}
+ ```
+
+Die Dokumentation wird das so anzeigen:
+
+
+
+## Parameter von OpenAPI ausschließen
+
+Um einen Query-Parameter vom generierten OpenAPI-Schema auszuschließen (und daher von automatischen Dokumentations-Systemen), setzen Sie den Parameter `include_in_schema` in `Query` auf `False`.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial014_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial014_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/query_params_str_validations/tutorial014_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params_str_validations/tutorial014_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params_str_validations/tutorial014.py!}
+ ```
+
+## Zusammenfassung
+
+Sie können zusätzliche Validierungen und Metadaten zu ihren Parametern hinzufügen.
+
+Allgemeine Validierungen und Metadaten:
+
+* `alias`
+* `title`
+* `description`
+* `deprecated`
+
+Validierungen spezifisch für Strings:
+
+* `min_length`
+* `max_length`
+* `pattern`
+
+In diesen Beispielen haben Sie gesehen, wie Sie Validierungen für Strings hinzufügen.
+
+In den nächsten Kapiteln sehen wir, wie man Validierungen für andere Typen hinzufügt, etwa für Zahlen.
diff --git a/docs/de/docs/tutorial/query-params.md b/docs/de/docs/tutorial/query-params.md
new file mode 100644
index 000000000..1b9b56bea
--- /dev/null
+++ b/docs/de/docs/tutorial/query-params.md
@@ -0,0 +1,226 @@
+# Query-Parameter
+
+Wenn Sie in ihrer Funktion Parameter deklarieren, die nicht Teil der Pfad-Parameter sind, dann werden diese automatisch als „Query“-Parameter interpretiert.
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params/tutorial001.py!}
+```
+
+Query-Parameter (Deutsch: Abfrage-Parameter) sind die Schlüssel-Wert-Paare, die nach dem `?` in einer URL aufgelistet sind, getrennt durch `&`-Zeichen.
+
+Zum Beispiel sind in der URL:
+
+```
+http://127.0.0.1:8000/items/?skip=0&limit=10
+```
+
+... die Query-Parameter:
+
+* `skip`: mit dem Wert `0`
+* `limit`: mit dem Wert `10`
+
+Da sie Teil der URL sind, sind sie „naturgemäß“ Strings.
+
+Aber wenn Sie sie mit Python-Typen deklarieren (im obigen Beispiel als `int`), werden sie zu diesem Typ konvertiert, und gegen diesen validiert.
+
+Die gleichen Prozesse, die für Pfad-Parameter stattfinden, werden auch auf Query-Parameter angewendet:
+
+* Editor Unterstützung (natürlich)
+* „Parsen“ der Daten
+* Datenvalidierung
+* Automatische Dokumentation
+
+## Defaultwerte
+
+Da Query-Parameter nicht ein festgelegter Teil des Pfades sind, können sie optional sein und Defaultwerte haben.
+
+Im obigen Beispiel haben sie die Defaultwerte `skip=0` und `limit=10`.
+
+Wenn Sie also zur URL:
+
+```
+http://127.0.0.1:8000/items/
+```
+
+gehen, so ist das das gleiche wie die URL:
+
+```
+http://127.0.0.1:8000/items/?skip=0&limit=10
+```
+
+Aber wenn Sie zum Beispiel zu:
+
+```
+http://127.0.0.1:8000/items/?skip=20
+```
+
+gehen, werden die Parameter-Werte Ihrer Funktion sein:
+
+* `skip=20`: da Sie das in der URL gesetzt haben
+* `limit=10`: weil das der Defaultwert ist
+
+## Optionale Parameter
+
+Auf die gleiche Weise können Sie optionale Query-Parameter deklarieren, indem Sie deren Defaultwert auf `None` setzen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params/tutorial002.py!}
+ ```
+
+In diesem Fall wird der Funktionsparameter `q` optional, und standardmäßig `None` sein.
+
+!!! check
+ Beachten Sie auch, dass **FastAPI** intelligent genug ist, um zu erkennen, dass `item_id` ein Pfad-Parameter ist und `q` keiner, daher muss letzteres ein Query-Parameter sein.
+
+## Query-Parameter Typkonvertierung
+
+Sie können auch `bool`-Typen deklarieren und sie werden konvertiert:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params/tutorial003.py!}
+ ```
+
+Wenn Sie nun zu:
+
+```
+http://127.0.0.1:8000/items/foo?short=1
+```
+
+oder
+
+```
+http://127.0.0.1:8000/items/foo?short=True
+```
+
+oder
+
+```
+http://127.0.0.1:8000/items/foo?short=true
+```
+
+oder
+
+```
+http://127.0.0.1:8000/items/foo?short=on
+```
+
+oder
+
+```
+http://127.0.0.1:8000/items/foo?short=yes
+```
+
+gehen, oder zu irgendeiner anderen Variante der Groß-/Kleinschreibung (Alles groß, Anfangsbuchstabe groß, usw.), dann wird Ihre Funktion den Parameter `short` mit dem `bool`-Wert `True` sehen, ansonsten mit dem Wert `False`.
+
+## Mehrere Pfad- und Query-Parameter
+
+Sie können mehrere Pfad-Parameter und Query-Parameter gleichzeitig deklarieren, **FastAPI** weiß, was welches ist.
+
+Und Sie müssen sie auch nicht in einer spezifischen Reihenfolge deklarieren.
+
+Parameter werden anhand ihres Namens erkannt:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="6 8"
+ {!> ../../../docs_src/query_params/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8 10"
+ {!> ../../../docs_src/query_params/tutorial004.py!}
+ ```
+
+## Erforderliche Query-Parameter
+
+Wenn Sie einen Defaultwert für Nicht-Pfad-Parameter deklarieren (Bis jetzt haben wir nur Query-Parameter gesehen), dann ist der Parameter nicht erforderlich.
+
+Wenn Sie keinen spezifischen Wert haben wollen, sondern der Parameter einfach optional sein soll, dann setzen Sie den Defaultwert auf `None`.
+
+Aber wenn Sie wollen, dass ein Query-Parameter erforderlich ist, vergeben Sie einfach keinen Defaultwert:
+
+```Python hl_lines="6-7"
+{!../../../docs_src/query_params/tutorial005.py!}
+```
+
+Hier ist `needy` ein erforderlicher Query-Parameter vom Typ `str`.
+
+Wenn Sie in Ihrem Browser eine URL wie:
+
+```
+http://127.0.0.1:8000/items/foo-item
+```
+
+... öffnen, ohne den benötigten Parameter `needy`, dann erhalten Sie einen Fehler wie den folgenden:
+
+```JSON
+{
+ "detail": [
+ {
+ "type": "missing",
+ "loc": [
+ "query",
+ "needy"
+ ],
+ "msg": "Field required",
+ "input": null,
+ "url": "https://errors.pydantic.dev/2.1/v/missing"
+ }
+ ]
+}
+```
+
+Da `needy` ein erforderlicher Parameter ist, müssen Sie ihn in der URL setzen:
+
+```
+http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
+```
+
+... Das funktioniert:
+
+```JSON
+{
+ "item_id": "foo-item",
+ "needy": "sooooneedy"
+}
+```
+
+Und natürlich können Sie einige Parameter als erforderlich, einige mit Defaultwert, und einige als vollständig optional definieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params/tutorial006_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params/tutorial006.py!}
+ ```
+
+In diesem Fall gibt es drei Query-Parameter:
+
+* `needy`, ein erforderlicher `str`.
+* `skip`, ein `int` mit einem Defaultwert `0`.
+* `limit`, ein optionales `int`.
+
+!!! tip "Tipp"
+ Sie können auch `Enum`s verwenden, auf die gleiche Weise wie mit [Pfad-Parametern](path-params.md#vordefinierte-parameterwerte){.internal-link target=_blank}.
diff --git a/docs/de/docs/tutorial/request-files.md b/docs/de/docs/tutorial/request-files.md
new file mode 100644
index 000000000..67b5e3a87
--- /dev/null
+++ b/docs/de/docs/tutorial/request-files.md
@@ -0,0 +1,314 @@
+# Dateien im Request
+
+Mit `File` können sie vom Client hochzuladende Dateien definieren.
+
+!!! info
+ Um hochgeladene Dateien zu empfangen, installieren Sie zuerst `python-multipart`.
+
+ Z. B. `pip install python-multipart`.
+
+ Das, weil hochgeladene Dateien als „Formulardaten“ gesendet werden.
+
+## `File` importieren
+
+Importieren Sie `File` und `UploadFile` von `fastapi`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_files/tutorial001.py!}
+ ```
+
+## `File`-Parameter definieren
+
+Erstellen Sie Datei-Parameter, so wie Sie es auch mit `Body` und `Form` machen würden:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/request_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/request_files/tutorial001.py!}
+ ```
+
+!!! info
+ `File` ist eine Klasse, die direkt von `Form` erbt.
+
+ Aber erinnern Sie sich, dass, wenn Sie `Query`, `Path`, `File` und andere von `fastapi` importieren, diese tatsächlich Funktionen sind, welche spezielle Klassen zurückgeben
+
+!!! tip "Tipp"
+ Um Dateibodys zu deklarieren, müssen Sie `File` verwenden, da diese Parameter sonst als Query-Parameter oder Body(-JSON)-Parameter interpretiert werden würden.
+
+Die Dateien werden als „Formulardaten“ hochgeladen.
+
+Wenn Sie den Typ Ihrer *Pfadoperation-Funktion* als `bytes` deklarieren, wird **FastAPI** die Datei für Sie auslesen, und Sie erhalten den Inhalt als `bytes`.
+
+Bedenken Sie, dass das bedeutet, dass sich der gesamte Inhalt der Datei im Arbeitsspeicher befindet. Das wird für kleinere Dateien gut funktionieren.
+
+Aber es gibt viele Fälle, in denen Sie davon profitieren, `UploadFile` zu verwenden.
+
+## Datei-Parameter mit `UploadFile`
+
+Definieren Sie einen Datei-Parameter mit dem Typ `UploadFile`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/request_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/request_files/tutorial001.py!}
+ ```
+
+`UploadFile` zu verwenden, hat mehrere Vorzüge gegenüber `bytes`:
+
+* Sie müssen `File()` nicht als Parameter-Defaultwert verwenden.
+* Es wird eine „Spool“-Datei verwendet:
+ * Eine Datei, die bis zu einem bestimmten Größen-Limit im Arbeitsspeicher behalten wird, und wenn das Limit überschritten wird, auf der Festplatte gespeichert wird.
+* Das bedeutet, es wird für große Dateien wie Bilder, Videos, große Binärdateien, usw. gut funktionieren, ohne den ganzen Arbeitsspeicher aufzubrauchen.
+* Sie können Metadaten aus der hochgeladenen Datei auslesen.
+* Es hat eine file-like `async`hrone Schnittstelle.
+* Es stellt ein tatsächliches Python-`SpooledTemporaryFile`-Objekt bereit, welches Sie direkt anderen Bibliotheken übergeben können, die ein dateiartiges Objekt erwarten.
+
+### `UploadFile`
+
+`UploadFile` hat die folgenden Attribute:
+
+* `filename`: Ein `str` mit dem ursprünglichen Namen der hochgeladenen Datei (z. B. `meinbild.jpg`).
+* `content_type`: Ein `str` mit dem Inhaltstyp (MIME-Typ / Medientyp) (z. B. `image/jpeg`).
+* `file`: Ein `SpooledTemporaryFile` (ein file-like Objekt). Das ist das tatsächliche Python-Objekt, das Sie direkt anderen Funktionen oder Bibliotheken übergeben können, welche ein „file-like“-Objekt erwarten.
+
+`UploadFile` hat die folgenden `async`hronen Methoden. Sie alle rufen die entsprechenden Methoden des darunterliegenden Datei-Objekts auf (wobei intern `SpooledTemporaryFile` verwendet wird).
+
+* `write(daten)`: Schreibt `daten` (`str` oder `bytes`) in die Datei.
+* `read(anzahl)`: Liest `anzahl` (`int`) bytes/Zeichen aus der Datei.
+* `seek(versatz)`: Geht zur Position `versatz` (`int`) in der Datei.
+ * Z. B. würde `await myfile.seek(0)` zum Anfang der Datei gehen.
+ * Das ist besonders dann nützlich, wenn Sie `await myfile.read()` einmal ausführen und dann diese Inhalte erneut auslesen müssen.
+* `close()`: Schließt die Datei.
+
+Da alle diese Methoden `async`hron sind, müssen Sie sie `await`en („erwarten“).
+
+Zum Beispiel können Sie innerhalb einer `async` *Pfadoperation-Funktion* den Inhalt wie folgt auslesen:
+
+```Python
+contents = await myfile.read()
+```
+
+Wenn Sie sich innerhalb einer normalen `def`-*Pfadoperation-Funktion* befinden, können Sie direkt auf `UploadFile.file` zugreifen, zum Beispiel:
+
+```Python
+contents = myfile.file.read()
+```
+
+!!! note "Technische Details zu `async`"
+ Wenn Sie die `async`-Methoden verwenden, führt **FastAPI** die Datei-Methoden in einem Threadpool aus und erwartet sie.
+
+!!! note "Technische Details zu Starlette"
+ **FastAPI**s `UploadFile` erbt direkt von **Starlette**s `UploadFile`, fügt aber ein paar notwendige Teile hinzu, um es kompatibel mit **Pydantic** und anderen Teilen von FastAPI zu machen.
+
+## Was sind „Formulardaten“
+
+HTML-Formulare (``) senden die Daten in einer „speziellen“ Kodierung zum Server, welche sich von JSON unterscheidet.
+
+**FastAPI** stellt sicher, dass diese Daten korrekt ausgelesen werden, statt JSON zu erwarten.
+
+!!! note "Technische Details"
+ Daten aus Formularen werden, wenn es keine Dateien sind, normalerweise mit dem „media type“ `application/x-www-form-urlencoded` kodiert.
+
+ Sollte das Formular aber Dateien enthalten, dann werden diese mit `multipart/form-data` kodiert. Wenn Sie `File` verwenden, wird **FastAPI** wissen, dass es die Dateien vom korrekten Teil des Bodys holen muss.
+
+ Wenn Sie mehr über Formularfelder und ihre Kodierungen lesen möchten, besuchen Sie die MDN-Webdokumentation für POST.
+
+!!! warning "Achtung"
+ Sie können mehrere `File`- und `Form`-Parameter in einer *Pfadoperation* deklarieren, aber Sie können nicht gleichzeitig auch `Body`-Felder deklarieren, welche Sie als JSON erwarten, da der Request den Body mittels `multipart/form-data` statt `application/json` kodiert.
+
+ Das ist keine Limitation von **FastAPI**, sondern Teil des HTTP-Protokolls.
+
+## Optionaler Datei-Upload
+
+Sie können eine Datei optional machen, indem Sie Standard-Typannotationen verwenden und den Defaultwert auf `None` setzen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9 17"
+ {!> ../../../docs_src/request_files/tutorial001_02_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9 17"
+ {!> ../../../docs_src/request_files/tutorial001_02_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10 18"
+ {!> ../../../docs_src/request_files/tutorial001_02_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7 15"
+ {!> ../../../docs_src/request_files/tutorial001_02_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9 17"
+ {!> ../../../docs_src/request_files/tutorial001_02.py!}
+ ```
+
+## `UploadFile` mit zusätzlichen Metadaten
+
+Sie können auch `File()` zusammen mit `UploadFile` verwenden, um zum Beispiel zusätzliche Metadaten zu setzen:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9 15"
+ {!> ../../../docs_src/request_files/tutorial001_03_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8 14"
+ {!> ../../../docs_src/request_files/tutorial001_03_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7 13"
+ {!> ../../../docs_src/request_files/tutorial001_03.py!}
+ ```
+
+## Mehrere Datei-Uploads
+
+Es ist auch möglich, mehrere Dateien gleichzeitig hochzuladen.
+
+Diese werden demselben Formularfeld zugeordnet, welches mit den Formulardaten gesendet wird.
+
+Um das zu machen, deklarieren Sie eine Liste von `bytes` oder `UploadFile`s:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/request_files/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/request_files/tutorial002_an.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/request_files/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/request_files/tutorial002.py!}
+ ```
+
+Sie erhalten, wie deklariert, eine `list`e von `bytes` oder `UploadFile`s.
+
+!!! note "Technische Details"
+ Sie können auch `from starlette.responses import HTMLResponse` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
+
+### Mehrere Datei-Uploads mit zusätzlichen Metadaten
+
+Und so wie zuvor können Sie `File()` verwenden, um zusätzliche Parameter zu setzen, sogar für `UploadFile`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11 18-20"
+ {!> ../../../docs_src/request_files/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12 19-21"
+ {!> ../../../docs_src/request_files/tutorial003_an.py!}
+ ```
+
+=== "Python 3.9+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="9 16"
+ {!> ../../../docs_src/request_files/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="11 18"
+ {!> ../../../docs_src/request_files/tutorial003.py!}
+ ```
+
+## Zusammenfassung
+
+Verwenden Sie `File`, `bytes` und `UploadFile`, um hochladbare Dateien im Request zu deklarieren, die als Formulardaten gesendet werden.
diff --git a/docs/de/docs/tutorial/request-forms-and-files.md b/docs/de/docs/tutorial/request-forms-and-files.md
new file mode 100644
index 000000000..86b1406e6
--- /dev/null
+++ b/docs/de/docs/tutorial/request-forms-and-files.md
@@ -0,0 +1,69 @@
+# Formulardaten und Dateien im Request
+
+Sie können gleichzeitig Dateien und Formulardaten mit `File` und `Form` definieren.
+
+!!! info
+ Um hochgeladene Dateien und/oder Formulardaten zu empfangen, installieren Sie zuerst `python-multipart`.
+
+ Z. B. `pip install python-multipart`.
+
+## `File` und `Form` importieren
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
+ ```
+
+## `File` und `Form`-Parameter definieren
+
+Erstellen Sie Datei- und Formularparameter, so wie Sie es auch mit `Body` und `Query` machen würden:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10-12"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-11"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
+ ```
+
+Die Datei- und Formularfelder werden als Formulardaten hochgeladen, und Sie erhalten diese Dateien und Formularfelder.
+
+Und Sie können einige der Dateien als `bytes` und einige als `UploadFile` deklarieren.
+
+!!! warning "Achtung"
+ Sie können mehrere `File`- und `Form`-Parameter in einer *Pfadoperation* deklarieren, aber Sie können nicht gleichzeitig auch `Body`-Felder deklarieren, welche Sie als JSON erwarten, da der Request den Body mittels `multipart/form-data` statt `application/json` kodiert.
+
+ Das ist keine Limitation von **FastAPI**, sondern Teil des HTTP-Protokolls.
+
+## Zusammenfassung
+
+Verwenden Sie `File` und `Form` zusammen, wenn Sie Daten und Dateien zusammen im selben Request empfangen müssen.
diff --git a/docs/de/docs/tutorial/request-forms.md b/docs/de/docs/tutorial/request-forms.md
new file mode 100644
index 000000000..6c029b5fe
--- /dev/null
+++ b/docs/de/docs/tutorial/request-forms.md
@@ -0,0 +1,92 @@
+# Formulardaten
+
+Wenn Sie Felder aus Formularen statt JSON empfangen müssen, können Sie `Form` verwenden.
+
+!!! info
+ Um Formulare zu verwenden, installieren Sie zuerst `python-multipart`.
+
+ Z. B. `pip install python-multipart`.
+
+## `Form` importieren
+
+Importieren Sie `Form` von `fastapi`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/request_forms/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms/tutorial001.py!}
+ ```
+
+## `Form`-Parameter definieren
+
+Erstellen Sie Formular-Parameter, so wie Sie es auch mit `Body` und `Query` machen würden:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/request_forms/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/request_forms/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/request_forms/tutorial001.py!}
+ ```
+
+Zum Beispiel stellt eine der Möglichkeiten, die OAuth2 Spezifikation zu verwenden (genannt „password flow“), die Bedingung, einen `username` und ein `password` als Formularfelder zu senden.
+
+Die Spec erfordert, dass die Felder exakt `username` und `password` genannt werden und als Formularfelder, nicht JSON, gesendet werden.
+
+Mit `Form` haben Sie die gleichen Konfigurationsmöglichkeiten wie mit `Body` (und `Query`, `Path`, `Cookie`), inklusive Validierung, Beispielen, einem Alias (z. B. `user-name` statt `username`), usw.
+
+!!! info
+ `Form` ist eine Klasse, die direkt von `Body` erbt.
+
+!!! tip "Tipp"
+ Um Formularbodys zu deklarieren, verwenden Sie explizit `Form`, da diese Parameter sonst als Query-Parameter oder Body(-JSON)-Parameter interpretiert werden würden.
+
+## Über „Formularfelder“
+
+HTML-Formulare (``) senden die Daten in einer „speziellen“ Kodierung zum Server, welche sich von JSON unterscheidet.
+
+**FastAPI** stellt sicher, dass diese Daten korrekt ausgelesen werden, statt JSON zu erwarten.
+
+!!! note "Technische Details"
+ Daten aus Formularen werden normalerweise mit dem „media type“ `application/x-www-form-urlencoded` kodiert.
+
+ Wenn das Formular stattdessen Dateien enthält, werden diese mit `multipart/form-data` kodiert. Im nächsten Kapitel erfahren Sie mehr über die Handhabung von Dateien.
+
+ Wenn Sie mehr über Formularfelder und ihre Kodierungen lesen möchten, besuchen Sie die MDN-Webdokumentation für POST.
+
+!!! warning "Achtung"
+ Sie können mehrere `Form`-Parameter in einer *Pfadoperation* deklarieren, aber Sie können nicht gleichzeitig auch `Body`-Felder deklarieren, welche Sie als JSON erwarten, da der Request den Body mittels `application/x-www-form-urlencoded` statt `application/json` kodiert.
+
+ Das ist keine Limitation von **FastAPI**, sondern Teil des HTTP-Protokolls.
+
+## Zusammenfassung
+
+Verwenden Sie `Form`, um Eingabe-Parameter für Formulardaten zu deklarieren.
diff --git a/docs/de/docs/tutorial/response-model.md b/docs/de/docs/tutorial/response-model.md
new file mode 100644
index 000000000..d5b92e0f9
--- /dev/null
+++ b/docs/de/docs/tutorial/response-model.md
@@ -0,0 +1,486 @@
+# Responsemodell – Rückgabetyp
+
+Sie können den Typ der Response deklarieren, indem Sie den **Rückgabetyp** der *Pfadoperation* annotieren.
+
+Hierbei können Sie **Typannotationen** genauso verwenden, wie Sie es bei Werten von Funktions-**Parametern** machen; verwenden Sie Pydantic-Modelle, Listen, Dicts und skalare Werte wie Nummern, Booleans, usw.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="16 21"
+ {!> ../../../docs_src/response_model/tutorial001_01_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18 23"
+ {!> ../../../docs_src/response_model/tutorial001_01_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18 23"
+ {!> ../../../docs_src/response_model/tutorial001_01.py!}
+ ```
+
+FastAPI wird diesen Rückgabetyp verwenden, um:
+
+* Die zurückzugebenden Daten zu **validieren**.
+ * Wenn die Daten ungültig sind (Sie haben z. B. ein Feld vergessen), bedeutet das, *Ihr* Anwendungscode ist fehlerhaft, er gibt nicht zurück, was er sollte, und daher wird ein Server-Error ausgegeben, statt falscher Daten. So können Sie und ihre Clients sicher sein, dass diese die erwarteten Daten, in der richtigen Form erhalten.
+* In der OpenAPI *Pfadoperation* ein **JSON-Schema** für die Response hinzuzufügen.
+ * Dieses wird von der **automatischen Dokumentation** verwendet.
+ * Es wird auch von automatisch Client-Code-generierenden Tools verwendet.
+
+Aber am wichtigsten:
+
+* Es wird die Ausgabedaten auf das **limitieren und filtern**, was im Rückgabetyp definiert ist.
+ * Das ist insbesondere für die **Sicherheit** wichtig, mehr dazu unten.
+
+## `response_model`-Parameter
+
+Es gibt Fälle, da möchten oder müssen Sie Daten zurückgeben, die nicht genau dem entsprechen, was der Typ deklariert.
+
+Zum Beispiel könnten Sie **ein Dict zurückgeben** wollen, oder ein Datenbank-Objekt, aber **es als Pydantic-Modell deklarieren**. Auf diese Weise übernimmt das Pydantic-Modell alle Datendokumentation, -validierung, usw. für das Objekt, welches Sie zurückgeben (z. B. ein Dict oder ein Datenbank-Objekt).
+
+Würden Sie eine hierfür eine Rückgabetyp-Annotation verwenden, dann würden Tools und Editoren (korrekterweise) Fehler ausgeben, die Ihnen sagen, dass Ihre Funktion einen Typ zurückgibt (z. B. ein Dict), der sich unterscheidet von dem, was Sie deklariert haben (z. B. ein Pydantic-Modell).
+
+In solchen Fällen können Sie statt des Rückgabetyps den **Pfadoperation-Dekorator**-Parameter `response_model` verwenden.
+
+Sie können `response_model` in jeder möglichen *Pfadoperation* verwenden:
+
+* `@app.get()`
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+* usw.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="17 22 24-27"
+ {!> ../../../docs_src/response_model/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="17 22 24-27"
+ {!> ../../../docs_src/response_model/tutorial001_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17 22 24-27"
+ {!> ../../../docs_src/response_model/tutorial001.py!}
+ ```
+
+!!! note "Hinweis"
+ Beachten Sie, dass `response_model` ein Parameter der „Dekorator“-Methode ist (`get`, `post`, usw.). Nicht der *Pfadoperation-Funktion*, so wie die anderen Parameter.
+
+`response_model` nimmt denselben Typ entgegen, den Sie auch für ein Pydantic-Modellfeld deklarieren würden, also etwa ein Pydantic-Modell, aber es kann auch z. B. eine `list`e von Pydantic-Modellen sein, wie etwa `List[Item]`.
+
+FastAPI wird dieses `response_model` nehmen, um die Daten zu dokumentieren, validieren, usw. und auch, um **die Ausgabedaten** entsprechend der Typdeklaration **zu konvertieren und filtern**.
+
+!!! tip "Tipp"
+ Wenn Sie in Ihrem Editor strikte Typchecks haben, mypy, usw., können Sie den Funktions-Rückgabetyp als `Any` deklarieren.
+
+ So sagen Sie dem Editor, dass Sie absichtlich *irgendetwas* zurückgeben. Aber FastAPI wird trotzdem die Dokumentation, Validierung, Filterung, usw. der Daten übernehmen, via `response_model`.
+
+### `response_model`-Priorität
+
+Wenn sowohl Rückgabetyp als auch `response_model` deklariert sind, hat `response_model` die Priorität und wird von FastAPI bevorzugt verwendet.
+
+So können Sie korrekte Typannotationen zu ihrer Funktion hinzufügen, die von ihrem Editor und Tools wie mypy verwendet werden. Und dennoch übernimmt FastAPI die Validierung und Dokumentation, usw., der Daten anhand von `response_model`.
+
+Sie können auch `response_model=None` verwenden, um das Erstellen eines Responsemodells für diese *Pfadoperation* zu unterbinden. Sie könnten das tun wollen, wenn sie Dinge annotieren, die nicht gültige Pydantic-Felder sind. Ein Beispiel dazu werden Sie in einer der Abschnitte unten sehen.
+
+## Dieselben Eingabedaten zurückgeben
+
+Im Folgenden deklarieren wir ein `UserIn`-Modell; es enthält ein Klartext-Passwort:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7 9"
+ {!> ../../../docs_src/response_model/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 11"
+ {!> ../../../docs_src/response_model/tutorial002.py!}
+ ```
+
+!!! info
+ Um `EmailStr` zu verwenden, installieren Sie zuerst `email_validator`.
+
+ Z. B. `pip install email-validator`
+ oder `pip install pydantic[email]`.
+
+Wir verwenden dieses Modell, um sowohl unsere Eingabe- als auch Ausgabedaten zu deklarieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/response_model/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/response_model/tutorial002.py!}
+ ```
+
+Immer wenn jetzt ein Browser einen Benutzer mit Passwort erzeugt, gibt die API dasselbe Passwort in der Response zurück.
+
+Hier ist das möglicherweise kein Problem, da es derselbe Benutzer ist, der das Passwort sendet.
+
+Aber wenn wir dasselbe Modell für eine andere *Pfadoperation* verwenden, könnten wir das Passwort dieses Benutzers zu jedem Client schicken.
+
+!!! danger "Gefahr"
+ Speichern Sie niemals das Klartext-Passwort eines Benutzers, oder versenden Sie es in einer Response wie dieser, wenn Sie sich nicht der resultierenden Gefahren bewusst sind und nicht wissen, was Sie tun.
+
+## Ausgabemodell hinzufügen
+
+Wir können stattdessen ein Eingabemodell mit dem Klartext-Passwort, und ein Ausgabemodell ohne das Passwort erstellen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9 11 16"
+ {!> ../../../docs_src/response_model/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 11 16"
+ {!> ../../../docs_src/response_model/tutorial003.py!}
+ ```
+
+Obwohl unsere *Pfadoperation-Funktion* hier denselben `user` von der Eingabe zurückgibt, der das Passwort enthält:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="24"
+ {!> ../../../docs_src/response_model/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24"
+ {!> ../../../docs_src/response_model/tutorial003.py!}
+ ```
+
+... haben wir deklariert, dass `response_model` das Modell `UserOut` ist, welches das Passwort nicht enthält:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/response_model/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/response_model/tutorial003.py!}
+ ```
+
+Darum wird **FastAPI** sich darum kümmern, dass alle Daten, die nicht im Ausgabemodell deklariert sind, herausgefiltert werden (mittels Pydantic).
+
+### `response_model` oder Rückgabewert
+
+Da unsere zwei Modelle in diesem Fall unterschiedlich sind, würde, wenn wir den Rückgabewert der Funktion als `UserOut` deklarieren, der Editor sich beschweren, dass wir einen ungültigen Typ zurückgeben, weil das unterschiedliche Klassen sind.
+
+Darum müssen wir es in diesem Fall im `response_model`-Parameter deklarieren.
+
+... aber lesen Sie weiter, um zu sehen, wie man das anders lösen kann.
+
+## Rückgabewert und Datenfilterung
+
+Führen wir unser vorheriges Beispiel fort. Wir wollten **die Funktion mit einem Typ annotieren**, aber etwas zurückgeben, das **weniger Daten** enthält.
+
+Wir möchten auch, dass FastAPI die Daten weiterhin, dem Responsemodell entsprechend, **filtert**.
+
+Im vorherigen Beispiel mussten wir den `response_model`-Parameter verwenden, weil die Klassen unterschiedlich waren. Das bedeutet aber auch, wir bekommen keine Unterstützung vom Editor und anderen Tools, die den Funktions-Rückgabewert überprüfen.
+
+Aber in den meisten Fällen, wenn wir so etwas machen, wollen wir nur, dass das Modell einige der Daten **filtert/entfernt**, so wie in diesem Beispiel.
+
+Und in solchen Fällen können wir Klassen und Vererbung verwenden, um Vorteil aus den Typannotationen in der Funktion zu ziehen, was vom Editor und von Tools besser unterstützt wird, während wir gleichzeitig FastAPIs **Datenfilterung** behalten.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7-10 13-14 18"
+ {!> ../../../docs_src/response_model/tutorial003_01_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-13 15-16 20"
+ {!> ../../../docs_src/response_model/tutorial003_01.py!}
+ ```
+
+Damit erhalten wir Tool-Unterstützung, vom Editor und mypy, da dieser Code hinsichtlich der Typen korrekt ist, aber wir erhalten auch die Datenfilterung von FastAPI.
+
+Wie funktioniert das? Schauen wir uns das mal an. 🤓
+
+### Typannotationen und Tooling
+
+Sehen wir uns zunächst an, wie Editor, mypy und andere Tools dies sehen würden.
+
+`BaseUser` verfügt über die Basis-Felder. Dann erbt `UserIn` von `BaseUser` und fügt das Feld `Passwort` hinzu, sodass dass es nun alle Felder beider Modelle hat.
+
+Wir annotieren den Funktionsrückgabetyp als `BaseUser`, geben aber tatsächlich eine `UserIn`-Instanz zurück.
+
+Für den Editor, mypy und andere Tools ist das kein Problem, da `UserIn` eine Unterklasse von `BaseUser` ist (Salopp: `UserIn` ist ein `BaseUser`). Es handelt sich um einen *gültigen* Typ, solange irgendetwas überreicht wird, das ein `BaseUser` ist.
+
+### FastAPI Datenfilterung
+
+FastAPI seinerseits wird den Rückgabetyp sehen und sicherstellen, dass das, was zurückgegeben wird, **nur** diejenigen Felder enthält, welche im Typ deklariert sind.
+
+FastAPI macht intern mehrere Dinge mit Pydantic, um sicherzustellen, dass obige Ähnlichkeitsregeln der Klassenvererbung nicht auf die Filterung der zurückgegebenen Daten angewendet werden, sonst könnten Sie am Ende mehr Daten zurückgeben als gewollt.
+
+Auf diese Weise erhalten Sie das beste beider Welten: Sowohl Typannotationen mit **Tool-Unterstützung** als auch **Datenfilterung**.
+
+## Anzeige in der Dokumentation
+
+Wenn Sie sich die automatische Dokumentation betrachten, können Sie sehen, dass Eingabe- und Ausgabemodell beide ihr eigenes JSON-Schema haben:
+
+
+
+Und beide Modelle werden auch in der interaktiven API-Dokumentation verwendet:
+
+
+
+## Andere Rückgabetyp-Annotationen
+
+Es kann Fälle geben, bei denen Sie etwas zurückgeben, das kein gültiges Pydantic-Feld ist, und Sie annotieren es in der Funktion nur, um Unterstützung von Tools zu erhalten (Editor, mypy, usw.).
+
+### Eine Response direkt zurückgeben
+
+Der häufigste Anwendungsfall ist, wenn Sie [eine Response direkt zurückgeben, wie es später im Handbuch für fortgeschrittene Benutzer erläutert wird](../advanced/response-directly.md){.internal-link target=_blank}.
+
+```Python hl_lines="8 10-11"
+{!> ../../../docs_src/response_model/tutorial003_02.py!}
+```
+
+Dieser einfache Anwendungsfall wird automatisch von FastAPI gehandhabt, weil die Annotation des Rückgabetyps die Klasse (oder eine Unterklasse von) `Response` ist.
+
+Und Tools werden auch glücklich sein, weil sowohl `RedirectResponse` als auch `JSONResponse` Unterklassen von `Response` sind, die Typannotation ist daher korrekt.
+
+### Eine Unterklasse von Response annotieren
+
+Sie können auch eine Unterklasse von `Response` in der Typannotation verwenden.
+
+```Python hl_lines="8-9"
+{!> ../../../docs_src/response_model/tutorial003_03.py!}
+```
+
+Das wird ebenfalls funktionieren, weil `RedirectResponse` eine Unterklasse von `Response` ist, und FastAPI sich um diesen einfachen Anwendungsfall automatisch kümmert.
+
+### Ungültige Rückgabetyp-Annotationen
+
+Aber wenn Sie ein beliebiges anderes Objekt zurückgeben, das kein gültiger Pydantic-Typ ist (z. B. ein Datenbank-Objekt), und Sie annotieren es so in der Funktion, wird FastAPI versuchen, ein Pydantic-Responsemodell von dieser Typannotation zu erstellen, und scheitern.
+
+Das gleiche wird passieren, wenn Sie eine Union mehrerer Typen haben, und einer oder mehrere sind nicht gültige Pydantic-Typen. Zum Beispiel funktioniert folgendes nicht 💥:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/response_model/tutorial003_04_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/response_model/tutorial003_04.py!}
+ ```
+
+... das scheitert, da die Typannotation kein Pydantic-Typ ist, und auch keine einzelne `Response`-Klasse, oder -Unterklasse, es ist eine Union (eines von beiden) von `Response` und `dict`.
+
+### Responsemodell deaktivieren
+
+Beim Beispiel oben fortsetzend, mögen Sie vielleicht die standardmäßige Datenvalidierung, -Dokumentation, -Filterung, usw., die von FastAPI durchgeführt wird, nicht haben.
+
+Aber Sie möchten dennoch den Rückgabetyp in der Funktion annotieren, um Unterstützung von Editoren und Typcheckern (z. B. mypy) zu erhalten.
+
+In diesem Fall können Sie die Generierung des Responsemodells abschalten, indem Sie `response_model=None` setzen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/response_model/tutorial003_05_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/response_model/tutorial003_05.py!}
+ ```
+
+Das bewirkt, dass FastAPI die Generierung des Responsemodells unterlässt, und damit können Sie jede gewünschte Rückgabetyp-Annotation haben, ohne dass es Ihre FastAPI-Anwendung beeinflusst. 🤓
+
+## Parameter für die Enkodierung des Responsemodells
+
+Ihr Responsemodell könnte Defaultwerte haben, wie:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9 11-12"
+ {!> ../../../docs_src/response_model/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11 13-14"
+ {!> ../../../docs_src/response_model/tutorial004_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11 13-14"
+ {!> ../../../docs_src/response_model/tutorial004.py!}
+ ```
+
+* `description: Union[str, None] = None` (oder `str | None = None` in Python 3.10) hat einen Defaultwert `None`.
+* `tax: float = 10.5` hat einen Defaultwert `10.5`.
+* `tags: List[str] = []` hat eine leere Liste als Defaultwert: `[]`.
+
+Aber Sie möchten diese vielleicht vom Resultat ausschließen, wenn Sie gar nicht gesetzt wurden.
+
+Wenn Sie zum Beispiel Modelle mit vielen optionalen Attributen in einer NoSQL-Datenbank haben, und Sie möchten nicht ellenlange JSON-Responses voller Defaultwerte senden.
+
+### Den `response_model_exclude_unset`-Parameter verwenden
+
+Sie können den *Pfadoperation-Dekorator*-Parameter `response_model_exclude_unset=True` setzen:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="22"
+ {!> ../../../docs_src/response_model/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="24"
+ {!> ../../../docs_src/response_model/tutorial004_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24"
+ {!> ../../../docs_src/response_model/tutorial004.py!}
+ ```
+
+Die Defaultwerte werden dann nicht in der Response enthalten sein, sondern nur die tatsächlich gesetzten Werte.
+
+Wenn Sie also den Artikel mit der ID `foo` bei der *Pfadoperation* anfragen, wird (ohne die Defaultwerte) die Response sein:
+
+```JSON
+{
+ "name": "Foo",
+ "price": 50.2
+}
+```
+
+!!! info
+ In Pydantic v1 hieß diese Methode `.dict()`, in Pydantic v2 wurde sie deprecated (aber immer noch unterstützt) und in `.model_dump()` umbenannt.
+
+ Die Beispiele hier verwenden `.dict()` für die Kompatibilität mit Pydantic v1, Sie sollten jedoch stattdessen `.model_dump()` verwenden, wenn Sie Pydantic v2 verwenden können.
+
+!!! info
+ FastAPI verwendet `.dict()` von Pydantic Modellen, mit dessen `exclude_unset`-Parameter, um das zu erreichen.
+
+!!! info
+ Sie können auch:
+
+ * `response_model_exclude_defaults=True`
+ * `response_model_exclude_none=True`
+
+ verwenden, wie in der Pydantic Dokumentation für `exclude_defaults` und `exclude_none` beschrieben.
+
+#### Daten mit Werten für Felder mit Defaultwerten
+
+Aber wenn ihre Daten Werte für Modellfelder mit Defaultwerten haben, wie etwa der Artikel mit der ID `bar`:
+
+```Python hl_lines="3 5"
+{
+ "name": "Bar",
+ "description": "The bartenders",
+ "price": 62,
+ "tax": 20.2
+}
+```
+
+dann werden diese Werte in der Response enthalten sein.
+
+#### Daten mit den gleichen Werten wie die Defaultwerte
+
+Wenn Daten die gleichen Werte haben wie ihre Defaultwerte, wie etwa der Artikel mit der ID `baz`:
+
+```Python hl_lines="3 5-6"
+{
+ "name": "Baz",
+ "description": None,
+ "price": 50.2,
+ "tax": 10.5,
+ "tags": []
+}
+```
+
+dann ist FastAPI klug genug (tatsächlich ist Pydantic klug genug) zu erkennen, dass, obwohl `description`, `tax`, und `tags` die gleichen Werte haben wie ihre Defaultwerte, sie explizit gesetzt wurden (statt dass sie von den Defaultwerten genommen wurden).
+
+Diese Felder werden also in der JSON-Response enthalten sein.
+
+!!! tip "Tipp"
+ Beachten Sie, dass Defaultwerte alles Mögliche sein können, nicht nur `None`.
+
+ Sie können eine Liste (`[]`), ein `float` `10.5`, usw. sein.
+
+### `response_model_include` und `response_model_exclude`
+
+Sie können auch die Parameter `response_model_include` und `response_model_exclude` im **Pfadoperation-Dekorator** verwenden.
+
+Diese nehmen ein `set` von `str`s entgegen, welches Namen von Attributen sind, die eingeschlossen (ohne die Anderen) oder ausgeschlossen (nur die Anderen) werden sollen.
+
+Das kann als schnelle Abkürzung verwendet werden, wenn Sie nur ein Pydantic-Modell haben und ein paar Daten von der Ausgabe ausschließen wollen.
+
+!!! tip "Tipp"
+ Es wird dennoch empfohlen, dass Sie die Ideen von oben verwenden, also mehrere Klassen statt dieser Parameter.
+
+ Der Grund ist, dass das das generierte JSON-Schema in der OpenAPI ihrer Anwendung (und deren Dokumentation) dennoch das komplette Modell abbildet, selbst wenn Sie `response_model_include` oder `response_model_exclude` verwenden, um einige Attribute auszuschließen.
+
+ Das trifft auch auf `response_model_by_alias` zu, welches ähnlich funktioniert.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="29 35"
+ {!> ../../../docs_src/response_model/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="31 37"
+ {!> ../../../docs_src/response_model/tutorial005.py!}
+ ```
+
+!!! tip "Tipp"
+ Die Syntax `{"name", "description"}` erzeugt ein `set` mit diesen zwei Werten.
+
+ Äquivalent zu `set(["name", "description"])`.
+
+#### `list`en statt `set`s verwenden
+
+Wenn Sie vergessen, ein `set` zu verwenden, und stattdessen eine `list`e oder ein `tuple` übergeben, wird FastAPI die dennoch in ein `set` konvertieren, und es wird korrekt funktionieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="29 35"
+ {!> ../../../docs_src/response_model/tutorial006_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="31 37"
+ {!> ../../../docs_src/response_model/tutorial006.py!}
+ ```
+
+## Zusammenfassung
+
+Verwenden Sie den Parameter `response_model` im *Pfadoperation-Dekorator*, um Responsemodelle zu definieren, und besonders, um private Daten herauszufiltern.
+
+Verwenden Sie `response_model_exclude_unset`, um nur explizit gesetzte Werte zurückzugeben.
diff --git a/docs/de/docs/tutorial/response-status-code.md b/docs/de/docs/tutorial/response-status-code.md
new file mode 100644
index 000000000..a9cc238f8
--- /dev/null
+++ b/docs/de/docs/tutorial/response-status-code.md
@@ -0,0 +1,89 @@
+# Response-Statuscode
+
+So wie ein Responsemodell, können Sie auch einen HTTP-Statuscode für die Response deklarieren, mithilfe des Parameters `status_code`, und zwar in jeder der *Pfadoperationen*:
+
+* `@app.get()`
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+* usw.
+
+```Python hl_lines="6"
+{!../../../docs_src/response_status_code/tutorial001.py!}
+```
+
+!!! note "Hinweis"
+ Beachten Sie, dass `status_code` ein Parameter der „Dekorator“-Methode ist (`get`, `post`, usw.). Nicht der *Pfadoperation-Funktion*, so wie die anderen Parameter und der Body.
+
+Dem `status_code`-Parameter wird eine Zahl mit dem HTTP-Statuscode übergeben.
+
+!!! info
+ Alternativ kann `status_code` auch ein `IntEnum` erhalten, so wie Pythons `http.HTTPStatus`.
+
+Das wird:
+
+* Diesen Statuscode mit der Response zurücksenden.
+* Ihn als solchen im OpenAPI-Schema dokumentieren (und somit in den Benutzeroberflächen):
+
+
+
+!!! note "Hinweis"
+ Einige Responsecodes (siehe nächster Abschnitt) kennzeichnen, dass die Response keinen Body hat.
+
+ FastAPI versteht das und wird in der OpenAPI-Dokumentation anzeigen, dass es keinen Responsebody gibt.
+
+## Über HTTP-Statuscodes
+
+!!! note "Hinweis"
+ Wenn Sie bereits wissen, was HTTP-Statuscodes sind, überspringen Sie dieses Kapitel und fahren Sie mit dem nächsten fort.
+
+In HTTP senden Sie als Teil der Response einen aus drei Ziffern bestehenden numerischen Statuscode.
+
+Diese Statuscodes haben einen Namen zugeordnet, um sie besser zu erkennen, aber der wichtige Teil ist die Zahl.
+
+Kurz:
+
+* `100` und darüber stehen für „Information“. Diese verwenden Sie selten direkt. Responses mit diesen Statuscodes können keinen Body haben.
+* **`200`** und darüber stehen für Responses, die „Successful“ („Erfolgreich“) waren. Diese verwenden Sie am häufigsten.
+ * `200` ist der Default-Statuscode, welcher bedeutet, alles ist „OK“.
+ * Ein anderes Beispiel ist `201`, „Created“ („Erzeugt“). Wird in der Regel verwendet, wenn ein neuer Datensatz in der Datenbank erzeugt wurde.
+ * Ein spezieller Fall ist `204`, „No Content“ („Kein Inhalt“). Diese Response wird verwendet, wenn es keinen Inhalt gibt, der zum Client zurückgeschickt wird, diese Response hat also keinen Body.
+* **`300`** und darüber steht für „Redirection“ („Umleitung“). Responses mit diesen Statuscodes können einen oder keinen Body haben, mit Ausnahme von `304`, „Not Modified“ („Nicht verändert“), welche keinen haben darf.
+* **`400`** und darüber stehen für „Client error“-Responses („Client-Fehler“). Auch diese verwenden Sie am häufigsten.
+ * Ein Beispiel ist `404`, für eine „Not Found“-Response („Nicht gefunden“).
+ * Für allgemeine Fehler beim Client können Sie einfach `400` verwenden.
+* `500` und darüber stehen für Server-Fehler. Diese verwenden Sie fast nie direkt. Wenn etwas an irgendeiner Stelle in Ihrem Anwendungscode oder im Server schiefläuft, wird automatisch einer dieser Fehler-Statuscodes zurückgegeben.
+
+!!! tip "Tipp"
+ Um mehr über Statuscodes zu lernen, und welcher wofür verwendet wird, lesen Sie die MDN Dokumentation über HTTP-Statuscodes.
+
+## Abkürzung, um die Namen zu erinnern
+
+Schauen wir uns das vorherige Beispiel noch einmal an:
+
+```Python hl_lines="6"
+{!../../../docs_src/response_status_code/tutorial001.py!}
+```
+
+`201` ist der Statuscode für „Created“ („Erzeugt“).
+
+Aber Sie müssen sich nicht daran erinnern, welcher dieser Codes was bedeutet.
+
+Sie können die Hilfsvariablen von `fastapi.status` verwenden.
+
+```Python hl_lines="1 6"
+{!../../../docs_src/response_status_code/tutorial002.py!}
+```
+
+Diese sind nur eine Annehmlichkeit und enthalten dieselbe Nummer, aber auf diese Weise können Sie die Autovervollständigung Ihres Editors verwenden, um sie zu finden:
+
+
+
+!!! note "Technische Details"
+ Sie können auch `from starlette import status` verwenden.
+
+ **FastAPI** bietet dieselben `starlette.status`-Codes auch via `fastapi.status` an, als Annehmlichkeit für Sie, den Entwickler. Sie kommen aber direkt von Starlette.
+
+## Den Defaultwert ändern
+
+Später sehen Sie, im [Handbuch für fortgeschrittene Benutzer](../advanced/response-change-status-code.md){.internal-link target=_blank}, wie Sie einen anderen Statuscode zurückgeben können, als den Default, den Sie hier deklarieren.
diff --git a/docs/de/docs/tutorial/schema-extra-example.md b/docs/de/docs/tutorial/schema-extra-example.md
new file mode 100644
index 000000000..e8bfc9876
--- /dev/null
+++ b/docs/de/docs/tutorial/schema-extra-example.md
@@ -0,0 +1,326 @@
+# Beispiel-Request-Daten deklarieren
+
+Sie können Beispiele für die Daten deklarieren, die Ihre Anwendung empfangen kann.
+
+Hier sind mehrere Möglichkeiten, das zu tun.
+
+## Zusätzliche JSON-Schemadaten in Pydantic-Modellen
+
+Sie können `examples` („Beispiele“) für ein Pydantic-Modell deklarieren, welche dem generierten JSON-Schema hinzugefügt werden.
+
+=== "Python 3.10+ Pydantic v2"
+
+ ```Python hl_lines="13-24"
+ {!> ../../../docs_src/schema_extra_example/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.10+ Pydantic v1"
+
+ ```Python hl_lines="13-23"
+ {!> ../../../docs_src/schema_extra_example/tutorial001_py310_pv1.py!}
+ ```
+
+=== "Python 3.8+ Pydantic v2"
+
+ ```Python hl_lines="15-26"
+ {!> ../../../docs_src/schema_extra_example/tutorial001.py!}
+ ```
+
+=== "Python 3.8+ Pydantic v1"
+
+ ```Python hl_lines="15-25"
+ {!> ../../../docs_src/schema_extra_example/tutorial001_pv1.py!}
+ ```
+
+Diese zusätzlichen Informationen werden unverändert zum für dieses Modell ausgegebenen **JSON-Schema** hinzugefügt und in der API-Dokumentation verwendet.
+
+=== "Pydantic v2"
+
+ In Pydantic Version 2 würden Sie das Attribut `model_config` verwenden, das ein `dict` akzeptiert, wie beschrieben in Pydantic-Dokumentation: Configuration.
+
+ Sie können `json_schema_extra` setzen, mit einem `dict`, das alle zusätzlichen Daten enthält, die im generierten JSON-Schema angezeigt werden sollen, einschließlich `examples`.
+
+=== "Pydantic v1"
+
+ In Pydantic Version 1 würden Sie eine interne Klasse `Config` und `schema_extra` verwenden, wie beschrieben in Pydantic-Dokumentation: Schema customization.
+
+ Sie können `schema_extra` setzen, mit einem `dict`, das alle zusätzlichen Daten enthält, die im generierten JSON-Schema angezeigt werden sollen, einschließlich `examples`.
+
+!!! tip "Tipp"
+ Mit derselben Technik können Sie das JSON-Schema erweitern und Ihre eigenen benutzerdefinierten Zusatzinformationen hinzufügen.
+
+ Sie könnten das beispielsweise verwenden, um Metadaten für eine Frontend-Benutzeroberfläche usw. hinzuzufügen.
+
+!!! info
+ OpenAPI 3.1.0 (verwendet seit FastAPI 0.99.0) hat Unterstützung für `examples` hinzugefügt, was Teil des **JSON Schema** Standards ist.
+
+ Zuvor unterstützte es nur das Schlüsselwort `example` mit einem einzigen Beispiel. Dieses wird weiterhin von OpenAPI 3.1.0 unterstützt, ist jedoch deprecated und nicht Teil des JSON Schema Standards. Wir empfehlen Ihnen daher, von `example` nach `examples` zu migrieren. 🤓
+
+ Mehr erfahren Sie am Ende dieser Seite.
+
+## Zusätzliche Argumente für `Field`
+
+Wenn Sie `Field()` mit Pydantic-Modellen verwenden, können Sie ebenfalls zusätzliche `examples` deklarieren:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="2 8-11"
+ {!> ../../../docs_src/schema_extra_example/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4 10-13"
+ {!> ../../../docs_src/schema_extra_example/tutorial002.py!}
+ ```
+
+## `examples` im JSON-Schema – OpenAPI
+
+Bei Verwendung von:
+
+* `Path()`
+* `Query()`
+* `Header()`
+* `Cookie()`
+* `Body()`
+* `Form()`
+* `File()`
+
+können Sie auch eine Gruppe von `examples` mit zusätzlichen Informationen deklarieren, die zu ihren **JSON-Schemas** innerhalb von **OpenAPI** hinzugefügt werden.
+
+### `Body` mit `examples`
+
+Hier übergeben wir `examples`, welches ein einzelnes Beispiel für die in `Body()` erwarteten Daten enthält:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="22-29"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="22-29"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="23-30"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="18-25"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="20-27"
+ {!> ../../../docs_src/schema_extra_example/tutorial003.py!}
+ ```
+
+### Beispiel in der Dokumentations-Benutzeroberfläche
+
+Mit jeder der oben genannten Methoden würde es in `/docs` so aussehen:
+
+
+
+### `Body` mit mehreren `examples`
+
+Sie können natürlich auch mehrere `examples` übergeben:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="23-38"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="23-38"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24-39"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19-34"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="21-36"
+ {!> ../../../docs_src/schema_extra_example/tutorial004.py!}
+ ```
+
+Wenn Sie das tun, werden die Beispiele Teil des internen **JSON-Schemas** für diese Body-Daten.
+
+Während dies geschrieben wird, unterstützt Swagger UI, das für die Anzeige der Dokumentations-Benutzeroberfläche zuständige Tool, jedoch nicht die Anzeige mehrerer Beispiele für die Daten in **JSON Schema**. Aber lesen Sie unten für einen Workaround weiter.
+
+### OpenAPI-spezifische `examples`
+
+Schon bevor **JSON Schema** `examples` unterstützte, unterstützte OpenAPI ein anderes Feld, das auch `examples` genannt wurde.
+
+Diese **OpenAPI-spezifischen** `examples` finden sich in einem anderen Abschnitt der OpenAPI-Spezifikation. Sie sind **Details für jede *Pfadoperation***, nicht für jedes JSON-Schema.
+
+Und Swagger UI unterstützt dieses spezielle Feld `examples` schon seit einiger Zeit. Sie können es also verwenden, um verschiedene **Beispiele in der Benutzeroberfläche der Dokumentation anzuzeigen**.
+
+Das Format dieses OpenAPI-spezifischen Felds `examples` ist ein `dict` mit **mehreren Beispielen** (anstelle einer `list`e), jedes mit zusätzlichen Informationen, die auch zu **OpenAPI** hinzugefügt werden.
+
+Dies erfolgt nicht innerhalb jedes in OpenAPI enthaltenen JSON-Schemas, sondern außerhalb, in der *Pfadoperation*.
+
+### Verwendung des Parameters `openapi_examples`
+
+Sie können die OpenAPI-spezifischen `examples` in FastAPI mit dem Parameter `openapi_examples` deklarieren, für:
+
+* `Path()`
+* `Query()`
+* `Header()`
+* `Cookie()`
+* `Body()`
+* `Form()`
+* `File()`
+
+Die Schlüssel des `dict` identifizieren jedes Beispiel, und jeder Wert (`"value"`) ist ein weiteres `dict`.
+
+Jedes spezifische Beispiel-`dict` in den `examples` kann Folgendes enthalten:
+
+* `summary`: Kurze Beschreibung für das Beispiel.
+* `description`: Eine lange Beschreibung, die Markdown-Text enthalten kann.
+* `value`: Dies ist das tatsächlich angezeigte Beispiel, z. B. ein `dict`.
+* `externalValue`: Alternative zu `value`, eine URL, die auf das Beispiel verweist. Allerdings wird dies möglicherweise nicht von so vielen Tools unterstützt wie `value`.
+
+Sie können es so verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="23-49"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="23-49"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24-50"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19-45"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="21-47"
+ {!> ../../../docs_src/schema_extra_example/tutorial005.py!}
+ ```
+
+### OpenAPI-Beispiele in der Dokumentations-Benutzeroberfläche
+
+Wenn `openapi_examples` zu `Body()` hinzugefügt wird, würde `/docs` so aussehen:
+
+
+
+## Technische Details
+
+!!! tip "Tipp"
+ Wenn Sie bereits **FastAPI** Version **0.99.0 oder höher** verwenden, können Sie diese Details wahrscheinlich **überspringen**.
+
+ Sie sind für ältere Versionen relevanter, bevor OpenAPI 3.1.0 verfügbar war.
+
+ Sie können dies als eine kurze **Geschichtsstunde** zu OpenAPI und JSON Schema betrachten. 🤓
+
+!!! warning "Achtung"
+ Dies sind sehr technische Details zu den Standards **JSON Schema** und **OpenAPI**.
+
+ Wenn die oben genannten Ideen bereits für Sie funktionieren, reicht das möglicherweise aus und Sie benötigen diese Details wahrscheinlich nicht, überspringen Sie sie gerne.
+
+Vor OpenAPI 3.1.0 verwendete OpenAPI eine ältere und modifizierte Version von **JSON Schema**.
+
+JSON Schema hatte keine `examples`, daher fügte OpenAPI seiner eigenen modifizierten Version ein eigenes `example`-Feld hinzu.
+
+OpenAPI fügte auch die Felder `example` und `examples` zu anderen Teilen der Spezifikation hinzu:
+
+* `Parameter Object` (in der Spezifikation), das verwendet wurde von FastAPIs:
+ * `Path()`
+ * `Query()`
+ * `Header()`
+ * `Cookie()`
+* `Request Body Object` im Feld `content` des `Media Type Object`s (in der Spezifikation), das verwendet wurde von FastAPIs:
+ * `Body()`
+ * `File()`
+ * `Form()`
+
+!!! info
+ Dieser alte, OpenAPI-spezifische `examples`-Parameter heißt seit FastAPI `0.103.0` jetzt `openapi_examples`.
+
+### JSON Schemas Feld `examples`
+
+Aber dann fügte JSON Schema ein `examples`-Feld zu einer neuen Version der Spezifikation hinzu.
+
+Und dann basierte das neue OpenAPI 3.1.0 auf der neuesten Version (JSON Schema 2020-12), die dieses neue Feld `examples` enthielt.
+
+Und jetzt hat dieses neue `examples`-Feld Vorrang vor dem alten (und benutzerdefinierten) `example`-Feld, im Singular, das jetzt deprecated ist.
+
+Dieses neue `examples`-Feld in JSON Schema ist **nur eine `list`e** von Beispielen, kein Dict mit zusätzlichen Metadaten wie an den anderen Stellen in OpenAPI (oben beschrieben).
+
+!!! info
+ Selbst, nachdem OpenAPI 3.1.0 veröffentlicht wurde, mit dieser neuen, einfacheren Integration mit JSON Schema, unterstützte Swagger UI, das Tool, das die automatische Dokumentation bereitstellt, eine Zeit lang OpenAPI 3.1.0 nicht (das tut es seit Version 5.0.0 🎉).
+
+ Aus diesem Grund verwendeten Versionen von FastAPI vor 0.99.0 immer noch Versionen von OpenAPI vor 3.1.0.
+
+### Pydantic- und FastAPI-`examples`
+
+Wenn Sie `examples` innerhalb eines Pydantic-Modells hinzufügen, indem Sie `schema_extra` oder `Field(examples=["something"])` verwenden, wird dieses Beispiel dem **JSON-Schema** für dieses Pydantic-Modell hinzugefügt.
+
+Und dieses **JSON-Schema** des Pydantic-Modells ist in der **OpenAPI** Ihrer API enthalten und wird dann in der Benutzeroberfläche der Dokumentation verwendet.
+
+In Versionen von FastAPI vor 0.99.0 (0.99.0 und höher verwenden das neuere OpenAPI 3.1.0), wenn Sie `example` oder `examples` mit einem der anderen Werkzeuge (`Query()`, `Body()`, usw.) verwendet haben, wurden diese Beispiele nicht zum JSON-Schema hinzugefügt, das diese Daten beschreibt (nicht einmal zur OpenAPI-eigenen Version von JSON Schema), sondern direkt zur *Pfadoperation*-Deklaration in OpenAPI (außerhalb der Teile von OpenAPI, die JSON Schema verwenden).
+
+Aber jetzt, da FastAPI 0.99.0 und höher, OpenAPI 3.1.0 verwendet, das JSON Schema 2020-12 verwendet, und Swagger UI 5.0.0 und höher, ist alles konsistenter und die Beispiele sind in JSON Schema enthalten.
+
+### Swagger-Benutzeroberfläche und OpenAPI-spezifische `examples`.
+
+Da die Swagger-Benutzeroberfläche derzeit nicht mehrere JSON Schema Beispiele unterstützt (Stand: 26.08.2023), hatten Benutzer keine Möglichkeit, mehrere Beispiele in der Dokumentation anzuzeigen.
+
+Um dieses Problem zu lösen, hat FastAPI `0.103.0` **Unterstützung** für die Deklaration desselben alten **OpenAPI-spezifischen** `examples`-Felds mit dem neuen Parameter `openapi_examples` hinzugefügt. 🤓
+
+### Zusammenfassung
+
+Ich habe immer gesagt, dass ich Geschichte nicht so sehr mag ... und jetzt schauen Sie mich an, wie ich „Technikgeschichte“-Unterricht gebe. 😅
+
+Kurz gesagt: **Upgraden Sie auf FastAPI 0.99.0 oder höher**, und die Dinge sind viel **einfacher, konsistenter und intuitiver**, und Sie müssen nicht alle diese historischen Details kennen. 😎
diff --git a/docs/de/docs/tutorial/security/first-steps.md b/docs/de/docs/tutorial/security/first-steps.md
new file mode 100644
index 000000000..1e75fa8d9
--- /dev/null
+++ b/docs/de/docs/tutorial/security/first-steps.md
@@ -0,0 +1,233 @@
+# Sicherheit – Erste Schritte
+
+Stellen wir uns vor, dass Sie Ihre **Backend**-API auf einer Domain haben.
+
+Und Sie haben ein **Frontend** auf einer anderen Domain oder in einem anderen Pfad derselben Domain (oder in einer mobilen Anwendung).
+
+Und Sie möchten eine Möglichkeit haben, dass sich das Frontend mithilfe eines **Benutzernamens** und eines **Passworts** beim Backend authentisieren kann.
+
+Wir können **OAuth2** verwenden, um das mit **FastAPI** zu erstellen.
+
+Aber ersparen wir Ihnen die Zeit, die gesamte lange Spezifikation zu lesen, nur um die kleinen Informationen zu finden, die Sie benötigen.
+
+Lassen Sie uns die von **FastAPI** bereitgestellten Tools verwenden, um Sicherheit zu gewährleisten.
+
+## Wie es aussieht
+
+Lassen Sie uns zunächst einfach den Code verwenden und sehen, wie er funktioniert, und dann kommen wir zurück, um zu verstehen, was passiert.
+
+## `main.py` erstellen
+
+Kopieren Sie das Beispiel in eine Datei `main.py`:
+
+=== "Python 3.9+"
+
+ ```Python
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+## Ausführen
+
+!!! info
+ Um hochgeladene Dateien zu empfangen, installieren Sie zuerst `python-multipart`.
+
+ Z. B. `pip install python-multipart`.
+
+ Das, weil **OAuth2** „Formulardaten“ zum Senden von `username` und `password` verwendet.
+
+Führen Sie das Beispiel aus mit:
+
+
+
+!!! check "Authorize-Button!"
+ Sie haben bereits einen glänzenden, neuen „Authorize“-Button.
+
+ Und Ihre *Pfadoperation* hat in der oberen rechten Ecke ein kleines Schloss, auf das Sie klicken können.
+
+Und wenn Sie darauf klicken, erhalten Sie ein kleines Anmeldeformular zur Eingabe eines `username` und `password` (und anderer optionaler Felder):
+
+
+
+!!! note "Hinweis"
+ Es spielt keine Rolle, was Sie in das Formular eingeben, es wird noch nicht funktionieren. Wir kommen dahin.
+
+Dies ist natürlich nicht das Frontend für die Endbenutzer, aber es ist ein großartiges automatisches Tool, um Ihre gesamte API interaktiv zu dokumentieren.
+
+Es kann vom Frontend-Team verwendet werden (das auch Sie selbst sein können).
+
+Es kann von Anwendungen und Systemen Dritter verwendet werden.
+
+Und es kann auch von Ihnen selbst verwendet werden, um dieselbe Anwendung zu debuggen, zu prüfen und zu testen.
+
+## Der `password`-Flow
+
+Lassen Sie uns nun etwas zurückgehen und verstehen, was das alles ist.
+
+Der `password`-„Flow“ ist eine der in OAuth2 definierten Wege („Flows“) zur Handhabung von Sicherheit und Authentifizierung.
+
+OAuth2 wurde so konzipiert, dass das Backend oder die API unabhängig vom Server sein kann, der den Benutzer authentifiziert.
+
+In diesem Fall handhabt jedoch dieselbe **FastAPI**-Anwendung sowohl die API als auch die Authentifizierung.
+
+Betrachten wir es also aus dieser vereinfachten Sicht:
+
+* Der Benutzer gibt den `username` und das `password` im Frontend ein und drückt `Enter`.
+* Das Frontend (das im Browser des Benutzers läuft) sendet diesen `username` und das `password` an eine bestimmte URL in unserer API (deklariert mit `tokenUrl="token"`).
+* Die API überprüft den `username` und das `password` und antwortet mit einem „Token“ (wir haben davon noch nichts implementiert).
+ * Ein „Token“ ist lediglich ein String mit einem Inhalt, den wir später verwenden können, um diesen Benutzer zu verifizieren.
+ * Normalerweise läuft ein Token nach einiger Zeit ab.
+ * Daher muss sich der Benutzer irgendwann später erneut anmelden.
+ * Und wenn der Token gestohlen wird, ist das Risiko geringer. Es handelt sich nicht um einen dauerhaften Schlüssel, der (in den meisten Fällen) für immer funktioniert.
+* Das Frontend speichert diesen Token vorübergehend irgendwo.
+* Der Benutzer klickt im Frontend, um zu einem anderen Abschnitt der Frontend-Web-Anwendung zu gelangen.
+* Das Frontend muss weitere Daten von der API abrufen.
+ * Es benötigt jedoch eine Authentifizierung für diesen bestimmten Endpunkt.
+ * Um sich also bei unserer API zu authentifizieren, sendet es einen Header `Authorization` mit dem Wert `Bearer` plus dem Token.
+ * Wenn der Token `foobar` enthielte, wäre der Inhalt des `Authorization`-Headers: `Bearer foobar`.
+
+## **FastAPI**s `OAuth2PasswordBearer`
+
+**FastAPI** bietet mehrere Tools auf unterschiedlichen Abstraktionsebenen zur Implementierung dieser Sicherheitsfunktionen.
+
+In diesem Beispiel verwenden wir **OAuth2** mit dem **Password**-Flow und einem **Bearer**-Token. Wir machen das mit der Klasse `OAuth2PasswordBearer`.
+
+!!! info
+ Ein „Bearer“-Token ist nicht die einzige Option.
+
+ Aber es ist die beste für unseren Anwendungsfall.
+
+ Und es ist wahrscheinlich auch für die meisten anderen Anwendungsfälle die beste, es sei denn, Sie sind ein OAuth2-Experte und wissen genau, warum es eine andere Option gibt, die Ihren Anforderungen besser entspricht.
+
+ In dem Fall gibt Ihnen **FastAPI** ebenfalls die Tools, die Sie zum Erstellen brauchen.
+
+Wenn wir eine Instanz der Klasse `OAuth2PasswordBearer` erstellen, übergeben wir den Parameter `tokenUrl`. Dieser Parameter enthält die URL, die der Client (das Frontend, das im Browser des Benutzers ausgeführt wird) verwendet, wenn er den `username` und das `password` sendet, um einen Token zu erhalten.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="6"
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+!!! tip "Tipp"
+ Hier bezieht sich `tokenUrl="token"` auf eine relative URL `token`, die wir noch nicht erstellt haben. Da es sich um eine relative URL handelt, entspricht sie `./token`.
+
+ Da wir eine relative URL verwenden, würde sich das, wenn sich Ihre API unter `https://example.com/` befindet, auf `https://example.com/token` beziehen. Wenn sich Ihre API jedoch unter `https://example.com/api/v1/` befände, würde es sich auf `https://example.com/api/v1/token` beziehen.
+
+ Die Verwendung einer relativen URL ist wichtig, um sicherzustellen, dass Ihre Anwendung auch in einem fortgeschrittenen Anwendungsfall, wie [hinter einem Proxy](../../advanced/behind-a-proxy.md){.internal-link target=_blank}, weiterhin funktioniert.
+
+Dieser Parameter erstellt nicht diesen Endpunkt / diese *Pfadoperation*, sondern deklariert, dass die URL `/token` diejenige sein wird, die der Client verwenden soll, um den Token abzurufen. Diese Information wird in OpenAPI und dann in den interaktiven API-Dokumentationssystemen verwendet.
+
+Wir werden demnächst auch die eigentliche Pfadoperation erstellen.
+
+!!! info
+ Wenn Sie ein sehr strenger „Pythonista“ sind, missfällt Ihnen möglicherweise die Schreibweise des Parameternamens `tokenUrl` anstelle von `token_url`.
+
+ Das liegt daran, dass FastAPI denselben Namen wie in der OpenAPI-Spezifikation verwendet. Sodass Sie, wenn Sie mehr über eines dieser Sicherheitsschemas herausfinden möchten, den Namen einfach kopieren und einfügen können, um weitere Informationen darüber zu erhalten.
+
+Die Variable `oauth2_scheme` ist eine Instanz von `OAuth2PasswordBearer`, aber auch ein „Callable“.
+
+Es könnte wie folgt aufgerufen werden:
+
+```Python
+oauth2_scheme(some, parameters)
+```
+
+Es kann also mit `Depends` verwendet werden.
+
+### Verwendung
+
+Jetzt können Sie dieses `oauth2_scheme` als Abhängigkeit `Depends` übergeben.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+Diese Abhängigkeit stellt einen `str` bereit, der dem Parameter `token` der *Pfadoperation-Funktion* zugewiesen wird.
+
+**FastAPI** weiß, dass es diese Abhängigkeit verwenden kann, um ein „Sicherheitsschema“ im OpenAPI-Schema (und der automatischen API-Dokumentation) zu definieren.
+
+!!! info "Technische Details"
+ **FastAPI** weiß, dass es die Klasse `OAuth2PasswordBearer` (deklariert in einer Abhängigkeit) verwenden kann, um das Sicherheitsschema in OpenAPI zu definieren, da es von `fastapi.security.oauth2.OAuth2` erbt, das wiederum von `fastapi.security.base.SecurityBase` erbt.
+
+ Alle Sicherheits-Werkzeuge, die in OpenAPI integriert sind (und die automatische API-Dokumentation), erben von `SecurityBase`, so weiß **FastAPI**, wie es sie in OpenAPI integrieren muss.
+
+## Was es macht
+
+FastAPI wird im Request nach diesem `Authorization`-Header suchen, prüfen, ob der Wert `Bearer` plus ein Token ist, und den Token als `str` zurückgeben.
+
+Wenn es keinen `Authorization`-Header sieht, oder der Wert keinen `Bearer`-Token hat, antwortet es direkt mit einem 401-Statuscode-Error (`UNAUTHORIZED`).
+
+Sie müssen nicht einmal prüfen, ob der Token existiert, um einen Fehler zurückzugeben. Seien Sie sicher, dass Ihre Funktion, wenn sie ausgeführt wird, ein `str` in diesem Token enthält.
+
+Sie können das bereits in der interaktiven Dokumentation ausprobieren:
+
+
+
+Wir überprüfen im Moment noch nicht die Gültigkeit des Tokens, aber das ist bereits ein Anfang.
+
+## Zusammenfassung
+
+Mit nur drei oder vier zusätzlichen Zeilen haben Sie also bereits eine primitive Form der Sicherheit.
diff --git a/docs/de/docs/tutorial/security/get-current-user.md b/docs/de/docs/tutorial/security/get-current-user.md
new file mode 100644
index 000000000..09b55a20e
--- /dev/null
+++ b/docs/de/docs/tutorial/security/get-current-user.md
@@ -0,0 +1,288 @@
+# Aktuellen Benutzer abrufen
+
+Im vorherigen Kapitel hat das Sicherheitssystem (das auf dem Dependency Injection System basiert) der *Pfadoperation-Funktion* einen `token` vom Typ `str` überreicht:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+Aber das ist immer noch nicht so nützlich.
+
+Lassen wir es uns den aktuellen Benutzer überreichen.
+
+## Ein Benutzermodell erstellen
+
+Erstellen wir zunächst ein Pydantic-Benutzermodell.
+
+So wie wir Pydantic zum Deklarieren von Bodys verwenden, können wir es auch überall sonst verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="5 12-16"
+ {!> ../../../docs_src/security/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="5 12-16"
+ {!> ../../../docs_src/security/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="5 13-17"
+ {!> ../../../docs_src/security/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3 10-14"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="5 12-16"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+## Eine `get_current_user`-Abhängigkeit erstellen
+
+Erstellen wir eine Abhängigkeit `get_current_user`.
+
+Erinnern Sie sich, dass Abhängigkeiten Unterabhängigkeiten haben können?
+
+`get_current_user` wird seinerseits von `oauth2_scheme` abhängen, das wir zuvor erstellt haben.
+
+So wie wir es zuvor in der *Pfadoperation* direkt gemacht haben, erhält unsere neue Abhängigkeit `get_current_user` von der Unterabhängigkeit `oauth2_scheme` einen `token` vom Typ `str`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="25"
+ {!> ../../../docs_src/security/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="25"
+ {!> ../../../docs_src/security/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="26"
+ {!> ../../../docs_src/security/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="23"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="25"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+## Den Benutzer holen
+
+`get_current_user` wird eine von uns erstellte (gefakte) Hilfsfunktion verwenden, welche einen Token vom Typ `str` entgegennimmt und unser Pydantic-`User`-Modell zurückgibt:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19-22 26-27"
+ {!> ../../../docs_src/security/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19-22 26-27"
+ {!> ../../../docs_src/security/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="20-23 27-28"
+ {!> ../../../docs_src/security/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="17-20 24-25"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="19-22 26-27"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+## Den aktuellen Benutzer einfügen
+
+Und jetzt können wir wiederum `Depends` mit unserem `get_current_user` in der *Pfadoperation* verwenden:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="31"
+ {!> ../../../docs_src/security/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="31"
+ {!> ../../../docs_src/security/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="32"
+ {!> ../../../docs_src/security/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="29"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="31"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+Beachten Sie, dass wir als Typ von `current_user` das Pydantic-Modell `User` deklarieren.
+
+Das wird uns innerhalb der Funktion bei Codevervollständigung und Typprüfungen helfen.
+
+!!! tip "Tipp"
+ Sie erinnern sich vielleicht, dass Requestbodys ebenfalls mit Pydantic-Modellen deklariert werden.
+
+ Weil Sie `Depends` verwenden, wird **FastAPI** hier aber nicht verwirrt.
+
+!!! check
+ Die Art und Weise, wie dieses System von Abhängigkeiten konzipiert ist, ermöglicht es uns, verschiedene Abhängigkeiten (verschiedene „Dependables“) zu haben, die alle ein `User`-Modell zurückgeben.
+
+ Wir sind nicht darauf beschränkt, nur eine Abhängigkeit zu haben, die diesen Typ von Daten zurückgeben kann.
+
+## Andere Modelle
+
+Sie können jetzt den aktuellen Benutzer direkt in den *Pfadoperation-Funktionen* abrufen und die Sicherheitsmechanismen auf **Dependency Injection** Ebene handhaben, mittels `Depends`.
+
+Und Sie können alle Modelle und Daten für die Sicherheitsanforderungen verwenden (in diesem Fall ein Pydantic-Modell `User`).
+
+Sie sind jedoch nicht auf die Verwendung von bestimmten Datenmodellen, Klassen, oder Typen beschränkt.
+
+Möchten Sie eine `id` und eine `email` und keinen `username` in Ihrem Modell haben? Kein Problem. Sie können dieselben Tools verwenden.
+
+Möchten Sie nur ein `str` haben? Oder nur ein `dict`? Oder direkt eine Instanz eines Modells einer Datenbank-Klasse? Es funktioniert alles auf die gleiche Weise.
+
+Sie haben eigentlich keine Benutzer, die sich bei Ihrer Anwendung anmelden, sondern Roboter, Bots oder andere Systeme, die nur über einen Zugriffstoken verfügen? Auch hier funktioniert alles gleich.
+
+Verwenden Sie einfach jede Art von Modell, jede Art von Klasse, jede Art von Datenbank, die Sie für Ihre Anwendung benötigen. **FastAPI** deckt das alles mit seinem Dependency Injection System ab.
+
+## Codegröße
+
+Dieses Beispiel mag ausführlich erscheinen. Bedenken Sie, dass wir Sicherheit, Datenmodelle, Hilfsfunktionen und *Pfadoperationen* in derselben Datei vermischen.
+
+Aber hier ist der entscheidende Punkt.
+
+Der Code für Sicherheit und Dependency Injection wird einmal geschrieben.
+
+Sie können es so komplex gestalten, wie Sie möchten. Und dennoch haben Sie es nur einmal geschrieben, an einer einzigen Stelle. Mit all der Flexibilität.
+
+Aber Sie können Tausende von Endpunkten (*Pfadoperationen*) haben, die dasselbe Sicherheitssystem verwenden.
+
+Und alle (oder beliebige Teile davon) können Vorteil ziehen aus der Wiederverwendung dieser und anderer von Ihnen erstellter Abhängigkeiten.
+
+Und alle diese Tausenden von *Pfadoperationen* können nur drei Zeilen lang sein:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="30-32"
+ {!> ../../../docs_src/security/tutorial002_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="30-32"
+ {!> ../../../docs_src/security/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="31-33"
+ {!> ../../../docs_src/security/tutorial002_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="28-30"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="30-32"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+## Zusammenfassung
+
+Sie können jetzt den aktuellen Benutzer direkt in Ihrer *Pfadoperation-Funktion* abrufen.
+
+Wir haben bereits die Hälfte geschafft.
+
+Wir müssen jetzt nur noch eine *Pfadoperation* hinzufügen, mittels der der Benutzer/Client tatsächlich seinen `username` und `password` senden kann.
+
+Das kommt als nächstes.
diff --git a/docs/de/docs/tutorial/security/index.md b/docs/de/docs/tutorial/security/index.md
new file mode 100644
index 000000000..7a11e704d
--- /dev/null
+++ b/docs/de/docs/tutorial/security/index.md
@@ -0,0 +1,101 @@
+# Sicherheit
+
+Es gibt viele Wege, Sicherheit, Authentifizierung und Autorisierung zu handhaben.
+
+Und normalerweise ist es ein komplexes und „schwieriges“ Thema.
+
+In vielen Frameworks und Systemen erfordert allein die Handhabung von Sicherheit und Authentifizierung viel Aufwand und Code (in vielen Fällen kann er 50 % oder mehr des gesamten geschriebenen Codes ausmachen).
+
+**FastAPI** bietet mehrere Tools, die Ihnen helfen, schnell und auf standardisierte Weise mit **Sicherheit** umzugehen, ohne alle Sicherheits-Spezifikationen studieren und erlernen zu müssen.
+
+Aber schauen wir uns zunächst ein paar kleine Konzepte an.
+
+## In Eile?
+
+Wenn Ihnen diese Begriffe egal sind und Sie einfach *jetzt* Sicherheit mit Authentifizierung basierend auf Benutzername und Passwort hinzufügen müssen, fahren Sie mit den nächsten Kapiteln fort.
+
+## OAuth2
+
+OAuth2 ist eine Spezifikation, die verschiedene Möglichkeiten zur Handhabung von Authentifizierung und Autorisierung definiert.
+
+Es handelt sich um eine recht umfangreiche Spezifikation, und sie deckt mehrere komplexe Anwendungsfälle ab.
+
+Sie umfasst Möglichkeiten zur Authentifizierung mithilfe eines „Dritten“ („third party“).
+
+Das ist es, was alle diese „Login mit Facebook, Google, Twitter, GitHub“-Systeme unter der Haube verwenden.
+
+### OAuth 1
+
+Es gab ein OAuth 1, das sich stark von OAuth2 unterscheidet und komplexer ist, da es direkte Spezifikationen enthält, wie die Kommunikation verschlüsselt wird.
+
+Heutzutage ist es nicht sehr populär und wird kaum verwendet.
+
+OAuth2 spezifiziert nicht, wie die Kommunikation verschlüsselt werden soll, sondern erwartet, dass Ihre Anwendung mit HTTPS bereitgestellt wird.
+
+!!! tip "Tipp"
+ Im Abschnitt über **Deployment** erfahren Sie, wie Sie HTTPS mithilfe von Traefik und Let's Encrypt kostenlos einrichten.
+
+
+## OpenID Connect
+
+OpenID Connect ist eine weitere Spezifikation, die auf **OAuth2** basiert.
+
+Sie erweitert lediglich OAuth2, indem sie einige Dinge spezifiziert, die in OAuth2 relativ mehrdeutig sind, um zu versuchen, es interoperabler zu machen.
+
+Beispielsweise verwendet der Google Login OpenID Connect (welches seinerseits OAuth2 verwendet).
+
+Aber der Facebook Login unterstützt OpenID Connect nicht. Es hat seine eigene Variante von OAuth2.
+
+### OpenID (nicht „OpenID Connect“)
+
+Es gab auch eine „OpenID“-Spezifikation. Sie versuchte das Gleiche zu lösen wie **OpenID Connect**, basierte aber nicht auf OAuth2.
+
+Es handelte sich also um ein komplett zusätzliches System.
+
+Heutzutage ist es nicht sehr populär und wird kaum verwendet.
+
+## OpenAPI
+
+OpenAPI (früher bekannt als Swagger) ist die offene Spezifikation zum Erstellen von APIs (jetzt Teil der Linux Foundation).
+
+**FastAPI** basiert auf **OpenAPI**.
+
+Das ist es, was erlaubt, mehrere automatische interaktive Dokumentations-Oberflächen, Codegenerierung, usw. zu haben.
+
+OpenAPI bietet die Möglichkeit, mehrere Sicherheits„systeme“ zu definieren.
+
+Durch deren Verwendung können Sie alle diese Standards-basierten Tools nutzen, einschließlich dieser interaktiven Dokumentationssysteme.
+
+OpenAPI definiert die folgenden Sicherheitsschemas:
+
+* `apiKey`: ein anwendungsspezifischer Schlüssel, der stammen kann von:
+ * Einem Query-Parameter.
+ * Einem Header.
+ * Einem Cookie.
+* `http`: Standard-HTTP-Authentifizierungssysteme, einschließlich:
+ * `bearer`: ein Header `Authorization` mit dem Wert `Bearer` plus einem Token. Dies wird von OAuth2 geerbt.
+ * HTTP Basic Authentication.
+ * HTTP Digest, usw.
+* `oauth2`: Alle OAuth2-Methoden zum Umgang mit Sicherheit (genannt „Flows“).
+ * Mehrere dieser Flows eignen sich zum Aufbau eines OAuth 2.0-Authentifizierungsanbieters (wie Google, Facebook, Twitter, GitHub usw.):
+ * `implicit`
+ * `clientCredentials`
+ * `authorizationCode`
+ * Es gibt jedoch einen bestimmten „Flow“, der perfekt für die direkte Abwicklung der Authentifizierung in derselben Anwendung verwendet werden kann:
+ * `password`: Einige der nächsten Kapitel werden Beispiele dafür behandeln.
+* `openIdConnect`: bietet eine Möglichkeit, zu definieren, wie OAuth2-Authentifizierungsdaten automatisch ermittelt werden können.
+ * Diese automatische Erkennung ist es, die in der OpenID Connect Spezifikation definiert ist.
+
+
+!!! tip "Tipp"
+ Auch die Integration anderer Authentifizierungs-/Autorisierungsanbieter wie Google, Facebook, Twitter, GitHub, usw. ist möglich und relativ einfach.
+
+ Das komplexeste Problem besteht darin, einen Authentifizierungs-/Autorisierungsanbieter wie solche aufzubauen, aber **FastAPI** reicht Ihnen die Tools, das einfach zu erledigen, während Ihnen die schwere Arbeit abgenommen wird.
+
+## **FastAPI** Tools
+
+FastAPI stellt für jedes dieser Sicherheitsschemas im Modul `fastapi.security` verschiedene Tools bereit, die die Verwendung dieser Sicherheitsmechanismen vereinfachen.
+
+In den nächsten Kapiteln erfahren Sie, wie Sie mit diesen von **FastAPI** bereitgestellten Tools Sicherheit zu Ihrer API hinzufügen.
+
+Und Sie werden auch sehen, wie dies automatisch in das interaktive Dokumentationssystem integriert wird.
diff --git a/docs/de/docs/tutorial/security/oauth2-jwt.md b/docs/de/docs/tutorial/security/oauth2-jwt.md
new file mode 100644
index 000000000..9f43cccc9
--- /dev/null
+++ b/docs/de/docs/tutorial/security/oauth2-jwt.md
@@ -0,0 +1,393 @@
+# OAuth2 mit Password (und Hashing), Bearer mit JWT-Tokens
+
+Da wir nun über den gesamten Sicherheitsablauf verfügen, machen wir die Anwendung tatsächlich sicher, indem wir JWT-Tokens und sicheres Passwort-Hashing verwenden.
+
+Diesen Code können Sie tatsächlich in Ihrer Anwendung verwenden, die Passwort-Hashes in Ihrer Datenbank speichern, usw.
+
+Wir bauen auf dem vorherigen Kapitel auf.
+
+## Über JWT
+
+JWT bedeutet „JSON Web Tokens“.
+
+Es ist ein Standard, um ein JSON-Objekt in einem langen, kompakten String ohne Leerzeichen zu kodieren. Das sieht so aus:
+
+```
+eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
+```
+
+Da er nicht verschlüsselt ist, kann jeder die Informationen aus dem Inhalt wiederherstellen.
+
+Aber er ist signiert. Wenn Sie also einen von Ihnen gesendeten Token zurückerhalten, können Sie überprüfen, ob Sie ihn tatsächlich gesendet haben.
+
+Auf diese Weise können Sie einen Token mit einer Gültigkeitsdauer von beispielsweise einer Woche erstellen. Und wenn der Benutzer am nächsten Tag mit dem Token zurückkommt, wissen Sie, dass der Benutzer immer noch bei Ihrem System angemeldet ist.
+
+Nach einer Woche läuft der Token ab und der Benutzer wird nicht autorisiert und muss sich erneut anmelden, um einen neuen Token zu erhalten. Und wenn der Benutzer (oder ein Dritter) versuchen würde, den Token zu ändern, um das Ablaufdatum zu ändern, würden Sie das entdecken, weil die Signaturen nicht übereinstimmen würden.
+
+Wenn Sie mit JWT-Tokens spielen und sehen möchten, wie sie funktionieren, schauen Sie sich https://jwt.io an.
+
+## `python-jose` installieren.
+
+Wir müssen `python-jose` installieren, um die JWT-Tokens in Python zu generieren und zu verifizieren:
+
+
+
+Melden Sie sich bei der Anwendung auf die gleiche Weise wie zuvor an.
+
+Verwenden Sie die Anmeldeinformationen:
+
+Benutzername: `johndoe`
+Passwort: `secret`.
+
+!!! check
+ Beachten Sie, dass im Code nirgendwo das Klartext-Passwort "`secret`" steht, wir haben nur die gehashte Version.
+
+
+
+Rufen Sie den Endpunkt `/users/me/` auf, Sie erhalten die Response:
+
+```JSON
+{
+ "username": "johndoe",
+ "email": "johndoe@example.com",
+ "full_name": "John Doe",
+ "disabled": false
+}
+```
+
+
+
+Wenn Sie die Developer Tools öffnen, können Sie sehen, dass die gesendeten Daten nur den Token enthalten. Das Passwort wird nur bei der ersten Anfrage gesendet, um den Benutzer zu authentisieren und diesen Zugriffstoken zu erhalten, aber nicht mehr danach:
+
+
+
+!!! note "Hinweis"
+ Beachten Sie den Header `Authorization` mit einem Wert, der mit `Bearer` beginnt.
+
+## Fortgeschrittene Verwendung mit `scopes`
+
+OAuth2 hat ein Konzept von „Scopes“.
+
+Sie können diese verwenden, um einem JWT-Token einen bestimmten Satz von Berechtigungen zu übergeben.
+
+Anschließend können Sie diesen Token einem Benutzer direkt oder einem Dritten geben, damit diese mit einer Reihe von Einschränkungen mit Ihrer API interagieren können.
+
+Wie Sie sie verwenden und wie sie in **FastAPI** integriert sind, erfahren Sie später im **Handbuch für fortgeschrittene Benutzer**.
+
+## Zusammenfassung
+
+Mit dem, was Sie bis hier gesehen haben, können Sie eine sichere **FastAPI**-Anwendung mithilfe von Standards wie OAuth2 und JWT einrichten.
+
+In fast jedem Framework wird die Handhabung der Sicherheit recht schnell zu einem ziemlich komplexen Thema.
+
+Viele Packages, die es stark vereinfachen, müssen viele Kompromisse beim Datenmodell, der Datenbank und den verfügbaren Funktionen eingehen. Und einige dieser Pakete, die die Dinge zu sehr vereinfachen, weisen tatsächlich Sicherheitslücken auf.
+
+---
+
+**FastAPI** geht bei keiner Datenbank, keinem Datenmodell oder Tool Kompromisse ein.
+
+Es gibt Ihnen die volle Flexibilität, diejenigen auszuwählen, die am besten zu Ihrem Projekt passen.
+
+Und Sie können viele gut gepflegte und weit verbreitete Packages wie `passlib` und `python-jose` direkt verwenden, da **FastAPI** keine komplexen Mechanismen zur Integration externer Pakete erfordert.
+
+Aber es bietet Ihnen die Werkzeuge, um den Prozess so weit wie möglich zu vereinfachen, ohne Kompromisse bei Flexibilität, Robustheit oder Sicherheit einzugehen.
+
+Und Sie können sichere Standardprotokolle wie OAuth2 auf relativ einfache Weise verwenden und implementieren.
+
+Im **Handbuch für fortgeschrittene Benutzer** erfahren Sie mehr darüber, wie Sie OAuth2-„Scopes“ für ein feingranuliertes Berechtigungssystem verwenden, das denselben Standards folgt. OAuth2 mit Scopes ist der Mechanismus, der von vielen großen Authentifizierungsanbietern wie Facebook, Google, GitHub, Microsoft, Twitter, usw. verwendet wird, um Drittanbieteranwendungen zu autorisieren, im Namen ihrer Benutzer mit ihren APIs zu interagieren.
diff --git a/docs/de/docs/tutorial/security/simple-oauth2.md b/docs/de/docs/tutorial/security/simple-oauth2.md
new file mode 100644
index 000000000..ed280d486
--- /dev/null
+++ b/docs/de/docs/tutorial/security/simple-oauth2.md
@@ -0,0 +1,435 @@
+# Einfaches OAuth2 mit Password und Bearer
+
+Lassen Sie uns nun auf dem vorherigen Kapitel aufbauen und die fehlenden Teile hinzufügen, um einen vollständigen Sicherheits-Flow zu erhalten.
+
+## `username` und `password` entgegennehmen
+
+Wir werden **FastAPIs** Sicherheits-Werkzeuge verwenden, um den `username` und das `password` entgegenzunehmen.
+
+OAuth2 spezifiziert, dass der Client/Benutzer bei Verwendung des „Password Flow“ (den wir verwenden) die Felder `username` und `password` als Formulardaten senden muss.
+
+Und die Spezifikation sagt, dass die Felder so benannt werden müssen. `user-name` oder `email` würde also nicht funktionieren.
+
+Aber keine Sorge, Sie können sie Ihren Endbenutzern im Frontend so anzeigen, wie Sie möchten.
+
+Und Ihre Datenbankmodelle können beliebige andere Namen verwenden.
+
+Aber für die Login-*Pfadoperation* müssen wir diese Namen verwenden, um mit der Spezifikation kompatibel zu sein (und beispielsweise das integrierte API-Dokumentationssystem verwenden zu können).
+
+Die Spezifikation besagt auch, dass `username` und `password` als Formulardaten gesendet werden müssen (hier also kein JSON).
+
+### `scope`
+
+Ferner sagt die Spezifikation, dass der Client ein weiteres Formularfeld "`scope`" („Geltungsbereich“) senden kann.
+
+Der Name des Formularfelds lautet `scope` (im Singular), tatsächlich handelt es sich jedoch um einen langen String mit durch Leerzeichen getrennten „Scopes“.
+
+Jeder „Scope“ ist nur ein String (ohne Leerzeichen).
+
+Diese werden normalerweise verwendet, um bestimmte Sicherheitsberechtigungen zu deklarieren, zum Beispiel:
+
+* `users:read` oder `users:write` sind gängige Beispiele.
+* `instagram_basic` wird von Facebook / Instagram verwendet.
+* `https://www.googleapis.com/auth/drive` wird von Google verwendet.
+
+!!! info
+ In OAuth2 ist ein „Scope“ nur ein String, der eine bestimmte erforderliche Berechtigung deklariert.
+
+ Es spielt keine Rolle, ob er andere Zeichen wie `:` enthält oder ob es eine URL ist.
+
+ Diese Details sind implementierungsspezifisch.
+
+ Für OAuth2 sind es einfach nur Strings.
+
+## Code, um `username` und `password` entgegenzunehmen.
+
+Lassen Sie uns nun die von **FastAPI** bereitgestellten Werkzeuge verwenden, um das zu erledigen.
+
+### `OAuth2PasswordRequestForm`
+
+Importieren Sie zunächst `OAuth2PasswordRequestForm` und verwenden Sie es als Abhängigkeit mit `Depends` in der *Pfadoperation* für `/token`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4 78"
+ {!> ../../../docs_src/security/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4 78"
+ {!> ../../../docs_src/security/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4 79"
+ {!> ../../../docs_src/security/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="2 74"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="4 76"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+`OAuth2PasswordRequestForm` ist eine Klassenabhängigkeit, die einen Formularbody deklariert mit:
+
+* Dem `username`.
+* Dem `password`.
+* Einem optionalen `scope`-Feld als langem String, bestehend aus durch Leerzeichen getrennten Strings.
+* Einem optionalen `grant_type` („Art der Anmeldung“).
+
+!!! tip "Tipp"
+ Die OAuth2-Spezifikation *erfordert* tatsächlich ein Feld `grant_type` mit dem festen Wert `password`, aber `OAuth2PasswordRequestForm` erzwingt dies nicht.
+
+ Wenn Sie es erzwingen müssen, verwenden Sie `OAuth2PasswordRequestFormStrict` anstelle von `OAuth2PasswordRequestForm`.
+
+* Eine optionale `client_id` (benötigen wir für unser Beispiel nicht).
+* Ein optionales `client_secret` (benötigen wir für unser Beispiel nicht).
+
+!!! info
+ `OAuth2PasswordRequestForm` ist keine spezielle Klasse für **FastAPI**, so wie `OAuth2PasswordBearer`.
+
+ `OAuth2PasswordBearer` lässt **FastAPI** wissen, dass es sich um ein Sicherheitsschema handelt. Daher wird es auf diese Weise zu OpenAPI hinzugefügt.
+
+ Aber `OAuth2PasswordRequestForm` ist nur eine Klassenabhängigkeit, die Sie selbst hätten schreiben können, oder Sie hätten `Form`ular-Parameter direkt deklarieren können.
+
+ Da es sich jedoch um einen häufigen Anwendungsfall handelt, wird er zur Vereinfachung direkt von **FastAPI** bereitgestellt.
+
+### Die Formulardaten verwenden
+
+!!! tip "Tipp"
+ Die Instanz der Klassenabhängigkeit `OAuth2PasswordRequestForm` verfügt, statt eines Attributs `scope` mit dem durch Leerzeichen getrennten langen String, über das Attribut `scopes` mit einer tatsächlichen Liste von Strings, einem für jeden gesendeten Scope.
+
+ In diesem Beispiel verwenden wir keine `scopes`, aber die Funktionalität ist vorhanden, wenn Sie sie benötigen.
+
+Rufen Sie nun die Benutzerdaten aus der (gefakten) Datenbank ab, für diesen `username` aus dem Formularfeld.
+
+Wenn es keinen solchen Benutzer gibt, geben wir die Fehlermeldung „Incorrect username or password“ zurück.
+
+Für den Fehler verwenden wir die Exception `HTTPException`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3 79-81"
+ {!> ../../../docs_src/security/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3 79-81"
+ {!> ../../../docs_src/security/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3 80-82"
+ {!> ../../../docs_src/security/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="1 75-77"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="3 77-79"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+### Das Passwort überprüfen
+
+Zu diesem Zeitpunkt liegen uns die Benutzerdaten aus unserer Datenbank vor, das Passwort haben wir jedoch noch nicht überprüft.
+
+Lassen Sie uns diese Daten zunächst in das Pydantic-Modell `UserInDB` einfügen.
+
+Sie sollten niemals Klartext-Passwörter speichern, daher verwenden wir ein (gefaktes) Passwort-Hashing-System.
+
+Wenn die Passwörter nicht übereinstimmen, geben wir denselben Fehler zurück.
+
+#### Passwort-Hashing
+
+„Hashing“ bedeutet: Konvertieren eines Inhalts (in diesem Fall eines Passworts) in eine Folge von Bytes (ein schlichter String), die wie Kauderwelsch aussieht.
+
+Immer wenn Sie genau den gleichen Inhalt (genau das gleiche Passwort) übergeben, erhalten Sie genau den gleichen Kauderwelsch.
+
+Sie können jedoch nicht vom Kauderwelsch zurück zum Passwort konvertieren.
+
+##### Warum Passwort-Hashing verwenden?
+
+Wenn Ihre Datenbank gestohlen wird, hat der Dieb nicht die Klartext-Passwörter Ihrer Benutzer, sondern nur die Hashes.
+
+Der Dieb kann also nicht versuchen, die gleichen Passwörter in einem anderen System zu verwenden (da viele Benutzer überall das gleiche Passwort verwenden, wäre dies gefährlich).
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="82-85"
+ {!> ../../../docs_src/security/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="82-85"
+ {!> ../../../docs_src/security/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="83-86"
+ {!> ../../../docs_src/security/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="78-81"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="80-83"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+#### Über `**user_dict`
+
+`UserInDB(**user_dict)` bedeutet:
+
+*Übergib die Schlüssel und Werte des `user_dict` direkt als Schlüssel-Wert-Argumente, äquivalent zu:*
+
+```Python
+UserInDB(
+ username = user_dict["username"],
+ email = user_dict["email"],
+ full_name = user_dict["full_name"],
+ disabled = user_dict["disabled"],
+ hashed_password = user_dict["hashed_password"],
+)
+```
+
+!!! info
+ Eine ausführlichere Erklärung von `**user_dict` finden Sie in [der Dokumentation für **Extra Modelle**](../extra-models.md#uber-user_indict){.internal-link target=_blank}.
+
+## Den Token zurückgeben
+
+Die Response des `token`-Endpunkts muss ein JSON-Objekt sein.
+
+Es sollte einen `token_type` haben. Da wir in unserem Fall „Bearer“-Token verwenden, sollte der Token-Typ "`bearer`" sein.
+
+Und es sollte einen `access_token` haben, mit einem String, der unseren Zugriffstoken enthält.
+
+In diesem einfachen Beispiel gehen wir einfach völlig unsicher vor und geben denselben `username` wie der Token zurück.
+
+!!! tip "Tipp"
+ Im nächsten Kapitel sehen Sie eine wirklich sichere Implementierung mit Passwort-Hashing und JWT-Tokens.
+
+ Aber konzentrieren wir uns zunächst auf die spezifischen Details, die wir benötigen.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="87"
+ {!> ../../../docs_src/security/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="87"
+ {!> ../../../docs_src/security/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="88"
+ {!> ../../../docs_src/security/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="83"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="85"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+!!! tip "Tipp"
+ Gemäß der Spezifikation sollten Sie ein JSON mit einem `access_token` und einem `token_type` zurückgeben, genau wie in diesem Beispiel.
+
+ Das müssen Sie selbst in Ihrem Code tun und sicherstellen, dass Sie diese JSON-Schlüssel verwenden.
+
+ Es ist fast das Einzige, woran Sie denken müssen, es selbst richtigzumachen und die Spezifikationen einzuhalten.
+
+ Den Rest erledigt **FastAPI** für Sie.
+
+## Die Abhängigkeiten aktualisieren
+
+Jetzt werden wir unsere Abhängigkeiten aktualisieren.
+
+Wir möchten den `current_user` *nur* erhalten, wenn dieser Benutzer aktiv ist.
+
+Daher erstellen wir eine zusätzliche Abhängigkeit `get_current_active_user`, die wiederum `get_current_user` als Abhängigkeit verwendet.
+
+Beide Abhängigkeiten geben nur dann einen HTTP-Error zurück, wenn der Benutzer nicht existiert oder inaktiv ist.
+
+In unserem Endpunkt erhalten wir also nur dann einen Benutzer, wenn der Benutzer existiert, korrekt authentifiziert wurde und aktiv ist:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="58-66 69-74 94"
+ {!> ../../../docs_src/security/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="58-66 69-74 94"
+ {!> ../../../docs_src/security/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="59-67 70-75 95"
+ {!> ../../../docs_src/security/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="56-64 67-70 88"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python hl_lines="58-66 69-72 90"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+!!! info
+ Der zusätzliche Header `WWW-Authenticate` mit dem Wert `Bearer`, den wir hier zurückgeben, ist ebenfalls Teil der Spezifikation.
+
+ Jeder HTTP-(Fehler-)Statuscode 401 „UNAUTHORIZED“ soll auch einen `WWW-Authenticate`-Header zurückgeben.
+
+ Im Fall von Bearer-Tokens (in unserem Fall) sollte der Wert dieses Headers `Bearer` lauten.
+
+ Sie können diesen zusätzlichen Header tatsächlich weglassen und es würde trotzdem funktionieren.
+
+ Aber er wird hier bereitgestellt, um den Spezifikationen zu entsprechen.
+
+ Außerdem gibt es möglicherweise Tools, die ihn erwarten und verwenden (jetzt oder in der Zukunft) und das könnte für Sie oder Ihre Benutzer jetzt oder in der Zukunft nützlich sein.
+
+ Das ist der Vorteil von Standards ...
+
+## Es in Aktion sehen
+
+Öffnen Sie die interaktive Dokumentation: http://127.0.0.1:8000/docs.
+
+### Authentifizieren
+
+Klicken Sie auf den Button „Authorize“.
+
+Verwenden Sie die Anmeldedaten:
+
+Benutzer: `johndoe`
+
+Passwort: `secret`.
+
+
+
+Nach der Authentifizierung im System sehen Sie Folgendes:
+
+
+
+### Die eigenen Benutzerdaten ansehen
+
+Verwenden Sie nun die Operation `GET` mit dem Pfad `/users/me`.
+
+Sie erhalten Ihre Benutzerdaten:
+
+```JSON
+{
+ "username": "johndoe",
+ "email": "johndoe@example.com",
+ "full_name": "John Doe",
+ "disabled": false,
+ "hashed_password": "fakehashedsecret"
+}
+```
+
+
+
+Wenn Sie auf das Schlosssymbol klicken und sich abmelden und dann den gleichen Vorgang nochmal versuchen, erhalten Sie einen HTTP 401 Error:
+
+```JSON
+{
+ "detail": "Not authenticated"
+}
+```
+
+### Inaktiver Benutzer
+
+Versuchen Sie es nun mit einem inaktiven Benutzer und authentisieren Sie sich mit:
+
+Benutzer: `alice`.
+
+Passwort: `secret2`.
+
+Und versuchen Sie, die Operation `GET` mit dem Pfad `/users/me` zu verwenden.
+
+Sie erhalten die Fehlermeldung „Inactive user“:
+
+```JSON
+{
+ "detail": "Inactive user"
+}
+```
+
+## Zusammenfassung
+
+Sie verfügen jetzt über die Tools, um ein vollständiges Sicherheitssystem basierend auf `username` und `password` für Ihre API zu implementieren.
+
+Mit diesen Tools können Sie das Sicherheitssystem mit jeder Datenbank und jedem Benutzer oder Datenmodell kompatibel machen.
+
+Das einzige fehlende Detail ist, dass es noch nicht wirklich „sicher“ ist.
+
+Im nächsten Kapitel erfahren Sie, wie Sie eine sichere Passwort-Hashing-Bibliothek und JWT-Token verwenden.
diff --git a/docs/de/docs/tutorial/static-files.md b/docs/de/docs/tutorial/static-files.md
new file mode 100644
index 000000000..1e289e120
--- /dev/null
+++ b/docs/de/docs/tutorial/static-files.md
@@ -0,0 +1,39 @@
+# Statische Dateien
+
+Mit `StaticFiles` können Sie statische Dateien aus einem Verzeichnis automatisch bereitstellen.
+
+## `StaticFiles` verwenden
+
+* Importieren Sie `StaticFiles`.
+* „Mounten“ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad.
+
+```Python hl_lines="2 6"
+{!../../../docs_src/static_files/tutorial001.py!}
+```
+
+!!! note "Technische Details"
+ Sie könnten auch `from starlette.staticfiles import StaticFiles` verwenden.
+
+ **FastAPI** stellt dasselbe `starlette.staticfiles` auch via `fastapi.staticfiles` bereit, als Annehmlichkeit für Sie, den Entwickler. Es kommt aber tatsächlich direkt von Starlette.
+
+### Was ist „Mounten“?
+
+„Mounten“ bedeutet das Hinzufügen einer vollständigen „unabhängigen“ Anwendung an einem bestimmten Pfad, die sich dann um die Handhabung aller Unterpfade kümmert.
+
+Dies unterscheidet sich von der Verwendung eines `APIRouter`, da eine gemountete Anwendung völlig unabhängig ist. Die OpenAPI und Dokumentation Ihrer Hauptanwendung enthalten nichts von der gemounteten Anwendung, usw.
+
+Weitere Informationen hierzu finden Sie im [Handbuch für fortgeschrittene Benutzer](../advanced/index.md){.internal-link target=_blank}.
+
+## Einzelheiten
+
+Das erste `"/static"` bezieht sich auf den Unterpfad, auf dem diese „Unteranwendung“ „gemountet“ wird. Daher wird jeder Pfad, der mit `"/static"` beginnt, von ihr verarbeitet.
+
+Das `directory="static"` bezieht sich auf den Namen des Verzeichnisses, das Ihre statischen Dateien enthält.
+
+Das `name="static"` gibt dieser Unteranwendung einen Namen, der intern von **FastAPI** verwendet werden kann.
+
+Alle diese Parameter können anders als "`static`" lauten, passen Sie sie an die Bedürfnisse und spezifischen Details Ihrer eigenen Anwendung an.
+
+## Weitere Informationen
+
+Weitere Details und Optionen finden Sie in der Dokumentation von Starlette zu statischen Dateien.
diff --git a/docs/de/docs/tutorial/testing.md b/docs/de/docs/tutorial/testing.md
new file mode 100644
index 000000000..541cc1bf0
--- /dev/null
+++ b/docs/de/docs/tutorial/testing.md
@@ -0,0 +1,212 @@
+# Testen
+
+Dank Starlette ist das Testen von **FastAPI**-Anwendungen einfach und macht Spaß.
+
+Es basiert auf HTTPX, welches wiederum auf der Grundlage von requests konzipiert wurde, es ist also sehr vertraut und intuitiv.
+
+Damit können Sie pytest direkt mit **FastAPI** verwenden.
+
+## Verwendung von `TestClient`
+
+!!! info
+ Um `TestClient` zu verwenden, installieren Sie zunächst `httpx`.
+
+ Z. B. `pip install httpx`.
+
+Importieren Sie `TestClient`.
+
+Erstellen Sie einen `TestClient`, indem Sie ihm Ihre **FastAPI**-Anwendung übergeben.
+
+Erstellen Sie Funktionen mit einem Namen, der mit `test_` beginnt (das sind `pytest`-Konventionen).
+
+Verwenden Sie das `TestClient`-Objekt auf die gleiche Weise wie `httpx`.
+
+Schreiben Sie einfache `assert`-Anweisungen mit den Standard-Python-Ausdrücken, die Sie überprüfen müssen (wiederum, Standard-`pytest`).
+
+```Python hl_lines="2 12 15-18"
+{!../../../docs_src/app_testing/tutorial001.py!}
+```
+
+!!! tip "Tipp"
+ Beachten Sie, dass die Testfunktionen normal `def` und nicht `async def` sind.
+
+ Und die Anrufe an den Client sind ebenfalls normale Anrufe, die nicht `await` verwenden.
+
+ Dadurch können Sie `pytest` ohne Komplikationen direkt nutzen.
+
+!!! note "Technische Details"
+ Sie könnten auch `from starlette.testclient import TestClient` verwenden.
+
+ **FastAPI** stellt denselben `starlette.testclient` auch via `fastapi.testclient` bereit, als Annehmlichkeit für Sie, den Entwickler. Es kommt aber tatsächlich direkt von Starlette.
+
+!!! tip "Tipp"
+ Wenn Sie in Ihren Tests neben dem Senden von Anfragen an Ihre FastAPI-Anwendung auch `async`-Funktionen aufrufen möchten (z. B. asynchrone Datenbankfunktionen), werfen Sie einen Blick auf die [Async-Tests](../advanced/async-tests.md){.internal-link target=_blank} im Handbuch für fortgeschrittene Benutzer.
+
+## Tests separieren
+
+In einer echten Anwendung würden Sie Ihre Tests wahrscheinlich in einer anderen Datei haben.
+
+Und Ihre **FastAPI**-Anwendung könnte auch aus mehreren Dateien/Modulen, usw. bestehen.
+
+### **FastAPI** Anwendungsdatei
+
+Nehmen wir an, Sie haben eine Dateistruktur wie in [Größere Anwendungen](bigger-applications.md){.internal-link target=_blank} beschrieben:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ └── main.py
+```
+
+In der Datei `main.py` haben Sie Ihre **FastAPI**-Anwendung:
+
+
+```Python
+{!../../../docs_src/app_testing/main.py!}
+```
+
+### Testdatei
+
+Dann könnten Sie eine Datei `test_main.py` mit Ihren Tests haben. Sie könnte sich im selben Python-Package befinden (dasselbe Verzeichnis mit einer `__init__.py`-Datei):
+
+``` hl_lines="5"
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+│ └── test_main.py
+```
+
+Da sich diese Datei im selben Package befindet, können Sie relative Importe verwenden, um das Objekt `app` aus dem `main`-Modul (`main.py`) zu importieren:
+
+```Python hl_lines="3"
+{!../../../docs_src/app_testing/test_main.py!}
+```
+
+... und haben den Code für die Tests wie zuvor.
+
+## Testen: erweitertes Beispiel
+
+Nun erweitern wir dieses Beispiel und fügen weitere Details hinzu, um zu sehen, wie verschiedene Teile getestet werden.
+
+### Erweiterte **FastAPI**-Anwendungsdatei
+
+Fahren wir mit der gleichen Dateistruktur wie zuvor fort:
+
+```
+.
+├── app
+│ ├── __init__.py
+│ ├── main.py
+│ └── test_main.py
+```
+
+Nehmen wir an, dass die Datei `main.py` mit Ihrer **FastAPI**-Anwendung jetzt einige andere **Pfadoperationen** hat.
+
+Sie verfügt über eine `GET`-Operation, die einen Fehler zurückgeben könnte.
+
+Sie verfügt über eine `POST`-Operation, die mehrere Fehler zurückgeben könnte.
+
+Beide *Pfadoperationen* erfordern einen `X-Token`-Header.
+
+=== "Python 3.10+"
+
+ ```Python
+ {!> ../../../docs_src/app_testing/app_b_an_py310/main.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python
+ {!> ../../../docs_src/app_testing/app_b_an_py39/main.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ {!> ../../../docs_src/app_testing/app_b_an/main.py!}
+ ```
+
+=== "Python 3.10+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ {!> ../../../docs_src/app_testing/app_b_py310/main.py!}
+ ```
+
+=== "Python 3.8+ nicht annotiert"
+
+ !!! tip "Tipp"
+ Bevorzugen Sie die `Annotated`-Version, falls möglich.
+
+ ```Python
+ {!> ../../../docs_src/app_testing/app_b/main.py!}
+ ```
+
+### Erweiterte Testdatei
+
+Anschließend könnten Sie `test_main.py` mit den erweiterten Tests aktualisieren:
+
+```Python
+{!> ../../../docs_src/app_testing/app_b/test_main.py!}
+```
+
+Wenn Sie möchten, dass der Client Informationen im Request übergibt und Sie nicht wissen, wie das geht, können Sie suchen (googeln), wie es mit `httpx` gemacht wird, oder sogar, wie es mit `requests` gemacht wird, da das Design von HTTPX auf dem Design von Requests basiert.
+
+Dann machen Sie in Ihren Tests einfach das gleiche.
+
+Z. B.:
+
+* Um einen *Pfad*- oder *Query*-Parameter zu übergeben, fügen Sie ihn der URL selbst hinzu.
+* Um einen JSON-Body zu übergeben, übergeben Sie ein Python-Objekt (z. B. ein `dict`) an den Parameter `json`.
+* Wenn Sie *Formulardaten* anstelle von JSON senden müssen, verwenden Sie stattdessen den `data`-Parameter.
+* Um *Header* zu übergeben, verwenden Sie ein `dict` im `headers`-Parameter.
+* Für *Cookies* ein `dict` im `cookies`-Parameter.
+
+Weitere Informationen zum Übergeben von Daten an das Backend (mithilfe von `httpx` oder dem `TestClient`) finden Sie in der HTTPX-Dokumentation.
+
+!!! info
+ Beachten Sie, dass der `TestClient` Daten empfängt, die nach JSON konvertiert werden können, keine Pydantic-Modelle.
+
+ Wenn Sie ein Pydantic-Modell in Ihrem Test haben und dessen Daten während des Testens an die Anwendung senden möchten, können Sie den `jsonable_encoder` verwenden, der in [JSON-kompatibler Encoder](encoder.md){.internal-link target=_blank} beschrieben wird.
+
+## Tests ausführen
+
+Danach müssen Sie nur noch `pytest` installieren:
+
+
-
-## 🌅 ℹ
-
-👆 💪 ✍ 🌅 🔃 `encode/databases` 🚮 📂 📃.
diff --git a/docs/em/docs/advanced/behind-a-proxy.md b/docs/em/docs/advanced/behind-a-proxy.md
index 12afe638c..e3fd26735 100644
--- a/docs/em/docs/advanced/behind-a-proxy.md
+++ b/docs/em/docs/advanced/behind-a-proxy.md
@@ -341,6 +341,6 @@ $ uvicorn main:app --root-path /api/v1
## 🗜 🎧-🈸
-🚥 👆 💪 🗻 🎧-🈸 (🔬 [🎧 🈸 - 🗻](./sub-applications.md){.internal-link target=_blank}) ⏪ ⚙️ 🗳 ⏮️ `root_path`, 👆 💪 ⚫️ 🛎, 👆 🔜 ⌛.
+🚥 👆 💪 🗻 🎧-🈸 (🔬 [🎧 🈸 - 🗻](sub-applications.md){.internal-link target=_blank}) ⏪ ⚙️ 🗳 ⏮️ `root_path`, 👆 💪 ⚫️ 🛎, 👆 🔜 ⌛.
FastAPI 🔜 🔘 ⚙️ `root_path` 🎆, ⚫️ 🔜 👷. 👶
diff --git a/docs/em/docs/advanced/dataclasses.md b/docs/em/docs/advanced/dataclasses.md
index a4c287106..e8c4b99a2 100644
--- a/docs/em/docs/advanced/dataclasses.md
+++ b/docs/em/docs/advanced/dataclasses.md
@@ -8,7 +8,7 @@ FastAPI 🏗 🔛 🔝 **Pydantic**, & 👤 ✔️ 🌏 👆 ❔ ⚙️ Pyda
{!../../../docs_src/dataclasses/tutorial001.py!}
```
-👉 🐕🦺 👏 **Pydantic**, ⚫️ ✔️ 🔗 🐕🦺 `dataclasses`.
+👉 🐕🦺 👏 **Pydantic**, ⚫️ ✔️ 🔗 🐕🦺 `dataclasses`.
, ⏮️ 📟 🔛 👈 🚫 ⚙️ Pydantic 🎯, FastAPI ⚙️ Pydantic 🗜 📚 🐩 🎻 Pydantic 👍 🍛 🎻.
@@ -91,7 +91,7 @@ FastAPI 🏗 🔛 🔝 **Pydantic**, & 👤 ✔️ 🌏 👆 ❔ ⚙️ Pyda
👆 💪 🌀 `dataclasses` ⏮️ 🎏 Pydantic 🏷, 😖 ⚪️➡️ 👫, 🔌 👫 👆 👍 🏷, ♒️.
-💡 🌅, ✅ Pydantic 🩺 🔃 🎻.
+💡 🌅, ✅ Pydantic 🩺 🔃 🎻.
## ⏬
diff --git a/docs/em/docs/advanced/events.md b/docs/em/docs/advanced/events.md
index 671e81b18..19421ff58 100644
--- a/docs/em/docs/advanced/events.md
+++ b/docs/em/docs/advanced/events.md
@@ -157,4 +157,4 @@ async with lifespan(app):
## 🎧 🈸
-👶 ✔️ 🤯 👈 👫 🔆 🎉 (🕴 & 🤫) 🔜 🕴 🛠️ 👑 🈸, 🚫 [🎧 🈸 - 🗻](./sub-applications.md){.internal-link target=_blank}.
+👶 ✔️ 🤯 👈 👫 🔆 🎉 (🕴 & 🤫) 🔜 🕴 🛠️ 👑 🈸, 🚫 [🎧 🈸 - 🗻](sub-applications.md){.internal-link target=_blank}.
diff --git a/docs/em/docs/advanced/generate-clients.md b/docs/em/docs/advanced/generate-clients.md
index 30560c8c6..261f9fb61 100644
--- a/docs/em/docs/advanced/generate-clients.md
+++ b/docs/em/docs/advanced/generate-clients.md
@@ -10,7 +10,7 @@
⚠ 🧰 🗄 🚂.
-🚥 👆 🏗 **🕸**, 📶 😌 🎛 🗄-📕-🇦🇪.
+🚥 👆 🏗 **🕸**, 📶 😌 🎛 🗄-📕-🇦🇪.
## 🏗 📕 🕸 👩💻
@@ -46,14 +46,14 @@
🔜 👈 👥 ✔️ 📱 ⏮️ 🏷, 👥 💪 🏗 👩💻 📟 🕸.
-#### ❎ `openapi-typescript-codegen`
+#### ❎ `openapi-ts`
-👆 💪 ❎ `openapi-typescript-codegen` 👆 🕸 📟 ⏮️:
+👆 💪 ❎ `openapi-ts` 👆 🕸 📟 ⏮️:
await 🐕🦺, 👥 🔜 📣 👆 🔢 ⏮️ 😐 `def` ↩️ `async def`.
-
-, 🗄 👍 🚫 ⚙️ 👁 `Bucket` 🎚 💗 "🧵Ⓜ",, 👥 💪 🤚 🥡 🔗 & 🚶♀️ ⚫️ 👆 🚙 🔢:
-
-```Python hl_lines="49-53"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-## 🌃
-
-👆 💪 🛠️ 🙆 🥉 🥳 ☁ 💽, ⚙️ 👫 🐩 📦.
-
-🎏 ✔ 🙆 🎏 🔢 🧰, ⚙️ ⚖️ 🛠️.
diff --git a/docs/em/docs/advanced/openapi-callbacks.md b/docs/em/docs/advanced/openapi-callbacks.md
index 630b75ed2..3355d6071 100644
--- a/docs/em/docs/advanced/openapi-callbacks.md
+++ b/docs/em/docs/advanced/openapi-callbacks.md
@@ -36,7 +36,7 @@
```
!!! tip
- `callback_url` 🔢 🔢 ⚙️ Pydantic 📛 🆎.
+ `callback_url` 🔢 🔢 ⚙️ Pydantic 📛 🆎.
🕴 🆕 👜 `callbacks=messages_callback_router.routes` ❌ *➡ 🛠️ 👨🎨*. 👥 🔜 👀 ⚫️❔ 👈 ⏭.
diff --git a/docs/em/docs/advanced/path-operation-advanced-configuration.md b/docs/em/docs/advanced/path-operation-advanced-configuration.md
index ec7231870..3dc5ac536 100644
--- a/docs/em/docs/advanced/path-operation-advanced-configuration.md
+++ b/docs/em/docs/advanced/path-operation-advanced-configuration.md
@@ -59,7 +59,7 @@
👆 💪 📣 🌖 📨 ⏮️ 👫 🏷, 👔 📟, ♒️.
-📤 🎂 📃 📥 🧾 🔃 ⚫️, 👆 💪 ✍ ⚫️ [🌖 📨 🗄](./additional-responses.md){.internal-link target=_blank}.
+📤 🎂 📃 📥 🧾 🔃 ⚫️, 👆 💪 ✍ ⚫️ [🌖 📨 🗄](additional-responses.md){.internal-link target=_blank}.
## 🗄 ➕
@@ -77,7 +77,7 @@
!!! tip
👉 🔅 🎚 ↔ ☝.
- 🚥 👆 🕴 💪 📣 🌖 📨, 🌅 🏪 🌌 ⚫️ ⏮️ [🌖 📨 🗄](./additional-responses.md){.internal-link target=_blank}.
+ 🚥 👆 🕴 💪 📣 🌖 📨, 🌅 🏪 🌌 ⚫️ ⏮️ [🌖 📨 🗄](additional-responses.md){.internal-link target=_blank}.
👆 💪 ↔ 🗄 🔗 *➡ 🛠️* ⚙️ 🔢 `openapi_extra`.
diff --git a/docs/em/docs/advanced/security/index.md b/docs/em/docs/advanced/security/index.md
index f2bb66df4..10291338e 100644
--- a/docs/em/docs/advanced/security/index.md
+++ b/docs/em/docs/advanced/security/index.md
@@ -2,7 +2,7 @@
## 🌖 ⚒
-📤 ➕ ⚒ 🍵 💂♂ ↖️ ⚪️➡️ 🕐 📔 [🔰 - 👩💻 🦮: 💂♂](../../tutorial/security/){.internal-link target=_blank}.
+📤 ➕ ⚒ 🍵 💂♂ ↖️ ⚪️➡️ 🕐 📔 [🔰 - 👩💻 🦮: 💂♂](../../tutorial/security/index.md){.internal-link target=_blank}.
!!! tip
⏭ 📄 **🚫 🎯 "🏧"**.
@@ -11,6 +11,6 @@
## ✍ 🔰 🥇
-⏭ 📄 🤔 👆 ⏪ ✍ 👑 [🔰 - 👩💻 🦮: 💂♂](../../tutorial/security/){.internal-link target=_blank}.
+⏭ 📄 🤔 👆 ⏪ ✍ 👑 [🔰 - 👩💻 🦮: 💂♂](../../tutorial/security/index.md){.internal-link target=_blank}.
👫 🌐 ⚓️ 🔛 🎏 🔧, ✋️ ✔ ➕ 🛠️.
diff --git a/docs/em/docs/advanced/settings.md b/docs/em/docs/advanced/settings.md
index 2ebe8ffcb..c17212023 100644
--- a/docs/em/docs/advanced/settings.md
+++ b/docs/em/docs/advanced/settings.md
@@ -125,7 +125,7 @@ Hello World from Python
## Pydantic `Settings`
-👐, Pydantic 🚚 👑 🚙 🍵 👫 ⚒ 👟 ⚪️➡️ 🌐 🔢 ⏮️ Pydantic: ⚒ 🧾.
+👐, Pydantic 🚚 👑 🚙 🍵 👫 ⚒ 👟 ⚪️➡️ 🌐 🔢 ⏮️ Pydantic: ⚒ 🧾.
### ✍ `Settings` 🎚
@@ -279,7 +279,7 @@ APP_NAME="ChimichangApp"
📥 👥 ✍ 🎓 `Config` 🔘 👆 Pydantic `Settings` 🎓, & ⚒ `env_file` 📁 ⏮️ 🇨🇻 📁 👥 💚 ⚙️.
!!! tip
- `Config` 🎓 ⚙️ Pydantic 📳. 👆 💪 ✍ 🌖 Pydantic 🏷 📁
+ `Config` 🎓 ⚙️ Pydantic 📳. 👆 💪 ✍ 🌖 Pydantic 🏷 📁
### 🏗 `Settings` 🕴 🕐 ⏮️ `lru_cache`
diff --git a/docs/em/docs/advanced/sub-applications.md b/docs/em/docs/advanced/sub-applications.md
index e0391453b..1e0931f95 100644
--- a/docs/em/docs/advanced/sub-applications.md
+++ b/docs/em/docs/advanced/sub-applications.md
@@ -70,4 +70,4 @@ $ uvicorn main:app --reload
& 🎧-🈸 💪 ✔️ 🚮 👍 📌 🎧-🈸 & 🌐 🔜 👷 ☑, ↩️ FastAPI 🍵 🌐 👉 `root_path`Ⓜ 🔁.
-👆 🔜 💡 🌅 🔃 `root_path` & ❔ ⚙️ ⚫️ 🎯 📄 🔃 [⛅ 🗳](./behind-a-proxy.md){.internal-link target=_blank}.
+👆 🔜 💡 🌅 🔃 `root_path` & ❔ ⚙️ ⚫️ 🎯 📄 🔃 [⛅ 🗳](behind-a-proxy.md){.internal-link target=_blank}.
diff --git a/docs/em/docs/advanced/wsgi.md b/docs/em/docs/advanced/wsgi.md
index 4d051807f..6a4ed073c 100644
--- a/docs/em/docs/advanced/wsgi.md
+++ b/docs/em/docs/advanced/wsgi.md
@@ -1,6 +1,6 @@
# ✅ 🇨🇻 - 🏺, ✳, 🎏
-👆 💪 🗻 🇨🇻 🈸 👆 👀 ⏮️ [🎧 🈸 - 🗻](./sub-applications.md){.internal-link target=_blank}, [⛅ 🗳](./behind-a-proxy.md){.internal-link target=_blank}.
+👆 💪 🗻 🇨🇻 🈸 👆 👀 ⏮️ [🎧 🈸 - 🗻](sub-applications.md){.internal-link target=_blank}, [⛅ 🗳](behind-a-proxy.md){.internal-link target=_blank}.
👈, 👆 💪 ⚙️ `WSGIMiddleware` & ⚙️ ⚫️ 🎁 👆 🇨🇻 🈸, 🖼, 🏺, ✳, ♒️.
diff --git a/docs/em/docs/alternatives.md b/docs/em/docs/alternatives.md
index 6169aa52d..5890b3b13 100644
--- a/docs/em/docs/alternatives.md
+++ b/docs/em/docs/alternatives.md
@@ -342,7 +342,7 @@ Webarg 🧰 👈 ⚒ 🚚 👈 🔛 🔝 📚 🛠️, 🔌 🏺.
## ⚙️ **FastAPI**
-### Pydantic
+### Pydantic
Pydantic 🗃 🔬 💽 🔬, 🛠️ & 🧾 (⚙️ 🎻 🔗) ⚓️ 🔛 🐍 🆎 🔑.
diff --git a/docs/em/docs/async.md b/docs/em/docs/async.md
index ddcae1573..0db497f40 100644
--- a/docs/em/docs/async.md
+++ b/docs/em/docs/async.md
@@ -405,15 +405,15 @@ async def read_burgers():
🚥 👆 👟 ⚪️➡️ ➕1️⃣ 🔁 🛠️ 👈 🔨 🚫 👷 🌌 🔬 🔛 & 👆 ⚙️ ⚖ 🙃 📊-🕴 *➡ 🛠️ 🔢* ⏮️ ✅ `def` 🤪 🎭 📈 (🔃 1️⃣0️⃣0️⃣ 💓), 🙏 🗒 👈 **FastAPI** ⭐ 🔜 🔄. 👫 💼, ⚫️ 👻 ⚙️ `async def` 🚥 👆 *➡ 🛠️ 🔢* ⚙️ 📟 👈 🎭 🚧 👤/🅾.
-, 👯♂️ ⚠, 🤞 👈 **FastAPI** 🔜 [⏩](/#performance){.internal-link target=_blank} 🌘 (⚖️ 🌘 ⭐) 👆 ⏮️ 🛠️.
+, 👯♂️ ⚠, 🤞 👈 **FastAPI** 🔜 [⏩](index.md#_15){.internal-link target=_blank} 🌘 (⚖️ 🌘 ⭐) 👆 ⏮️ 🛠️.
### 🔗
-🎏 ✔ [🔗](./tutorial/dependencies/index.md){.internal-link target=_blank}. 🚥 🔗 🐩 `def` 🔢 ↩️ `async def`, ⚫️ 🏃 🔢 🧵.
+🎏 ✔ [🔗](tutorial/dependencies/index.md){.internal-link target=_blank}. 🚥 🔗 🐩 `def` 🔢 ↩️ `async def`, ⚫️ 🏃 🔢 🧵.
### 🎧-🔗
-👆 💪 ✔️ 💗 🔗 & [🎧-🔗](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} 🚫 🔠 🎏 (🔢 🔢 🔑), 👫 💪 ✍ ⏮️ `async def` & ⏮️ 😐 `def`. ⚫️ 🔜 👷, & 🕐 ✍ ⏮️ 😐 `def` 🔜 🤙 🔛 🔢 🧵 (⚪️➡️ 🧵) ↩️ ➖ "⌛".
+👆 💪 ✔️ 💗 🔗 & [🎧-🔗](tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} 🚫 🔠 🎏 (🔢 🔢 🔑), 👫 💪 ✍ ⏮️ `async def` & ⏮️ 😐 `def`. ⚫️ 🔜 👷, & 🕐 ✍ ⏮️ 😐 `def` 🔜 🤙 🔛 🔢 🧵 (⚪️➡️ 🧵) ↩️ ➖ "⌛".
### 🎏 🚙 🔢
@@ -427,4 +427,4 @@ async def read_burgers():
🔄, 👉 📶 📡 ℹ 👈 🔜 🎲 ⚠ 🚥 👆 👟 🔎 👫.
-⏪, 👆 🔜 👍 ⏮️ 📄 ⚪️➡️ 📄 🔛: 🏃 ❓.
+⏪, 👆 🔜 👍 ⏮️ 📄 ⚪️➡️ 📄 🔛: 🏃 ❓.
diff --git a/docs/em/docs/deployment/concepts.md b/docs/em/docs/deployment/concepts.md
index 162b68615..b0f86cb5e 100644
--- a/docs/em/docs/deployment/concepts.md
+++ b/docs/em/docs/deployment/concepts.md
@@ -25,7 +25,7 @@
## 💂♂ - 🇺🇸🔍
-[⏮️ 📃 🔃 🇺🇸🔍](./https.md){.internal-link target=_blank} 👥 🇭🇲 🔃 ❔ 🇺🇸🔍 🚚 🔐 👆 🛠️.
+[⏮️ 📃 🔃 🇺🇸🔍](https.md){.internal-link target=_blank} 👥 🇭🇲 🔃 ❔ 🇺🇸🔍 🚚 🔐 👆 🛠️.
👥 👀 👈 🇺🇸🔍 🛎 🚚 🦲 **🔢** 👆 🈸 💽, **🤝 ❎ 🗳**.
@@ -187,7 +187,7 @@
### 👨🏭 🛠️ & ⛴
-💭 ⚪️➡️ 🩺 [🔃 🇺🇸🔍](./https.md){.internal-link target=_blank} 👈 🕴 1️⃣ 🛠️ 💪 👂 🔛 1️⃣ 🌀 ⛴ & 📢 📢 💽 ❓
+💭 ⚪️➡️ 🩺 [🔃 🇺🇸🔍](https.md){.internal-link target=_blank} 👈 🕴 1️⃣ 🛠️ 💪 👂 🔛 1️⃣ 🌀 ⛴ & 📢 📢 💽 ❓
👉 ☑.
@@ -241,7 +241,7 @@
!!! tip
🚫 😟 🚥 👫 🏬 🔃 **📦**, ☁, ⚖️ Kubernetes 🚫 ⚒ 📚 🔑.
- 👤 🔜 💬 👆 🌅 🔃 📦 🖼, ☁, Kubernetes, ♒️. 🔮 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
+ 👤 🔜 💬 👆 🌅 🔃 📦 🖼, ☁, Kubernetes, ♒️. 🔮 📃: [FastAPI 📦 - ☁](docker.md){.internal-link target=_blank}.
## ⏮️ 🔁 ⏭ ▶️
@@ -273,7 +273,7 @@
* 👆 🔜 💪 🌌 ▶️/⏏ *👈* 🎉 ✍, 🔍 ❌, ♒️.
!!! tip
- 👤 🔜 🤝 👆 🌅 🧱 🖼 🔨 👉 ⏮️ 📦 🔮 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
+ 👤 🔜 🤝 👆 🌅 🧱 🖼 🔨 👉 ⏮️ 📦 🔮 📃: [FastAPI 📦 - ☁](docker.md){.internal-link target=_blank}.
## ℹ 🛠️
diff --git a/docs/em/docs/deployment/docker.md b/docs/em/docs/deployment/docker.md
index f28735ed7..091eb3bab 100644
--- a/docs/em/docs/deployment/docker.md
+++ b/docs/em/docs/deployment/docker.md
@@ -5,7 +5,7 @@
⚙️ 💾 📦 ✔️ 📚 📈 ✅ **💂♂**, **🔬**, **🦁**, & 🎏.
!!! tip
- 🏃 & ⏪ 💭 👉 💩 ❓ 🦘 [`Dockerfile` 🔛 👶](#build-a-docker-image-for-fastapi).
+ 🏃 & ⏪ 💭 👉 💩 ❓ 🦘 [`Dockerfile` 🔛 👶](#fastapi).
ujson - ⏩ 🎻 "🎻".
* email_validator - 📧 🔬.
⚙️ 💃:
* httpx - ✔ 🚥 👆 💚 ⚙️ `TestClient`.
* jinja2 - ✔ 🚥 👆 💚 ⚙️ 🔢 📄 📳.
-* python-multipart - ✔ 🚥 👆 💚 🐕🦺 📨 "✍", ⏮️ `request.form()`.
+* python-multipart - ✔ 🚥 👆 💚 🐕🦺 📨 "✍", ⏮️ `request.form()`.
* itsdangerous - ✔ `SessionMiddleware` 🐕🦺.
* pyyaml - ✔ 💃 `SchemaGenerator` 🐕🦺 (👆 🎲 🚫 💪 ⚫️ ⏮️ FastAPI).
-* ujson - ✔ 🚥 👆 💚 ⚙️ `UJSONResponse`.
⚙️ FastAPI / 💃:
* uvicorn - 💽 👈 📐 & 🍦 👆 🈸.
* orjson - ✔ 🚥 👆 💚 ⚙️ `ORJSONResponse`.
+* ujson - ✔ 🚥 👆 💚 ⚙️ `UJSONResponse`.
👆 💪 ❎ 🌐 👫 ⏮️ `pip install "fastapi[all]"`.
diff --git a/docs/em/docs/python-types.md b/docs/em/docs/python-types.md
index e079d9039..b3026917a 100644
--- a/docs/em/docs/python-types.md
+++ b/docs/em/docs/python-types.md
@@ -168,7 +168,7 @@ John Doe
⚪️➡️ `typing`, 🗄 `List` (⏮️ 🔠 `L`):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
@@ -424,7 +424,7 @@ say_hi(name=None) # This works, None is valid 🎉
## Pydantic 🏷
-Pydantic 🐍 🗃 🎭 📊 🔬.
+Pydantic 🐍 🗃 🎭 📊 🔬.
👆 📣 "💠" 💽 🎓 ⏮️ 🔢.
@@ -455,14 +455,14 @@ say_hi(name=None) # This works, None is valid 🎉
```
!!! info
- 💡 🌖 🔃 Pydantic, ✅ 🚮 🩺.
+ 💡 🌖 🔃 Pydantic, ✅ 🚮 🩺.
**FastAPI** 🌐 ⚓️ 🔛 Pydantic.
👆 🔜 👀 📚 🌅 🌐 👉 💡 [🔰 - 👩💻 🦮](tutorial/index.md){.internal-link target=_blank}.
!!! tip
- Pydantic ✔️ 🎁 🎭 🕐❔ 👆 ⚙️ `Optional` ⚖️ `Union[Something, None]` 🍵 🔢 💲, 👆 💪 ✍ 🌅 🔃 ⚫️ Pydantic 🩺 🔃 ✔ 📦 🏑.
+ Pydantic ✔️ 🎁 🎭 🕐❔ 👆 ⚙️ `Optional` ⚖️ `Union[Something, None]` 🍵 🔢 💲, 👆 💪 ✍ 🌅 🔃 ⚫️ Pydantic 🩺 🔃 ✔ 📦 🏑.
## 🆎 🔑 **FastAPI**
diff --git a/docs/em/docs/tutorial/bigger-applications.md b/docs/em/docs/tutorial/bigger-applications.md
index c30bba106..fc9076aa8 100644
--- a/docs/em/docs/tutorial/bigger-applications.md
+++ b/docs/em/docs/tutorial/bigger-applications.md
@@ -119,7 +119,7 @@
!!! tip
👥 ⚙️ 💭 🎚 📉 👉 🖼.
- ✋️ 🎰 💼 👆 🔜 🤚 👍 🏁 ⚙️ 🛠️ [💂♂ 🚙](./security/index.md){.internal-link target=_blank}.
+ ✋️ 🎰 💼 👆 🔜 🤚 👍 🏁 ⚙️ 🛠️ [💂♂ 🚙](security/index.md){.internal-link target=_blank}.
## ➕1️⃣ 🕹 ⏮️ `APIRouter`
diff --git a/docs/em/docs/tutorial/body-nested-models.md b/docs/em/docs/tutorial/body-nested-models.md
index f4bd50f5c..c941fa08a 100644
--- a/docs/em/docs/tutorial/body-nested-models.md
+++ b/docs/em/docs/tutorial/body-nested-models.md
@@ -192,7 +192,7 @@ my_list: List[str]
↖️ ⚪️➡️ 😐 ⭐ 🆎 💖 `str`, `int`, `float`, ♒️. 👆 💪 ⚙️ 🌅 🏗 ⭐ 🆎 👈 😖 ⚪️➡️ `str`.
-👀 🌐 🎛 👆 ✔️, 🛒 🩺 Pydantic 😍 🆎. 👆 🔜 👀 🖼 ⏭ 📃.
+👀 🌐 🎛 👆 ✔️, 🛒 🩺 Pydantic 😍 🆎. 👆 🔜 👀 🖼 ⏭ 📃.
🖼, `Image` 🏷 👥 ✔️ `url` 🏑, 👥 💪 📣 ⚫️ ↩️ `str`, Pydantic `HttpUrl`:
diff --git a/docs/em/docs/tutorial/body-updates.md b/docs/em/docs/tutorial/body-updates.md
index 98058ab52..89bb615f6 100644
--- a/docs/em/docs/tutorial/body-updates.md
+++ b/docs/em/docs/tutorial/body-updates.md
@@ -48,7 +48,7 @@
👉 ⛓ 👈 👆 💪 📨 🕴 💽 👈 👆 💚 ℹ, 🍂 🎂 🐣.
-!!! Note
+!!! note
`PATCH` 🌘 🛎 ⚙️ & 💭 🌘 `PUT`.
& 📚 🏉 ⚙️ 🕴 `PUT`, 🍕 ℹ.
diff --git a/docs/em/docs/tutorial/body.md b/docs/em/docs/tutorial/body.md
index ca2f113bf..12f5a6315 100644
--- a/docs/em/docs/tutorial/body.md
+++ b/docs/em/docs/tutorial/body.md
@@ -6,7 +6,7 @@
👆 🛠️ 🌖 🕧 ✔️ 📨 **📨** 💪. ✋️ 👩💻 🚫 🎯 💪 📨 **📨** 💪 🌐 🕰.
-📣 **📨** 💪, 👆 ⚙️ Pydantic 🏷 ⏮️ 🌐 👫 🏋️ & 💰.
+📣 **📨** 💪, 👆 ⚙️ Pydantic 🏷 ⏮️ 🌐 👫 🏋️ & 💰.
!!! info
📨 💽, 👆 🔜 ⚙️ 1️⃣: `POST` (🌅 ⚠), `PUT`, `DELETE` ⚖️ `PATCH`.
@@ -210,4 +210,4 @@
## 🍵 Pydantic
-🚥 👆 🚫 💚 ⚙️ Pydantic 🏷, 👆 💪 ⚙️ **💪** 🔢. 👀 🩺 [💪 - 💗 🔢: ⭐ 💲 💪](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
+🚥 👆 🚫 💚 ⚙️ Pydantic 🏷, 👆 💪 ⚙️ **💪** 🔢. 👀 🩺 [💪 - 💗 🔢: ⭐ 💲 💪](body-multiple-params.md#_2){.internal-link target=_blank}.
diff --git a/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
index 9617667f4..3ed5aeba5 100644
--- a/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/em/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -99,7 +99,7 @@ FastAPI 🐕🦺 🔗 👈 👀 🩺 🌅 ℹ.
+ * Pydantic ✔ 🎦 ⚫️ "💾 8️⃣6️⃣0️⃣1️⃣ 🕰 ➕ 🔢", 👀 🩺 🌅 ℹ.
* `frozenset`:
* 📨 & 📨, 😥 🎏 `set`:
* 📨, 📇 🔜 ✍, ❎ ❎ & 🏭 ⚫️ `set`.
@@ -49,7 +49,7 @@
* `Decimal`:
* 🐩 🐍 `Decimal`.
* 📨 & 📨, 🍵 🎏 `float`.
-* 👆 💪 ✅ 🌐 ☑ Pydantic 📊 🆎 📥: Pydantic 📊 🆎.
+* 👆 💪 ✅ 🌐 ☑ Pydantic 📊 🆎 📥: Pydantic 📊 🆎.
## 🖼
diff --git a/docs/em/docs/tutorial/extra-models.md b/docs/em/docs/tutorial/extra-models.md
index 06c36285d..82f974d9f 100644
--- a/docs/em/docs/tutorial/extra-models.md
+++ b/docs/em/docs/tutorial/extra-models.md
@@ -11,7 +11,7 @@
!!! danger
🙅 🏪 👩💻 🔢 🔐. 🕧 🏪 "🔐 #️⃣" 👈 👆 💪 ⤴️ ✔.
- 🚥 👆 🚫 💭, 👆 🔜 💡 ⚫️❔ "🔐#️⃣" [💂♂ 📃](security/simple-oauth2.md#password-hashing){.internal-link target=_blank}.
+ 🚥 👆 🚫 💭, 👆 🔜 💡 ⚫️❔ "🔐#️⃣" [💂♂ 📃](security/simple-oauth2.md#_4){.internal-link target=_blank}.
## 💗 🏷
@@ -179,7 +179,7 @@ UserInDB(
👈, ⚙️ 🐩 🐍 🆎 🔑 `typing.Union`:
!!! note
- 🕐❔ ⚖ `Union`, 🔌 🏆 🎯 🆎 🥇, ⏩ 🌘 🎯 🆎. 🖼 🔛, 🌖 🎯 `PlaneItem` 👟 ⏭ `CarItem` `Union[PlaneItem, CarItem]`.
+ 🕐❔ ⚖ `Union`, 🔌 🏆 🎯 🆎 🥇, ⏩ 🌘 🎯 🆎. 🖼 🔛, 🌖 🎯 `PlaneItem` 👟 ⏭ `CarItem` `Union[PlaneItem, CarItem]`.
=== "🐍 3️⃣.6️⃣ & 🔛"
diff --git a/docs/em/docs/tutorial/first-steps.md b/docs/em/docs/tutorial/first-steps.md
index 252e769f4..b8d3f6b56 100644
--- a/docs/em/docs/tutorial/first-steps.md
+++ b/docs/em/docs/tutorial/first-steps.md
@@ -310,7 +310,7 @@ https://example.com/items/foo
```
!!! note
- 🚥 👆 🚫 💭 🔺, ✅ [🔁: *"🏃 ❓"*](../async.md#in-a-hurry){.internal-link target=_blank}.
+ 🚥 👆 🚫 💭 🔺, ✅ [🔁: *"🏃 ❓"*](../async.md#_2){.internal-link target=_blank}.
### 🔁 5️⃣: 📨 🎚
diff --git a/docs/em/docs/tutorial/handling-errors.md b/docs/em/docs/tutorial/handling-errors.md
index ef7bbfa65..36d58e2af 100644
--- a/docs/em/docs/tutorial/handling-errors.md
+++ b/docs/em/docs/tutorial/handling-errors.md
@@ -163,7 +163,7 @@ path -> item_id
!!! warning
👫 📡 ℹ 👈 👆 💪 🚶 🚥 ⚫️ 🚫 ⚠ 👆 🔜.
-`RequestValidationError` 🎧-🎓 Pydantic `ValidationError`.
+`RequestValidationError` 🎧-🎓 Pydantic `ValidationError`.
**FastAPI** ⚙️ ⚫️ 👈, 🚥 👆 ⚙️ Pydantic 🏷 `response_model`, & 👆 💽 ✔️ ❌, 👆 🔜 👀 ❌ 👆 🕹.
diff --git a/docs/em/docs/tutorial/metadata.md b/docs/em/docs/tutorial/metadata.md
index 00098cdf5..97d345fa2 100644
--- a/docs/em/docs/tutorial/metadata.md
+++ b/docs/em/docs/tutorial/metadata.md
@@ -66,7 +66,7 @@
```
!!! info
- ✍ 🌅 🔃 🔖 [➡ 🛠️ 📳](../path-operation-configuration/#tags){.internal-link target=_blank}.
+ ✍ 🌅 🔃 🔖 [➡ 🛠️ 📳](path-operation-configuration.md#_3){.internal-link target=_blank}.
### ✅ 🩺
diff --git a/docs/em/docs/tutorial/path-params.md b/docs/em/docs/tutorial/path-params.md
index ea939b458..ac64d2ebb 100644
--- a/docs/em/docs/tutorial/path-params.md
+++ b/docs/em/docs/tutorial/path-params.md
@@ -93,7 +93,7 @@
## Pydantic
-🌐 💽 🔬 🎭 🔽 🚘 Pydantic, 👆 🤚 🌐 💰 ⚪️➡️ ⚫️. & 👆 💭 👆 👍 ✋.
+🌐 💽 🔬 🎭 🔽 🚘 Pydantic, 👆 🤚 🌐 💰 ⚪️➡️ ⚫️. & 👆 💭 👆 👍 ✋.
👆 💪 ⚙️ 🎏 🆎 📄 ⏮️ `str`, `float`, `bool` & 📚 🎏 🏗 📊 🆎.
diff --git a/docs/em/docs/tutorial/query-params-str-validations.md b/docs/em/docs/tutorial/query-params-str-validations.md
index f0e455abe..1268c0d6e 100644
--- a/docs/em/docs/tutorial/query-params-str-validations.md
+++ b/docs/em/docs/tutorial/query-params-str-validations.md
@@ -227,7 +227,7 @@ q: Union[str, None] = Query(default=None, min_length=3)
```
!!! tip
- Pydantic, ❔ ⚫️❔ 🏋️ 🌐 💽 🔬 & 🛠️ FastAPI, ✔️ 🎁 🎭 🕐❔ 👆 ⚙️ `Optional` ⚖️ `Union[Something, None]` 🍵 🔢 💲, 👆 💪 ✍ 🌅 🔃 ⚫️ Pydantic 🩺 🔃 ✔ 📦 🏑.
+ Pydantic, ❔ ⚫️❔ 🏋️ 🌐 💽 🔬 & 🛠️ FastAPI, ✔️ 🎁 🎭 🕐❔ 👆 ⚙️ `Optional` ⚖️ `Union[Something, None]` 🍵 🔢 💲, 👆 💪 ✍ 🌅 🔃 ⚫️ Pydantic 🩺 🔃 ✔ 📦 🏑.
### ⚙️ Pydantic `Required` ↩️ ❕ (`...`)
diff --git a/docs/em/docs/tutorial/query-params.md b/docs/em/docs/tutorial/query-params.md
index ccb235c15..746b0af9e 100644
--- a/docs/em/docs/tutorial/query-params.md
+++ b/docs/em/docs/tutorial/query-params.md
@@ -222,4 +222,4 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
* `limit`, 📦 `int`.
!!! tip
- 👆 💪 ⚙️ `Enum`Ⓜ 🎏 🌌 ⏮️ [➡ 🔢](path-params.md#predefined-values){.internal-link target=_blank}.
+ 👆 💪 ⚙️ `Enum`Ⓜ 🎏 🌌 ⏮️ [➡ 🔢](path-params.md#_7){.internal-link target=_blank}.
diff --git a/docs/em/docs/tutorial/request-files.md b/docs/em/docs/tutorial/request-files.md
index 26631823f..be2218f89 100644
--- a/docs/em/docs/tutorial/request-files.md
+++ b/docs/em/docs/tutorial/request-files.md
@@ -3,7 +3,7 @@
👆 💪 🔬 📁 📂 👩💻 ⚙️ `File`.
!!! info
- 📨 📂 📁, 🥇 ❎ `python-multipart`.
+ 📨 📂 📁, 🥇 ❎ `python-multipart`.
🤶 Ⓜ. `pip install python-multipart`.
diff --git a/docs/em/docs/tutorial/request-forms-and-files.md b/docs/em/docs/tutorial/request-forms-and-files.md
index 99aeca000..0415dbf01 100644
--- a/docs/em/docs/tutorial/request-forms-and-files.md
+++ b/docs/em/docs/tutorial/request-forms-and-files.md
@@ -3,7 +3,7 @@
👆 💪 🔬 📁 & 📨 🏑 🎏 🕰 ⚙️ `File` & `Form`.
!!! info
- 📨 📂 📁 & /⚖️ 📨 📊, 🥇 ❎ `python-multipart`.
+ 📨 📂 📁 & /⚖️ 📨 📊, 🥇 ❎ `python-multipart`.
🤶 Ⓜ. `pip install python-multipart`.
diff --git a/docs/em/docs/tutorial/request-forms.md b/docs/em/docs/tutorial/request-forms.md
index fa74adae5..f12d6e650 100644
--- a/docs/em/docs/tutorial/request-forms.md
+++ b/docs/em/docs/tutorial/request-forms.md
@@ -3,7 +3,7 @@
🕐❔ 👆 💪 📨 📨 🏑 ↩️ 🎻, 👆 💪 ⚙️ `Form`.
!!! info
- ⚙️ 📨, 🥇 ❎ `python-multipart`.
+ ⚙️ 📨, 🥇 ❎ `python-multipart`.
🤶 Ⓜ. `pip install python-multipart`.
diff --git a/docs/em/docs/tutorial/response-model.md b/docs/em/docs/tutorial/response-model.md
index 6ea4413f8..7103e9176 100644
--- a/docs/em/docs/tutorial/response-model.md
+++ b/docs/em/docs/tutorial/response-model.md
@@ -378,7 +378,7 @@ FastAPI 🔨 📚 👜 🔘 ⏮️ Pydantic ⚒ 💭 👈 📚 🎏 🚫 🎓
```
!!! info
- FastAPI ⚙️ Pydantic 🏷 `.dict()` ⏮️ 🚮 `exclude_unset` 🔢 🏆 👉.
+ FastAPI ⚙️ Pydantic 🏷 `.dict()` ⏮️ 🚮 `exclude_unset` 🔢 🏆 👉.
!!! info
👆 💪 ⚙️:
@@ -386,7 +386,7 @@ FastAPI 🔨 📚 👜 🔘 ⏮️ Pydantic ⚒ 💭 👈 📚 🎏 🚫 🎓
* `response_model_exclude_defaults=True`
* `response_model_exclude_none=True`
- 🔬 Pydantic 🩺 `exclude_defaults` & `exclude_none`.
+ 🔬 Pydantic 🩺 `exclude_defaults` & `exclude_none`.
#### 📊 ⏮️ 💲 🏑 ⏮️ 🔢
diff --git a/docs/em/docs/tutorial/schema-extra-example.md b/docs/em/docs/tutorial/schema-extra-example.md
index d5bf8810a..114d5a84a 100644
--- a/docs/em/docs/tutorial/schema-extra-example.md
+++ b/docs/em/docs/tutorial/schema-extra-example.md
@@ -6,7 +6,7 @@
## Pydantic `schema_extra`
-👆 💪 📣 `example` Pydantic 🏷 ⚙️ `Config` & `schema_extra`, 🔬 Pydantic 🩺: 🔗 🛃:
+👆 💪 📣 `example` Pydantic 🏷 ⚙️ `Config` & `schema_extra`, 🔬 Pydantic 🩺: 🔗 🛃:
=== "🐍 3️⃣.6️⃣ & 🔛"
diff --git a/docs/em/docs/tutorial/security/first-steps.md b/docs/em/docs/tutorial/security/first-steps.md
index 6dec6f2c3..8c2c95cfd 100644
--- a/docs/em/docs/tutorial/security/first-steps.md
+++ b/docs/em/docs/tutorial/security/first-steps.md
@@ -27,7 +27,7 @@
## 🏃 ⚫️
!!! info
- 🥇 ❎ `python-multipart`.
+ 🥇 ❎ `python-multipart`.
🤶 Ⓜ. `pip install python-multipart`.
diff --git a/docs/em/docs/tutorial/security/simple-oauth2.md b/docs/em/docs/tutorial/security/simple-oauth2.md
index 765d94039..b9e3deb3c 100644
--- a/docs/em/docs/tutorial/security/simple-oauth2.md
+++ b/docs/em/docs/tutorial/security/simple-oauth2.md
@@ -163,7 +163,7 @@ UserInDB(
```
!!! info
- 🌅 🏁 🔑 `**👩💻_ #️⃣ ` ✅ 🔙 [🧾 **➕ 🏷**](../extra-models.md#about-user_indict){.internal-link target=_blank}.
+ 🌅 🏁 🔑 `**👩💻_ #️⃣ ` ✅ 🔙 [🧾 **➕ 🏷**](../extra-models.md#user_indict){.internal-link target=_blank}.
## 📨 🤝
diff --git a/docs/em/docs/tutorial/sql-databases.md b/docs/em/docs/tutorial/sql-databases.md
index e3ced7ef4..4c8740984 100644
--- a/docs/em/docs/tutorial/sql-databases.md
+++ b/docs/em/docs/tutorial/sql-databases.md
@@ -331,7 +331,7 @@ name: str
🔜, Pydantic *🏷* 👂, `Item` & `User`, 🚮 🔗 `Config` 🎓.
-👉 `Config` 🎓 ⚙️ 🚚 📳 Pydantic.
+👉 `Config` 🎓 ⚙️ 🚚 📳 Pydantic.
`Config` 🎓, ⚒ 🔢 `orm_mode = True`.
@@ -534,7 +534,7 @@ current_user.items
👉 🌌 👥 ⚒ 💭 💽 🎉 🕧 📪 ⏮️ 📨. 🚥 📤 ⚠ ⏪ 🏭 📨.
- ✋️ 👆 💪 🚫 🤚 ➕1️⃣ ⚠ ⚪️➡️ 🚪 📟 (⏮️ `yield`). 👀 🌖 [🔗 ⏮️ `yield` & `HTTPException`](./dependencies/dependencies-with-yield.md#dependencies-with-yield-and-httpexception){.internal-link target=_blank}
+ ✋️ 👆 💪 🚫 🤚 ➕1️⃣ ⚠ ⚪️➡️ 🚪 📟 (⏮️ `yield`). 👀 🌖 [🔗 ⏮️ `yield` & `HTTPException`](dependencies/dependencies-with-yield.md#yield-httpexception){.internal-link target=_blank}
& ⤴️, 🕐❔ ⚙️ 🔗 *➡ 🛠️ 🔢*, 👥 📣 ⚫️ ⏮️ 🆎 `Session` 👥 🗄 🔗 ⚪️➡️ 🇸🇲.
@@ -620,7 +620,7 @@ def read_user(user_id: int, db: Session = Depends(get_db)):
🚥 👆 💪 🔗 👆 🔗 💽 🔁, 👀 [🔁 🗄 (🔗) 💽](../advanced/async-sql-databases.md){.internal-link target=_blank}.
!!! note "📶 📡 ℹ"
- 🚥 👆 😟 & ✔️ ⏬ 📡 💡, 👆 💪 ✅ 📶 📡 ℹ ❔ 👉 `async def` 🆚 `def` 🍵 [🔁](../async.md#very-technical-details){.internal-link target=_blank} 🩺.
+ 🚥 👆 😟 & ✔️ ⏬ 📡 💡, 👆 💪 ✅ 📶 📡 ℹ ❔ 👉 `async def` 🆚 `def` 🍵 [🔁](../async.md#i_2){.internal-link target=_blank} 🩺.
## 🛠️
diff --git a/docs/em/docs/tutorial/testing.md b/docs/em/docs/tutorial/testing.md
index 999d67cd3..3ae51e298 100644
--- a/docs/em/docs/tutorial/testing.md
+++ b/docs/em/docs/tutorial/testing.md
@@ -50,7 +50,7 @@
### **FastAPI** 📱 📁
-➡️ 💬 👆 ✔️ 📁 📊 🔬 [🦏 🈸](./bigger-applications.md){.internal-link target=_blank}:
+➡️ 💬 👆 ✔️ 📁 📊 🔬 [🦏 🈸](bigger-applications.md){.internal-link target=_blank}:
```
.
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index 00d6f696d..827581de5 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,22 @@
Articles:
English:
+ - author: Kurtis Pykes - NVIDIA
+ link: https://developer.nvidia.com/blog/building-a-machine-learning-microservice-with-fastapi/
+ title: Building a Machine Learning Microservice with FastAPI
+ - author: Ravgeet Dhillon - Twilio
+ link: https://www.twilio.com/en-us/blog/booking-appointments-twilio-notion-fastapi
+ title: Booking Appointments with Twilio, Notion, and FastAPI
+ - author: Abhinav Tripathi - Microsoft Blogs
+ link: https://devblogs.microsoft.com/cosmosdb/azure-cosmos-db-python-and-fastapi/
+ title: Write a Python data layer with Azure Cosmos DB and FastAPI
+ - author: Donny Peeters
+ author_link: https://github.com/Donnype
+ link: https://bitestreams.com/blog/fastapi-sqlalchemy/
+ title: 10 Tips for adding SQLAlchemy to FastAPI
+ - author: Jessica Temporal
+ author_link: https://jtemporal.com/socials
+ link: https://jtemporal.com/tips-on-migrating-from-flask-to-fastapi-and-vice-versa/
+ title: Tips on migrating from Flask to FastAPI and vice-versa
- author: Ankit Anchlia
author_link: https://linkedin.com/in/aanchlia21
link: https://hackernoon.com/explore-how-to-effectively-use-jwt-with-fastapi
@@ -302,6 +319,11 @@ Articles:
author_link: https://qiita.com/mtitg
link: https://qiita.com/mtitg/items/47770e9a562dd150631d
title: FastAPI|DB接続してCRUDするPython製APIサーバーを構築
+ Portuguese:
+ - author: Jessica Temporal
+ author_link: https://jtemporal.com/socials
+ link: https://jtemporal.com/dicas-para-migrar-de-flask-para-fastapi-e-vice-versa/
+ title: Dicas para migrar uma aplicação de Flask para FastAPI e vice-versa
Russian:
- author: Troy Köhler
author_link: https://www.linkedin.com/in/trkohler/
@@ -327,6 +349,14 @@ Articles:
title: 'Tortoise ORM / FastAPI 整合快速筆記'
Podcasts:
English:
+ - author: Real Python
+ author_link: https://realpython.com/
+ link: https://realpython.com/podcasts/rpp/72/
+ title: Starting With FastAPI and Examining Python's Import System - Episode 72
+ - author: Python Bytes FM
+ author_link: https://pythonbytes.fm/
+ link: https://www.pythonpodcast.com/fastapi-web-application-framework-episode-259/
+ title: 'Do you dare to press "."? - Episode 247 - Dan #6: SQLModel - use the same models for SQL and FastAPI'
- author: Podcast.`__init__`
author_link: https://www.pythonpodcast.com/
link: https://www.pythonpodcast.com/fastapi-web-application-framework-episode-259/
diff --git a/docs/en/data/github_sponsors.yml b/docs/en/data/github_sponsors.yml
index 713f229cf..385bcb498 100644
--- a/docs/en/data/github_sponsors.yml
+++ b/docs/en/data/github_sponsors.yml
@@ -1,56 +1,47 @@
sponsors:
-- - login: scalar
- avatarUrl: https://avatars.githubusercontent.com/u/301879?v=4
- url: https://github.com/scalar
- - login: codacy
- avatarUrl: https://avatars.githubusercontent.com/u/1834093?v=4
- url: https://github.com/codacy
- - login: bump-sh
+- - login: bump-sh
avatarUrl: https://avatars.githubusercontent.com/u/33217836?v=4
url: https://github.com/bump-sh
- - login: Alek99
- avatarUrl: https://avatars.githubusercontent.com/u/38776361?u=bd6c163fe787c2de1a26c881598e54b67e2482dd&v=4
- url: https://github.com/Alek99
- - login: cryptapi
- avatarUrl: https://avatars.githubusercontent.com/u/44925437?u=61369138589bc7fee6c417f3fbd50fbd38286cc4&v=4
- url: https://github.com/cryptapi
- login: porter-dev
avatarUrl: https://avatars.githubusercontent.com/u/62078005?v=4
url: https://github.com/porter-dev
- login: andrew-propelauth
avatarUrl: https://avatars.githubusercontent.com/u/89474256?u=1188c27cb744bbec36447a2cfd4453126b2ddb5c&v=4
url: https://github.com/andrew-propelauth
-- - login: nihpo
- avatarUrl: https://avatars.githubusercontent.com/u/1841030?u=0264956d7580f7e46687a762a7baa629f84cf97c&v=4
- url: https://github.com/nihpo
- - login: ObliviousAI
+ - login: zanfaruqui
+ avatarUrl: https://avatars.githubusercontent.com/u/104461687?v=4
+ url: https://github.com/zanfaruqui
+ - login: Alek99
+ avatarUrl: https://avatars.githubusercontent.com/u/38776361?u=bd6c163fe787c2de1a26c881598e54b67e2482dd&v=4
+ url: https://github.com/Alek99
+ - login: cryptapi
+ avatarUrl: https://avatars.githubusercontent.com/u/44925437?u=61369138589bc7fee6c417f3fbd50fbd38286cc4&v=4
+ url: https://github.com/cryptapi
+ - login: codacy
+ avatarUrl: https://avatars.githubusercontent.com/u/1834093?v=4
+ url: https://github.com/codacy
+ - login: scalar
+ avatarUrl: https://avatars.githubusercontent.com/u/301879?v=4
+ url: https://github.com/scalar
+- - login: ObliviousAI
avatarUrl: https://avatars.githubusercontent.com/u/65656077?v=4
url: https://github.com/ObliviousAI
-- - login: mikeckennedy
- avatarUrl: https://avatars.githubusercontent.com/u/2035561?u=ce6165b799ea3164cb6f5ff54ea08042057442af&v=4
- url: https://github.com/mikeckennedy
- - login: ndimares
- avatarUrl: https://avatars.githubusercontent.com/u/6267663?u=cfb27efde7a7212be8142abb6c058a1aeadb41b1&v=4
- url: https://github.com/ndimares
- - login: deta
- avatarUrl: https://avatars.githubusercontent.com/u/47275976?v=4
- url: https://github.com/deta
- - login: deepset-ai
- avatarUrl: https://avatars.githubusercontent.com/u/51827949?v=4
- url: https://github.com/deepset-ai
- - login: databento
+- - login: databento
avatarUrl: https://avatars.githubusercontent.com/u/64141749?v=4
url: https://github.com/databento
- login: svix
avatarUrl: https://avatars.githubusercontent.com/u/80175132?v=4
url: https://github.com/svix
- - login: VincentParedes
- avatarUrl: https://avatars.githubusercontent.com/u/103889729?v=4
- url: https://github.com/VincentParedes
-- - login: acsone
- avatarUrl: https://avatars.githubusercontent.com/u/7601056?v=4
- url: https://github.com/acsone
- - login: takashi-yoneya
+ - login: deepset-ai
+ avatarUrl: https://avatars.githubusercontent.com/u/51827949?v=4
+ url: https://github.com/deepset-ai
+ - login: mikeckennedy
+ avatarUrl: https://avatars.githubusercontent.com/u/2035561?u=ce6165b799ea3164cb6f5ff54ea08042057442af&v=4
+ url: https://github.com/mikeckennedy
+ - login: ndimares
+ avatarUrl: https://avatars.githubusercontent.com/u/6267663?u=cfb27efde7a7212be8142abb6c058a1aeadb41b1&v=4
+ url: https://github.com/ndimares
+- - login: takashi-yoneya
avatarUrl: https://avatars.githubusercontent.com/u/33813153?u=2d0522bceba0b8b69adf1f2db866503bd96f944e&v=4
url: https://github.com/takashi-yoneya
- login: xoflare
@@ -62,54 +53,165 @@ sponsors:
- login: BoostryJP
avatarUrl: https://avatars.githubusercontent.com/u/57932412?v=4
url: https://github.com/BoostryJP
- - login: jina-ai
- avatarUrl: https://avatars.githubusercontent.com/u/60539444?v=4
- url: https://github.com/jina-ai
-- - login: Trivie
+ - login: acsone
+ avatarUrl: https://avatars.githubusercontent.com/u/7601056?v=4
+ url: https://github.com/acsone
+- - login: owlur
+ avatarUrl: https://avatars.githubusercontent.com/u/20010787?v=4
+ url: https://github.com/owlur
+ - login: Trivie
avatarUrl: https://avatars.githubusercontent.com/u/8161763?v=4
url: https://github.com/Trivie
-- - login: birkjernstrom
+- - login: americanair
+ avatarUrl: https://avatars.githubusercontent.com/u/12281813?v=4
+ url: https://github.com/americanair
+ - login: CanoaPBC
+ avatarUrl: https://avatars.githubusercontent.com/u/64223768?v=4
+ url: https://github.com/CanoaPBC
+ - login: mainframeindustries
+ avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4
+ url: https://github.com/mainframeindustries
+ - login: AccentDesign
+ avatarUrl: https://avatars.githubusercontent.com/u/2429332?v=4
+ url: https://github.com/AccentDesign
+ - login: mangualero
+ avatarUrl: https://avatars.githubusercontent.com/u/3422968?u=c59272d7b5a912d6126fd6c6f17db71e20f506eb&v=4
+ url: https://github.com/mangualero
+ - login: birkjernstrom
avatarUrl: https://avatars.githubusercontent.com/u/281715?u=4be14b43f76b4bd497b1941309bb390250b405e6&v=4
url: https://github.com/birkjernstrom
- login: yasyf
avatarUrl: https://avatars.githubusercontent.com/u/709645?u=f36736b3c6a85f578886ecc42a740e7b436e7a01&v=4
url: https://github.com/yasyf
- - login: AccentDesign
- avatarUrl: https://avatars.githubusercontent.com/u/2429332?v=4
- url: https://github.com/AccentDesign
- - login: americanair
- avatarUrl: https://avatars.githubusercontent.com/u/12281813?v=4
- url: https://github.com/americanair
- - login: mainframeindustries
- avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4
- url: https://github.com/mainframeindustries
- - login: doseiai
- avatarUrl: https://avatars.githubusercontent.com/u/57115726?v=4
- url: https://github.com/doseiai
- - login: CanoaPBC
- avatarUrl: https://avatars.githubusercontent.com/u/64223768?v=4
- url: https://github.com/CanoaPBC
-- - login: povilasb
- avatarUrl: https://avatars.githubusercontent.com/u/1213442?u=b11f58ed6ceea6e8297c9b310030478ebdac894d&v=4
- url: https://github.com/povilasb
- - login: primer-io
+- - login: primer-io
avatarUrl: https://avatars.githubusercontent.com/u/62146168?v=4
url: https://github.com/primer-io
+ - login: povilasb
+ avatarUrl: https://avatars.githubusercontent.com/u/1213442?u=b11f58ed6ceea6e8297c9b310030478ebdac894d&v=4
+ url: https://github.com/povilasb
- - login: upciti
avatarUrl: https://avatars.githubusercontent.com/u/43346262?v=4
url: https://github.com/upciti
-- - login: Kludex
- avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
- url: https://github.com/Kludex
- - login: samuelcolvin
+- - login: samuelcolvin
avatarUrl: https://avatars.githubusercontent.com/u/4039449?u=42eb3b833047c8c4b4f647a031eaef148c16d93f&v=4
url: https://github.com/samuelcolvin
+ - login: Kludex
+ avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
+ url: https://github.com/Kludex
- login: koconder
avatarUrl: https://avatars.githubusercontent.com/u/25068?u=582657b23622aaa3dfe68bd028a780f272f456fa&v=4
url: https://github.com/koconder
- - login: jefftriplett
- avatarUrl: https://avatars.githubusercontent.com/u/50527?u=af1ddfd50f6afd6d99f333ba2ac8d0a5b245ea74&v=4
- url: https://github.com/jefftriplett
+ - login: b-rad-c
+ avatarUrl: https://avatars.githubusercontent.com/u/25362581?u=5bb10629f4015b62bec1f9a366675d5085551af9&v=4
+ url: https://github.com/b-rad-c
+ - login: ehaca
+ avatarUrl: https://avatars.githubusercontent.com/u/25950317?u=cec1a3e0643b785288ae8260cc295a85ab344995&v=4
+ url: https://github.com/ehaca
+ - login: timlrx
+ avatarUrl: https://avatars.githubusercontent.com/u/28362229?u=9a745ca31372ee324af682715ae88ce8522f9094&v=4
+ url: https://github.com/timlrx
+ - login: Leay15
+ avatarUrl: https://avatars.githubusercontent.com/u/32212558?u=c4aa9c1737e515959382a5515381757b1fd86c53&v=4
+ url: https://github.com/Leay15
+ - login: ygorpontelo
+ avatarUrl: https://avatars.githubusercontent.com/u/32963605?u=35f7103f9c4c4c2589ae5737ee882e9375ef072e&v=4
+ url: https://github.com/ygorpontelo
+ - login: ProteinQure
+ avatarUrl: https://avatars.githubusercontent.com/u/33707203?v=4
+ url: https://github.com/ProteinQure
+ - login: jsoques
+ avatarUrl: https://avatars.githubusercontent.com/u/12414216?u=620921d94196546cc8b9eae2cc4cbc3f95bab42f&v=4
+ url: https://github.com/jsoques
+ - login: joeds13
+ avatarUrl: https://avatars.githubusercontent.com/u/13631604?u=628eb122e08bef43767b3738752b883e8e7f6259&v=4
+ url: https://github.com/joeds13
+ - login: dannywade
+ avatarUrl: https://avatars.githubusercontent.com/u/13680237?u=418ee985bd41577b20fde81417fb2d901e875e8a&v=4
+ url: https://github.com/dannywade
+ - login: khadrawy
+ avatarUrl: https://avatars.githubusercontent.com/u/13686061?u=59f25ef42ecf04c22657aac4238ce0e2d3d30304&v=4
+ url: https://github.com/khadrawy
+ - login: mjohnsey
+ avatarUrl: https://avatars.githubusercontent.com/u/16784016?u=38fad2e6b411244560b3af99c5f5a4751bc81865&v=4
+ url: https://github.com/mjohnsey
+ - login: ashi-agrawal
+ avatarUrl: https://avatars.githubusercontent.com/u/17105294?u=99c7a854035e5398d8e7b674f2d42baae6c957f8&v=4
+ url: https://github.com/ashi-agrawal
+ - login: sepsi77
+ avatarUrl: https://avatars.githubusercontent.com/u/18682303?v=4
+ url: https://github.com/sepsi77
+ - login: wedwardbeck
+ avatarUrl: https://avatars.githubusercontent.com/u/19333237?u=1de4ae2bf8d59eb4c013f21d863cbe0f2010575f&v=4
+ url: https://github.com/wedwardbeck
+ - login: RaamEEIL
+ avatarUrl: https://avatars.githubusercontent.com/u/20320552?v=4
+ url: https://github.com/RaamEEIL
+ - login: Filimoa
+ avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=0be845711495bbd7b756e13fcaeb8efc1ebd78ba&v=4
+ url: https://github.com/Filimoa
+ - login: prodhype
+ avatarUrl: https://avatars.githubusercontent.com/u/60444672?u=3f278cff25ea37ead487d7861d4a984795de819e&v=4
+ url: https://github.com/prodhype
+ - login: yakkonaut
+ avatarUrl: https://avatars.githubusercontent.com/u/60633704?u=90a71fd631aa998ba4a96480788f017c9904e07b&v=4
+ url: https://github.com/yakkonaut
+ - login: patsatsia
+ avatarUrl: https://avatars.githubusercontent.com/u/61111267?u=3271b85f7a37b479c8d0ae0a235182e83c166edf&v=4
+ url: https://github.com/patsatsia
+ - login: anthonycepeda
+ avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=60bdf46240cff8fca482ff0fc07d963fd5e1a27c&v=4
+ url: https://github.com/anthonycepeda
+ - login: patricioperezv
+ avatarUrl: https://avatars.githubusercontent.com/u/73832292?u=5f471f156e19ee7920e62ae0f4a47b95580e61cf&v=4
+ url: https://github.com/patricioperezv
+ - login: kaoru0310
+ avatarUrl: https://avatars.githubusercontent.com/u/80977929?u=1b61d10142b490e56af932ddf08a390fae8ee94f&v=4
+ url: https://github.com/kaoru0310
+ - login: DelfinaCare
+ avatarUrl: https://avatars.githubusercontent.com/u/83734439?v=4
+ url: https://github.com/DelfinaCare
+ - login: apitally
+ avatarUrl: https://avatars.githubusercontent.com/u/138365043?v=4
+ url: https://github.com/apitally
+ - login: logic-automation
+ avatarUrl: https://avatars.githubusercontent.com/u/144732884?v=4
+ url: https://github.com/logic-automation
+ - login: thenickben
+ avatarUrl: https://avatars.githubusercontent.com/u/40610922?u=1e907d904041b7c91213951a3cb344cd37c14aaf&v=4
+ url: https://github.com/thenickben
+ - login: ddilidili
+ avatarUrl: https://avatars.githubusercontent.com/u/42176885?u=c0a849dde06987434653197b5f638d3deb55fc6c&v=4
+ url: https://github.com/ddilidili
+ - login: ramonalmeidam
+ avatarUrl: https://avatars.githubusercontent.com/u/45269580?u=3358750b3a5854d7c3ed77aaca7dd20a0f529d32&v=4
+ url: https://github.com/ramonalmeidam
+ - login: dudikbender
+ avatarUrl: https://avatars.githubusercontent.com/u/53487583?u=3a57542938ebfd57579a0111db2b297e606d9681&v=4
+ url: https://github.com/dudikbender
+ - login: tcsmith
+ avatarUrl: https://avatars.githubusercontent.com/u/989034?u=7d8d741552b3279e8f4d3878679823a705a46f8f&v=4
+ url: https://github.com/tcsmith
+ - login: mickaelandrieu
+ avatarUrl: https://avatars.githubusercontent.com/u/1247388?u=599f6e73e452a9453f2bd91e5c3100750e731ad4&v=4
+ url: https://github.com/mickaelandrieu
+ - login: dodo5522
+ avatarUrl: https://avatars.githubusercontent.com/u/1362607?u=9bf1e0e520cccc547c046610c468ce6115bbcf9f&v=4
+ url: https://github.com/dodo5522
+ - login: nihpo
+ avatarUrl: https://avatars.githubusercontent.com/u/1841030?u=0264956d7580f7e46687a762a7baa629f84cf97c&v=4
+ url: https://github.com/nihpo
+ - login: knallgelb
+ avatarUrl: https://avatars.githubusercontent.com/u/2358812?u=c48cb6362b309d74cbf144bd6ad3aed3eb443e82&v=4
+ url: https://github.com/knallgelb
+ - login: johannquerne
+ avatarUrl: https://avatars.githubusercontent.com/u/2736484?u=9b3381546a25679913a2b08110e4373c98840821&v=4
+ url: https://github.com/johannquerne
+ - login: Shark009
+ avatarUrl: https://avatars.githubusercontent.com/u/3163309?u=0c6f4091b0eda05c44c390466199826e6dc6e431&v=4
+ url: https://github.com/Shark009
+ - login: dblackrun
+ avatarUrl: https://avatars.githubusercontent.com/u/3528486?v=4
+ url: https://github.com/dblackrun
- login: jstanden
avatarUrl: https://avatars.githubusercontent.com/u/63288?u=c3658d57d2862c607a0e19c2101c3c51876e36ad&v=4
url: https://github.com/jstanden
@@ -134,24 +236,21 @@ sponsors:
- login: mintuhouse
avatarUrl: https://avatars.githubusercontent.com/u/769950?u=ecfbd79a97d33177e0d093ddb088283cf7fe8444&v=4
url: https://github.com/mintuhouse
- - login: tcsmith
- avatarUrl: https://avatars.githubusercontent.com/u/989034?u=7d8d741552b3279e8f4d3878679823a705a46f8f&v=4
- url: https://github.com/tcsmith
- - login: mickaelandrieu
- avatarUrl: https://avatars.githubusercontent.com/u/1247388?u=599f6e73e452a9453f2bd91e5c3100750e731ad4&v=4
- url: https://github.com/mickaelandrieu
- - login: knallgelb
- avatarUrl: https://avatars.githubusercontent.com/u/2358812?u=c48cb6362b309d74cbf144bd6ad3aed3eb443e82&v=4
- url: https://github.com/knallgelb
- - login: johannquerne
- avatarUrl: https://avatars.githubusercontent.com/u/2736484?u=9b3381546a25679913a2b08110e4373c98840821&v=4
- url: https://github.com/johannquerne
- - login: Shark009
- avatarUrl: https://avatars.githubusercontent.com/u/3163309?u=0c6f4091b0eda05c44c390466199826e6dc6e431&v=4
- url: https://github.com/Shark009
- - login: dblackrun
- avatarUrl: https://avatars.githubusercontent.com/u/3528486?v=4
- url: https://github.com/dblackrun
+ - login: Rehket
+ avatarUrl: https://avatars.githubusercontent.com/u/7015688?u=3afb0ba200feebbc7f958950e92db34df2a3c172&v=4
+ url: https://github.com/Rehket
+ - login: hiancdtrsnm
+ avatarUrl: https://avatars.githubusercontent.com/u/7343177?v=4
+ url: https://github.com/hiancdtrsnm
+ - login: TrevorBenson
+ avatarUrl: https://avatars.githubusercontent.com/u/9167887?u=afdd1766fdb79e04e59094cc6a54cd011ee7f686&v=4
+ url: https://github.com/TrevorBenson
+ - login: wdwinslow
+ avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=dc01daafb354135603a263729e3d26d939c0c452&v=4
+ url: https://github.com/wdwinslow
+ - login: catherinenelson1
+ avatarUrl: https://avatars.githubusercontent.com/u/11951946?u=e714b957185b8cf3d301cced7fc3ad2842122c6a&v=4
+ url: https://github.com/catherinenelson1
- login: zsinx6
avatarUrl: https://avatars.githubusercontent.com/u/3532625?u=ba75a5dc744d1116ccfeaaf30d41cb2fe81fe8dd&v=4
url: https://github.com/zsinx6
@@ -177,131 +276,128 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/5300907?u=5b5452725ddb391b2caaebf34e05aba873591c3a&v=4
url: https://github.com/ennui93
- login: ternaus
- avatarUrl: https://avatars.githubusercontent.com/u/5481618?u=fabc8d75c921b3380126adb5a931c5da6e7db04f&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/5481618?u=513a26b02a39e7a28d587cd37c6cc877ea368e6e&v=4
url: https://github.com/ternaus
- login: eseglem
avatarUrl: https://avatars.githubusercontent.com/u/5920492?u=208d419cf667b8ac594c82a8db01932c7e50d057&v=4
url: https://github.com/eseglem
- - login: Yaleesa
- avatarUrl: https://avatars.githubusercontent.com/u/6135475?v=4
- url: https://github.com/Yaleesa
- - login: iwpnd
- avatarUrl: https://avatars.githubusercontent.com/u/6152183?u=c485eefca5c6329600cae63dd35e4f5682ce6924&v=4
- url: https://github.com/iwpnd
- login: FernandoCelmer
avatarUrl: https://avatars.githubusercontent.com/u/6262214?u=d29fff3fd862fda4ca752079f13f32e84c762ea4&v=4
url: https://github.com/FernandoCelmer
- login: simw
avatarUrl: https://avatars.githubusercontent.com/u/6322526?v=4
url: https://github.com/simw
- - login: Rehket
- avatarUrl: https://avatars.githubusercontent.com/u/7015688?u=3afb0ba200feebbc7f958950e92db34df2a3c172&v=4
- url: https://github.com/Rehket
- - login: hiancdtrsnm
- avatarUrl: https://avatars.githubusercontent.com/u/7343177?v=4
- url: https://github.com/hiancdtrsnm
- - login: wdwinslow
- avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=dc01daafb354135603a263729e3d26d939c0c452&v=4
- url: https://github.com/wdwinslow
- - login: drcat101
- avatarUrl: https://avatars.githubusercontent.com/u/11951946?u=e714b957185b8cf3d301cced7fc3ad2842122c6a&v=4
- url: https://github.com/drcat101
- - login: jsoques
- avatarUrl: https://avatars.githubusercontent.com/u/12414216?u=620921d94196546cc8b9eae2cc4cbc3f95bab42f&v=4
- url: https://github.com/jsoques
- - login: joeds13
- avatarUrl: https://avatars.githubusercontent.com/u/13631604?u=628eb122e08bef43767b3738752b883e8e7f6259&v=4
- url: https://github.com/joeds13
- - login: dannywade
- avatarUrl: https://avatars.githubusercontent.com/u/13680237?u=418ee985bd41577b20fde81417fb2d901e875e8a&v=4
- url: https://github.com/dannywade
- - login: khadrawy
- avatarUrl: https://avatars.githubusercontent.com/u/13686061?u=59f25ef42ecf04c22657aac4238ce0e2d3d30304&v=4
- url: https://github.com/khadrawy
- - login: mjohnsey
- avatarUrl: https://avatars.githubusercontent.com/u/16784016?u=38fad2e6b411244560b3af99c5f5a4751bc81865&v=4
- url: https://github.com/mjohnsey
- - login: wedwardbeck
- avatarUrl: https://avatars.githubusercontent.com/u/19333237?u=1de4ae2bf8d59eb4c013f21d863cbe0f2010575f&v=4
- url: https://github.com/wedwardbeck
- - login: RaamEEIL
- avatarUrl: https://avatars.githubusercontent.com/u/20320552?v=4
- url: https://github.com/RaamEEIL
- - login: Filimoa
- avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=0be845711495bbd7b756e13fcaeb8efc1ebd78ba&v=4
- url: https://github.com/Filimoa
- - login: ehaca
- avatarUrl: https://avatars.githubusercontent.com/u/25950317?u=cec1a3e0643b785288ae8260cc295a85ab344995&v=4
- url: https://github.com/ehaca
- - login: timlrx
- avatarUrl: https://avatars.githubusercontent.com/u/28362229?u=9a745ca31372ee324af682715ae88ce8522f9094&v=4
- url: https://github.com/timlrx
- - login: BrettskiPy
- avatarUrl: https://avatars.githubusercontent.com/u/30988215?u=d8a94a67e140d5ee5427724b292cc52d8827087a&v=4
- url: https://github.com/BrettskiPy
- - login: Leay15
- avatarUrl: https://avatars.githubusercontent.com/u/32212558?u=c4aa9c1737e515959382a5515381757b1fd86c53&v=4
- url: https://github.com/Leay15
- - login: ygorpontelo
- avatarUrl: https://avatars.githubusercontent.com/u/32963605?u=35f7103f9c4c4c2589ae5737ee882e9375ef072e&v=4
- url: https://github.com/ygorpontelo
- - login: ProteinQure
- avatarUrl: https://avatars.githubusercontent.com/u/33707203?v=4
- url: https://github.com/ProteinQure
- - login: RafaelWO
- avatarUrl: https://avatars.githubusercontent.com/u/38643099?u=56c676f024667ee416dc8b1cdf0c2611b9dc994f&v=4
- url: https://github.com/RafaelWO
- - login: arleybri18
- avatarUrl: https://avatars.githubusercontent.com/u/39681546?u=5c028f81324b0e8c73b3c15bc4e7b0218d2ba0c3&v=4
- url: https://github.com/arleybri18
- - login: thenickben
- avatarUrl: https://avatars.githubusercontent.com/u/40610922?u=1e907d904041b7c91213951a3cb344cd37c14aaf&v=4
- url: https://github.com/thenickben
- - login: ddilidili
- avatarUrl: https://avatars.githubusercontent.com/u/42176885?u=c0a849dde06987434653197b5f638d3deb55fc6c&v=4
- url: https://github.com/ddilidili
- - login: ramonalmeidam
- avatarUrl: https://avatars.githubusercontent.com/u/45269580?u=3358750b3a5854d7c3ed77aaca7dd20a0f529d32&v=4
- url: https://github.com/ramonalmeidam
- - login: dudikbender
- avatarUrl: https://avatars.githubusercontent.com/u/53487583?u=3a57542938ebfd57579a0111db2b297e606d9681&v=4
- url: https://github.com/dudikbender
- - login: Amirshox
- avatarUrl: https://avatars.githubusercontent.com/u/56707784?u=2a2f8cc243d6f5b29cd63fd2772f7a97aadc6c6b&v=4
- url: https://github.com/Amirshox
- - login: prodhype
- avatarUrl: https://avatars.githubusercontent.com/u/60444672?u=3f278cff25ea37ead487d7861d4a984795de819e&v=4
- url: https://github.com/prodhype
- - login: yakkonaut
- avatarUrl: https://avatars.githubusercontent.com/u/60633704?u=90a71fd631aa998ba4a96480788f017c9904e07b&v=4
- url: https://github.com/yakkonaut
- - login: patsatsia
- avatarUrl: https://avatars.githubusercontent.com/u/61111267?u=3271b85f7a37b479c8d0ae0a235182e83c166edf&v=4
- url: https://github.com/patsatsia
- - login: anthonycepeda
- avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=4252c6b6dc5024af502a823a3ac5e7a03a69963f&v=4
- url: https://github.com/anthonycepeda
- - login: patricioperezv
- avatarUrl: https://avatars.githubusercontent.com/u/73832292?u=5f471f156e19ee7920e62ae0f4a47b95580e61cf&v=4
- url: https://github.com/patricioperezv
- - login: kaoru0310
- avatarUrl: https://avatars.githubusercontent.com/u/80977929?u=1b61d10142b490e56af932ddf08a390fae8ee94f&v=4
- url: https://github.com/kaoru0310
- - login: DelfinaCare
- avatarUrl: https://avatars.githubusercontent.com/u/83734439?v=4
- url: https://github.com/DelfinaCare
- - login: osawa-koki
- avatarUrl: https://avatars.githubusercontent.com/u/94336223?u=59c6fe6945bcbbaff87b2a794238671b060620d2&v=4
- url: https://github.com/osawa-koki
- - login: apitally
- avatarUrl: https://avatars.githubusercontent.com/u/138365043?v=4
- url: https://github.com/apitally
- - login: getsentry
avatarUrl: https://avatars.githubusercontent.com/u/1396951?v=4
url: https://github.com/getsentry
- - login: pawamoy
avatarUrl: https://avatars.githubusercontent.com/u/3999221?u=b030e4c89df2f3a36bc4710b925bdeb6745c9856&v=4
url: https://github.com/pawamoy
+ - login: nisutec
+ avatarUrl: https://avatars.githubusercontent.com/u/25281462?u=e562484c451fdfc59053163f64405f8eb262b8b0&v=4
+ url: https://github.com/nisutec
+ - login: hoenie-ams
+ avatarUrl: https://avatars.githubusercontent.com/u/25708487?u=cda07434f0509ac728d9edf5e681117c0f6b818b&v=4
+ url: https://github.com/hoenie-ams
+ - login: joerambo
+ avatarUrl: https://avatars.githubusercontent.com/u/26282974?v=4
+ url: https://github.com/joerambo
+ - login: rlnchow
+ avatarUrl: https://avatars.githubusercontent.com/u/28018479?u=a93ca9cf1422b9ece155784a72d5f2fdbce7adff&v=4
+ url: https://github.com/rlnchow
+ - login: dvlpjrs
+ avatarUrl: https://avatars.githubusercontent.com/u/32254642?u=fbd6ad0324d4f1eb6231cf775be1c7bd4404e961&v=4
+ url: https://github.com/dvlpjrs
+ - login: engineerjoe440
+ avatarUrl: https://avatars.githubusercontent.com/u/33275230?u=eb223cad27017bb1e936ee9b429b450d092d0236&v=4
+ url: https://github.com/engineerjoe440
+ - login: bnkc
+ avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=fa1dc8db3e920cf5c5636b97180a6f811fa01aaf&v=4
+ url: https://github.com/bnkc
+ - login: petercool
+ avatarUrl: https://avatars.githubusercontent.com/u/37613029?u=81c525232bb35780945a68e88afd96bb2cdad9c4&v=4
+ url: https://github.com/petercool
+ - login: JimFawkes
+ avatarUrl: https://avatars.githubusercontent.com/u/12075115?u=dc58ecfd064d72887c34bf500ddfd52592509acd&v=4
+ url: https://github.com/JimFawkes
+ - login: artempronevskiy
+ avatarUrl: https://avatars.githubusercontent.com/u/12235104?u=03df6e1e55c9c6fe5d230adabb8dd7d43d8bbe8f&v=4
+ url: https://github.com/artempronevskiy
+ - login: TheR1D
+ avatarUrl: https://avatars.githubusercontent.com/u/16740832?u=b0dfdbdb27b79729430c71c6128962f77b7b53f7&v=4
+ url: https://github.com/TheR1D
+ - login: joshuatz
+ avatarUrl: https://avatars.githubusercontent.com/u/17817563?u=f1bf05b690d1fc164218f0b420cdd3acb7913e21&v=4
+ url: https://github.com/joshuatz
+ - login: jangia
+ avatarUrl: https://avatars.githubusercontent.com/u/17927101?u=9261b9bb0c3e3bb1ecba43e8915dc58d8c9a077e&v=4
+ url: https://github.com/jangia
+ - login: shuheng-liu
+ avatarUrl: https://avatars.githubusercontent.com/u/22414322?u=813c45f30786c6b511b21a661def025d8f7b609e&v=4
+ url: https://github.com/shuheng-liu
+ - login: pers0n4
+ avatarUrl: https://avatars.githubusercontent.com/u/24864600?u=f211a13a7b572cbbd7779b9c8d8cb428cc7ba07e&v=4
+ url: https://github.com/pers0n4
+ - login: SebTota
+ avatarUrl: https://avatars.githubusercontent.com/u/25122511?v=4
+ url: https://github.com/SebTota
+ - login: fernandosmither
+ avatarUrl: https://avatars.githubusercontent.com/u/66154723?u=a76a037b5d674938a75d2cff862fb6dfd63ec214&v=4
+ url: https://github.com/fernandosmither
+ - login: romabozhanovgithub
+ avatarUrl: https://avatars.githubusercontent.com/u/67696229?u=e4b921eef096415300425aca249348f8abb78ad7&v=4
+ url: https://github.com/romabozhanovgithub
+ - login: PelicanQ
+ avatarUrl: https://avatars.githubusercontent.com/u/77930606?v=4
+ url: https://github.com/PelicanQ
+ - login: jugeeem
+ avatarUrl: https://avatars.githubusercontent.com/u/116043716?u=ae590d79c38ac79c91b9c5caa6887d061e865a3d&v=4
+ url: https://github.com/jugeeem
+ - login: tahmarrrr23
+ avatarUrl: https://avatars.githubusercontent.com/u/138208610?u=465a46b0ff72a74252d3e3a71ac7d2f1919cda28&v=4
+ url: https://github.com/tahmarrrr23
+ - login: curegit
+ avatarUrl: https://avatars.githubusercontent.com/u/37978051?u=1733c322079118c0cdc573c03d92813f50a9faec&v=4
+ url: https://github.com/curegit
+ - login: kristiangronberg
+ avatarUrl: https://avatars.githubusercontent.com/u/42678548?v=4
+ url: https://github.com/kristiangronberg
+ - login: leonardo-holguin
+ avatarUrl: https://avatars.githubusercontent.com/u/43093055?u=b59013d52fb6c4e0954aaaabc0882bd844985b38&v=4
+ url: https://github.com/leonardo-holguin
+ - login: arrrrrmin
+ avatarUrl: https://avatars.githubusercontent.com/u/43553423?u=36a3880a6eb29309c19e6cadbb173bafbe91deb1&v=4
+ url: https://github.com/arrrrrmin
+ - login: mobyw
+ avatarUrl: https://avatars.githubusercontent.com/u/44370805?v=4
+ url: https://github.com/mobyw
+ - login: ArtyomVancyan
+ avatarUrl: https://avatars.githubusercontent.com/u/44609997?v=4
+ url: https://github.com/ArtyomVancyan
+ - login: hgalytoby
+ avatarUrl: https://avatars.githubusercontent.com/u/50397689?u=f4888c2c54929bd86eed0d3971d09fcb306e5088&v=4
+ url: https://github.com/hgalytoby
+ - login: conservative-dude
+ avatarUrl: https://avatars.githubusercontent.com/u/55538308?u=f250c44942ea6e73a6bd90739b381c470c192c11&v=4
+ url: https://github.com/conservative-dude
+ - login: miguelgr
+ avatarUrl: https://avatars.githubusercontent.com/u/1484589?u=54556072b8136efa12ae3b6902032ea2a39ace4b&v=4
+ url: https://github.com/miguelgr
+ - login: WillHogan
+ avatarUrl: https://avatars.githubusercontent.com/u/1661551?u=7036c064cf29781470573865264ec8e60b6b809f&v=4
+ url: https://github.com/WillHogan
+ - login: my3
+ avatarUrl: https://avatars.githubusercontent.com/u/1825270?v=4
+ url: https://github.com/my3
+ - login: leobiscassi
+ avatarUrl: https://avatars.githubusercontent.com/u/1977418?u=f9f82445a847ab479bd7223debd677fcac6c49a0&v=4
+ url: https://github.com/leobiscassi
+ - login: cbonoz
+ avatarUrl: https://avatars.githubusercontent.com/u/2351087?u=fd3e8030b2cc9fbfbb54a65e9890c548a016f58b&v=4
+ url: https://github.com/cbonoz
+ - login: anthonycorletti
+ avatarUrl: https://avatars.githubusercontent.com/u/3477132?u=dfe51d2080fbd3fee81e05911cd8d50da9dcc709&v=4
+ url: https://github.com/anthonycorletti
- login: ddanier
avatarUrl: https://avatars.githubusercontent.com/u/113563?u=ed1dc79de72f93bd78581f88ebc6952b62f472da&v=4
url: https://github.com/ddanier
@@ -323,57 +419,12 @@ sponsors:
- login: securancy
avatarUrl: https://avatars.githubusercontent.com/u/606673?v=4
url: https://github.com/securancy
- - login: natehouk
- avatarUrl: https://avatars.githubusercontent.com/u/805439?u=d8e4be629dc5d7efae7146157e41ee0bd129d9bc&v=4
- url: https://github.com/natehouk
+ - login: tochikuji
+ avatarUrl: https://avatars.githubusercontent.com/u/851759?v=4
+ url: https://github.com/tochikuji
- login: browniebroke
avatarUrl: https://avatars.githubusercontent.com/u/861044?u=5abfca5588f3e906b31583d7ee62f6de4b68aa24&v=4
url: https://github.com/browniebroke
- - login: dodo5522
- avatarUrl: https://avatars.githubusercontent.com/u/1362607?u=9bf1e0e520cccc547c046610c468ce6115bbcf9f&v=4
- url: https://github.com/dodo5522
- - login: miguelgr
- avatarUrl: https://avatars.githubusercontent.com/u/1484589?u=54556072b8136efa12ae3b6902032ea2a39ace4b&v=4
- url: https://github.com/miguelgr
- - login: WillHogan
- avatarUrl: https://avatars.githubusercontent.com/u/1661551?u=7036c064cf29781470573865264ec8e60b6b809f&v=4
- url: https://github.com/WillHogan
- - login: my3
- avatarUrl: https://avatars.githubusercontent.com/u/1825270?v=4
- url: https://github.com/my3
- - login: leobiscassi
- avatarUrl: https://avatars.githubusercontent.com/u/1977418?u=f9f82445a847ab479bd7223debd677fcac6c49a0&v=4
- url: https://github.com/leobiscassi
- - login: cbonoz
- avatarUrl: https://avatars.githubusercontent.com/u/2351087?u=fd3e8030b2cc9fbfbb54a65e9890c548a016f58b&v=4
- url: https://github.com/cbonoz
- - login: anthonycorletti
- avatarUrl: https://avatars.githubusercontent.com/u/3477132?v=4
- url: https://github.com/anthonycorletti
- - login: Alisa-lisa
- avatarUrl: https://avatars.githubusercontent.com/u/4137964?u=e7e393504f554f4ff15863a1e01a5746863ef9ce&v=4
- url: https://github.com/Alisa-lisa
- - login: gowikel
- avatarUrl: https://avatars.githubusercontent.com/u/4339072?u=0e325ffcc539c38f89d9aa876bd87f9ec06ce0ee&v=4
- url: https://github.com/gowikel
- - login: danielunderwood
- avatarUrl: https://avatars.githubusercontent.com/u/4472301?v=4
- url: https://github.com/danielunderwood
- - login: yuawn
- avatarUrl: https://avatars.githubusercontent.com/u/5111198?u=5315576f3fe1a70fd2d0f02181588f4eea5d353d&v=4
- url: https://github.com/yuawn
- - login: sdevkota
- avatarUrl: https://avatars.githubusercontent.com/u/5250987?u=4ed9a120c89805a8aefda1cbdc0cf6512e64d1b4&v=4
- url: https://github.com/sdevkota
- - login: unredundant
- avatarUrl: https://avatars.githubusercontent.com/u/5607577?u=1ffbf39f5bb8736b75c0d235707d6e8f803725c5&v=4
- url: https://github.com/unredundant
- - login: Baghdady92
- avatarUrl: https://avatars.githubusercontent.com/u/5708590?v=4
- url: https://github.com/Baghdady92
- - login: jakeecolution
- avatarUrl: https://avatars.githubusercontent.com/u/5884696?u=4a7c7883fb064b593b50cb6697b54687e6f7aafe&v=4
- url: https://github.com/jakeecolution
- login: KentShikama
avatarUrl: https://avatars.githubusercontent.com/u/6329898?u=8b236810db9b96333230430837e1f021f9246da1&v=4
url: https://github.com/KentShikama
@@ -389,9 +440,9 @@ sponsors:
- login: moonape1226
avatarUrl: https://avatars.githubusercontent.com/u/8532038?u=d9f8b855a429fff9397c3833c2ff83849ebf989d&v=4
url: https://github.com/moonape1226
- - login: albertkun
- avatarUrl: https://avatars.githubusercontent.com/u/8574425?u=aad2a9674273c9275fe414d99269b7418d144089&v=4
- url: https://github.com/albertkun
+ - login: msehnout
+ avatarUrl: https://avatars.githubusercontent.com/u/9369632?u=8c988f1b008a3f601385a3616f9327820f66e3a5&v=4
+ url: https://github.com/msehnout
- login: xncbf
avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=ee91e210ae93b9cdd8f248b21cb028316cc0b747&v=4
url: https://github.com/xncbf
@@ -416,123 +467,51 @@ sponsors:
- login: dzoladz
avatarUrl: https://avatars.githubusercontent.com/u/10561752?u=5ee314d54aa79592c18566827ad8914debd5630d&v=4
url: https://github.com/dzoladz
- - login: JimFawkes
- avatarUrl: https://avatars.githubusercontent.com/u/12075115?u=dc58ecfd064d72887c34bf500ddfd52592509acd&v=4
- url: https://github.com/JimFawkes
- - login: artempronevskiy
- avatarUrl: https://avatars.githubusercontent.com/u/12235104?u=03df6e1e55c9c6fe5d230adabb8dd7d43d8bbe8f&v=4
- url: https://github.com/artempronevskiy
- - login: giuliano-oliveira
- avatarUrl: https://avatars.githubusercontent.com/u/13181797?u=0ef2dfbf7fc9a9726d45c21d32b5d1038a174870&v=4
- url: https://github.com/giuliano-oliveira
- - login: TheR1D
- avatarUrl: https://avatars.githubusercontent.com/u/16740832?u=b0dfdbdb27b79729430c71c6128962f77b7b53f7&v=4
- url: https://github.com/TheR1D
- - login: joshuatz
- avatarUrl: https://avatars.githubusercontent.com/u/17817563?u=f1bf05b690d1fc164218f0b420cdd3acb7913e21&v=4
- url: https://github.com/joshuatz
- - login: jangia
- avatarUrl: https://avatars.githubusercontent.com/u/17927101?u=9261b9bb0c3e3bb1ecba43e8915dc58d8c9a077e&v=4
- url: https://github.com/jangia
- - login: shuheng-liu
- avatarUrl: https://avatars.githubusercontent.com/u/22414322?u=813c45f30786c6b511b21a661def025d8f7b609e&v=4
- url: https://github.com/shuheng-liu
- - login: salahelfarissi
- avatarUrl: https://avatars.githubusercontent.com/u/23387408?u=73222a4be627c1a3dee9736e0da22224eccdc8f6&v=4
- url: https://github.com/salahelfarissi
- - login: pers0n4
- avatarUrl: https://avatars.githubusercontent.com/u/24864600?u=f211a13a7b572cbbd7779b9c8d8cb428cc7ba07e&v=4
- url: https://github.com/pers0n4
- - login: kxzk
- avatarUrl: https://avatars.githubusercontent.com/u/25046261?u=e185e58080090f9e678192cd214a14b14a2b232b&v=4
- url: https://github.com/kxzk
- - login: SebTota
- avatarUrl: https://avatars.githubusercontent.com/u/25122511?v=4
- url: https://github.com/SebTota
- - login: nisutec
- avatarUrl: https://avatars.githubusercontent.com/u/25281462?u=e562484c451fdfc59053163f64405f8eb262b8b0&v=4
- url: https://github.com/nisutec
- - login: hoenie-ams
- avatarUrl: https://avatars.githubusercontent.com/u/25708487?u=cda07434f0509ac728d9edf5e681117c0f6b818b&v=4
- url: https://github.com/hoenie-ams
- - login: joerambo
- avatarUrl: https://avatars.githubusercontent.com/u/26282974?v=4
- url: https://github.com/joerambo
- - login: rlnchow
- avatarUrl: https://avatars.githubusercontent.com/u/28018479?u=a93ca9cf1422b9ece155784a72d5f2fdbce7adff&v=4
- url: https://github.com/rlnchow
- - login: White-Mask
- avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
- url: https://github.com/White-Mask
- - login: HosamAlmoghraby
- avatarUrl: https://avatars.githubusercontent.com/u/32025281?u=aa1b09feabccbf9dc506b81c71155f32d126cefa&v=4
- url: https://github.com/HosamAlmoghraby
- - login: engineerjoe440
- avatarUrl: https://avatars.githubusercontent.com/u/33275230?u=eb223cad27017bb1e936ee9b429b450d092d0236&v=4
- url: https://github.com/engineerjoe440
- - login: bnkc
- avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=fa1dc8db3e920cf5c5636b97180a6f811fa01aaf&v=4
- url: https://github.com/bnkc
- - login: declon
- avatarUrl: https://avatars.githubusercontent.com/u/36180226?v=4
- url: https://github.com/declon
- - login: curegit
- avatarUrl: https://avatars.githubusercontent.com/u/37978051?u=1733c322079118c0cdc573c03d92813f50a9faec&v=4
- url: https://github.com/curegit
- - login: kristiangronberg
- avatarUrl: https://avatars.githubusercontent.com/u/42678548?v=4
- url: https://github.com/kristiangronberg
- - login: arrrrrmin
- avatarUrl: https://avatars.githubusercontent.com/u/43553423?u=36a3880a6eb29309c19e6cadbb173bafbe91deb1&v=4
- url: https://github.com/arrrrrmin
- - login: ArtyomVancyan
- avatarUrl: https://avatars.githubusercontent.com/u/44609997?v=4
- url: https://github.com/ArtyomVancyan
- - login: hgalytoby
- avatarUrl: https://avatars.githubusercontent.com/u/50397689?u=f4888c2c54929bd86eed0d3971d09fcb306e5088&v=4
- url: https://github.com/hgalytoby
- - login: conservative-dude
- avatarUrl: https://avatars.githubusercontent.com/u/55538308?u=f250c44942ea6e73a6bd90739b381c470c192c11&v=4
- url: https://github.com/conservative-dude
- - login: Calesi19
- avatarUrl: https://avatars.githubusercontent.com/u/58052598?u=273d4fc364c004602c93dd6adeaf5cc915b93cd2&v=4
- url: https://github.com/Calesi19
- - login: 0417taehyun
- avatarUrl: https://avatars.githubusercontent.com/u/63915557?u=47debaa860fd52c9b98c97ef357ddcec3b3fb399&v=4
- url: https://github.com/0417taehyun
- - login: fernandosmither
- avatarUrl: https://avatars.githubusercontent.com/u/66154723?u=a76a037b5d674938a75d2cff862fb6dfd63ec214&v=4
- url: https://github.com/fernandosmither
- - login: romabozhanovgithub
- avatarUrl: https://avatars.githubusercontent.com/u/67696229?u=e4b921eef096415300425aca249348f8abb78ad7&v=4
- url: https://github.com/romabozhanovgithub
- - login: mbukeRepo
- avatarUrl: https://avatars.githubusercontent.com/u/70356088?u=d2eb23e2b222a3b316c4183b05a3236b32819dc2&v=4
- url: https://github.com/mbukeRepo
- - login: adriiamontoto
- avatarUrl: https://avatars.githubusercontent.com/u/75563346?u=eeb1350b82ecb4d96592f9b6cd1a16870c355e38&v=4
- url: https://github.com/adriiamontoto
- - login: PelicanQ
- avatarUrl: https://avatars.githubusercontent.com/u/77930606?v=4
- url: https://github.com/PelicanQ
- - login: tahmarrrr23
- avatarUrl: https://avatars.githubusercontent.com/u/138208610?u=465a46b0ff72a74252d3e3a71ac7d2f1919cda28&v=4
- url: https://github.com/tahmarrrr23
-- - login: ssbarnea
- avatarUrl: https://avatars.githubusercontent.com/u/102495?u=b4bf6818deefe59952ac22fec6ed8c76de1b8f7c&v=4
- url: https://github.com/ssbarnea
- - login: Patechoc
- avatarUrl: https://avatars.githubusercontent.com/u/2376641?u=23b49e9eda04f078cb74fa3f93593aa6a57bb138&v=4
- url: https://github.com/Patechoc
- - login: DazzyMlv
- avatarUrl: https://avatars.githubusercontent.com/u/23006212?u=df429da52882b0432e5ac81d4f1b489abc86433c&v=4
- url: https://github.com/DazzyMlv
- - login: sadikkuzu
- avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=d179c06bb9f65c4167fcab118526819f8e0dac17&v=4
- url: https://github.com/sadikkuzu
+ - login: Alisa-lisa
+ avatarUrl: https://avatars.githubusercontent.com/u/4137964?u=e7e393504f554f4ff15863a1e01a5746863ef9ce&v=4
+ url: https://github.com/Alisa-lisa
+ - login: danielunderwood
+ avatarUrl: https://avatars.githubusercontent.com/u/4472301?v=4
+ url: https://github.com/danielunderwood
+ - login: rangulvers
+ avatarUrl: https://avatars.githubusercontent.com/u/5235430?v=4
+ url: https://github.com/rangulvers
+ - login: sdevkota
+ avatarUrl: https://avatars.githubusercontent.com/u/5250987?u=4ed9a120c89805a8aefda1cbdc0cf6512e64d1b4&v=4
+ url: https://github.com/sdevkota
+ - login: brizzbuzz
+ avatarUrl: https://avatars.githubusercontent.com/u/5607577?u=58d5aae33bc97e52f11f334d2702e8710314b5c1&v=4
+ url: https://github.com/brizzbuzz
+ - login: Baghdady92
+ avatarUrl: https://avatars.githubusercontent.com/u/5708590?v=4
+ url: https://github.com/Baghdady92
+ - login: jakeecolution
+ avatarUrl: https://avatars.githubusercontent.com/u/5884696?u=4a7c7883fb064b593b50cb6697b54687e6f7aafe&v=4
+ url: https://github.com/jakeecolution
+- - login: abizovnuralem
+ avatarUrl: https://avatars.githubusercontent.com/u/33475993?u=6ce72b11a16a8232d3dd1f958f460b4735f520d8&v=4
+ url: https://github.com/abizovnuralem
- login: danburonline
avatarUrl: https://avatars.githubusercontent.com/u/34251194?u=94935cccfbec58083ab1e535212d54f1bf2c978a&v=4
url: https://github.com/danburonline
+ - login: sadikkuzu
+ avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=d179c06bb9f65c4167fcab118526819f8e0dac17&v=4
+ url: https://github.com/sadikkuzu
- login: rwxd
avatarUrl: https://avatars.githubusercontent.com/u/40308458?u=cd04a39e3655923be4f25c2ba8a5a07b3da3230a&v=4
url: https://github.com/rwxd
+ - login: YungBricoCoop
+ avatarUrl: https://avatars.githubusercontent.com/u/42273436?u=80470b400c416d1eabc2cc71b1efffc0e3503146&v=4
+ url: https://github.com/YungBricoCoop
+ - login: nlazaro
+ avatarUrl: https://avatars.githubusercontent.com/u/44237350?u=939a570fc965d93e9db1284b5acc173c1a0be4a0&v=4
+ url: https://github.com/nlazaro
+ - login: Patechoc
+ avatarUrl: https://avatars.githubusercontent.com/u/2376641?u=23b49e9eda04f078cb74fa3f93593aa6a57bb138&v=4
+ url: https://github.com/Patechoc
+ - login: ssbarnea
+ avatarUrl: https://avatars.githubusercontent.com/u/102495?u=c2efbf6fea2737e21dfc6b1113c4edc9644e9eaa&v=4
+ url: https://github.com/ssbarnea
+ - login: yuawn
+ avatarUrl: https://avatars.githubusercontent.com/u/5111198?u=5315576f3fe1a70fd2d0f02181588f4eea5d353d&v=4
+ url: https://github.com/yuawn
diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml
index 2877e7938..cc5479c82 100644
--- a/docs/en/data/people.yml
+++ b/docs/en/data/people.yml
@@ -1,30 +1,30 @@
maintainers:
- login: tiangolo
- answers: 1870
- prs: 523
+ answers: 1878
+ prs: 559
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=740f11212a731f56798f558ceddb0bd07642afa7&v=4
url: https://github.com/tiangolo
experts:
- login: Kludex
- count: 522
+ count: 598
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
- login: dmontagu
count: 241
avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
url: https://github.com/dmontagu
+- login: jgould22
+ count: 235
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
- login: Mause
count: 220
avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4
url: https://github.com/Mause
- login: ycd
count: 217
- avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=bba5af018423a2858d49309bed2a899bb5c34ac5&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=45aa6ef58220a3f1e8a3c3cd5f1b75a1a0a73347&v=4
url: https://github.com/ycd
-- login: jgould22
- count: 205
- avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
- url: https://github.com/jgould22
- login: JarroVGIT
count: 193
avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4
@@ -34,7 +34,7 @@ experts:
avatarUrl: https://avatars.githubusercontent.com/u/1104190?u=321a2e953e6645a7d09b732786c7a8061e0f8a8b&v=4
url: https://github.com/euri10
- login: iudeen
- count: 127
+ count: 128
avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
url: https://github.com/iudeen
- login: phy25
@@ -45,18 +45,26 @@ experts:
count: 83
avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4
url: https://github.com/raphaelauv
-- login: ArcLightSlavik
- count: 71
- avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=b0f2c37142f4b762e41ad65dc49581813422bd71&v=4
- url: https://github.com/ArcLightSlavik
- login: ghandic
count: 71
avatarUrl: https://avatars.githubusercontent.com/u/23500353?u=e2e1d736f924d9be81e8bfc565b6d8836ba99773&v=4
url: https://github.com/ghandic
+- login: ArcLightSlavik
+ count: 71
+ avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=b0f2c37142f4b762e41ad65dc49581813422bd71&v=4
+ url: https://github.com/ArcLightSlavik
- login: falkben
- count: 57
+ count: 59
avatarUrl: https://avatars.githubusercontent.com/u/653031?u=ad9838e089058c9e5a0bab94c0eec7cc181e0cd0&v=4
url: https://github.com/falkben
+- login: JavierSanchezCastro
+ count: 55
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
+- login: n8sty
+ count: 52
+ avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
+ url: https://github.com/n8sty
- login: sm-Fifteen
count: 49
avatarUrl: https://avatars.githubusercontent.com/u/516999?u=437c0c5038558c67e887ccd863c1ba0f846c03da&v=4
@@ -65,38 +73,38 @@ experts:
count: 48
avatarUrl: https://avatars.githubusercontent.com/u/37829370?u=da44ca53aefd5c23f346fab8e9fd2e108294c179&v=4
url: https://github.com/yinziyan1206
-- login: insomnes
- count: 45
- avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4
- url: https://github.com/insomnes
+- login: acidjunk
+ count: 47
+ avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
+ url: https://github.com/acidjunk
- login: adriangb
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
url: https://github.com/adriangb
-- login: acidjunk
+- login: insomnes
count: 45
- avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
- url: https://github.com/acidjunk
+ avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4
+ url: https://github.com/insomnes
- login: Dustyposa
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/27180793?u=5cf2877f50b3eb2bc55086089a78a36f07042889&v=4
url: https://github.com/Dustyposa
-- login: odiseo0
+- login: YuriiMotov
count: 43
- avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=241a71f6b7068738b81af3e57f45ffd723538401&v=4
- url: https://github.com/odiseo0
+ avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=e83a39697a2d33ab2ec9bfbced794ee48bc29cec&v=4
+ url: https://github.com/YuriiMotov
- login: frankie567
count: 43
avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=c159fe047727aedecbbeeaa96a1b03ceb9d39add&v=4
url: https://github.com/frankie567
+- login: odiseo0
+ count: 43
+ avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=241a71f6b7068738b81af3e57f45ffd723538401&v=4
+ url: https://github.com/odiseo0
- login: includeamin
count: 40
avatarUrl: https://avatars.githubusercontent.com/u/11836741?u=8bd5ef7e62fe6a82055e33c4c0e0a7879ff8cfb6&v=4
url: https://github.com/includeamin
-- login: n8sty
- count: 40
- avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
- url: https://github.com/n8sty
- login: chbndrhnns
count: 38
avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4
@@ -113,10 +121,6 @@ experts:
count: 32
avatarUrl: https://avatars.githubusercontent.com/u/41326348?u=ba2fda6b30110411ecbf406d187907e2b420ac19&v=4
url: https://github.com/panla
-- login: JavierSanchezCastro
- count: 30
- avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
- url: https://github.com/JavierSanchezCastro
- login: prostomarkeloff
count: 28
avatarUrl: https://avatars.githubusercontent.com/u/28061158?u=72309cc1f2e04e40fa38b29969cb4e9d3f722e7b&v=4
@@ -137,30 +141,34 @@ experts:
count: 23
avatarUrl: https://avatars.githubusercontent.com/u/9435877?u=719327b7d2c4c62212456d771bfa7c6b8dbb9eac&v=4
url: https://github.com/SirTelemak
+- login: chrisK824
+ count: 22
+ avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
+ url: https://github.com/chrisK824
+- login: nymous
+ count: 21
+ avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
+ url: https://github.com/nymous
- login: rafsaf
count: 21
avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=5fe59a56e1f2f9ccd8005d71752a8276f133ae1a&v=4
url: https://github.com/rafsaf
-- login: nymous
+- login: hasansezertasan
count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
- url: https://github.com/nymous
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
- login: nsidnev
count: 20
avatarUrl: https://avatars.githubusercontent.com/u/22559461?u=a9cc3238217e21dc8796a1a500f01b722adb082c&v=4
url: https://github.com/nsidnev
-- login: chris-allnutt
- count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4
- url: https://github.com/chris-allnutt
-- login: chrisK824
- count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
- url: https://github.com/chrisK824
- login: ebottos94
count: 20
avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
url: https://github.com/ebottos94
+- login: chris-allnutt
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4
+ url: https://github.com/chris-allnutt
- login: retnikt
count: 18
avatarUrl: https://avatars.githubusercontent.com/u/24581770?v=4
@@ -169,6 +177,10 @@ experts:
count: 18
avatarUrl: https://avatars.githubusercontent.com/u/22326718?u=31ba446ac290e23e56eea8e4f0c558aaf0b40779&v=4
url: https://github.com/zoliknemet
+- login: nkhitrov
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/28262306?u=66ee21316275ef356081c2efc4ed7a4572e690dc&v=4
+ url: https://github.com/nkhitrov
- login: Hultner
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4
@@ -177,64 +189,643 @@ experts:
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/1765494?u=5b1ab7c582db4b4016fa31affe977d10af108ad4&v=4
url: https://github.com/harunyasar
-- login: nkhitrov
- count: 17
- avatarUrl: https://avatars.githubusercontent.com/u/28262306?u=66ee21316275ef356081c2efc4ed7a4572e690dc&v=4
- url: https://github.com/nkhitrov
- login: caeser1996
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/16540232?u=05d2beb8e034d584d0a374b99d8826327bd7f614&v=4
url: https://github.com/caeser1996
-- login: dstlny
- count: 16
- avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=9f2174f9d61c15c6e3a4c9e3aeee66f711ce311f&v=4
- url: https://github.com/dstlny
- login: jonatasoli
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4
url: https://github.com/jonatasoli
-- login: ghost
- count: 15
- avatarUrl: https://avatars.githubusercontent.com/u/10137?u=b1951d34a583cf12ec0d3b0781ba19be97726318&v=4
- url: https://github.com/ghost
-last_month_active:
-- login: Ventura94
- count: 5
- avatarUrl: https://avatars.githubusercontent.com/u/43103937?u=ccb837005aaf212a449c374618c4339089e2f733&v=4
- url: https://github.com/Ventura94
+last_month_experts:
+- login: YuriiMotov
+ count: 40
+ avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=e83a39697a2d33ab2ec9bfbced794ee48bc29cec&v=4
+ url: https://github.com/YuriiMotov
- login: JavierSanchezCastro
- count: 4
+ count: 11
avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
url: https://github.com/JavierSanchezCastro
-- login: jgould22
- count: 3
- avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
- url: https://github.com/jgould22
- login: Kludex
- count: 3
+ count: 8
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
-- login: n8sty
+- login: jgould22
+ count: 7
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
+- login: omarcruzpantoja
count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/15116058?u=4b64c643fad49225d854e1aaecd1ffc6f9071a1b&v=4
+ url: https://github.com/omarcruzpantoja
+- login: pythonweb2
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/32141163?v=4
+ url: https://github.com/pythonweb2
+- login: PhysicallyActive
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/160476156?u=7a8e44f4a43d3bba636f795bb7d9476c9233b4d8&v=4
+ url: https://github.com/PhysicallyActive
+- login: VatsalJagani
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/20964366?u=43552644be05c9107c029e26d5ab3be5a1920f45&v=4
+ url: https://github.com/VatsalJagani
+- login: khaledadrani
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/45245894?u=49ed5056426a149a5af29d385d8bd3847101d3a4&v=4
+ url: https://github.com/khaledadrani
+- login: chrisK824
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
+ url: https://github.com/chrisK824
+- login: ThirVondukr
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/50728601?u=167c0bd655e52817082e50979a86d2f98f95b1a3&v=4
+ url: https://github.com/ThirVondukr
+- login: hussein-awala
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/21311487?u=cbbc60943d3fedfb869e49b604020a821f589659&v=4
+ url: https://github.com/hussein-awala
+three_months_experts:
+- login: Kludex
+ count: 84
+ avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
+ url: https://github.com/Kludex
+- login: YuriiMotov
+ count: 43
+ avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=e83a39697a2d33ab2ec9bfbced794ee48bc29cec&v=4
+ url: https://github.com/YuriiMotov
+- login: jgould22
+ count: 30
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
+- login: JavierSanchezCastro
+ count: 24
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
+- login: n8sty
+ count: 11
avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
url: https://github.com/n8sty
+- login: hasansezertasan
+ count: 8
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
+- login: dolfinus
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/4661021?u=a51b39001a2e5e7529b45826980becf786de2327&v=4
+ url: https://github.com/dolfinus
+- login: aanchlia
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/2835374?u=3c3ed29aa8b09ccaf8d66def0ce82bc2f7e5aab6&v=4
+ url: https://github.com/aanchlia
+- login: GodMoonGoodman
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/29688727?u=7b251da620d999644c37c1feeb292d033eed7ad6&v=4
+ url: https://github.com/GodMoonGoodman
+- login: flo-at
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/564288?v=4
+ url: https://github.com/flo-at
+- login: estebanx64
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/10840422?u=45f015f95e1c0f06df602be4ab688d4b854cc8a8&v=4
+ url: https://github.com/estebanx64
+- login: omarcruzpantoja
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/15116058?u=4b64c643fad49225d854e1aaecd1ffc6f9071a1b&v=4
+ url: https://github.com/omarcruzpantoja
+- login: fmelihh
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/99879453?u=f76c4460556e41a59eb624acd0cf6e342d660700&v=4
+ url: https://github.com/fmelihh
+- login: ahmedabdou14
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/104530599?u=05365b155a1ff911532e8be316acfad2e0736f98&v=4
+ url: https://github.com/ahmedabdou14
+- login: chrisK824
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
+ url: https://github.com/chrisK824
+- login: pythonweb2
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/32141163?v=4
+ url: https://github.com/pythonweb2
+- login: PhysicallyActive
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/160476156?u=7a8e44f4a43d3bba636f795bb7d9476c9233b4d8&v=4
+ url: https://github.com/PhysicallyActive
+- login: richin13
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/8370058?u=8e37a4cdbc78983a5f4b4847f6d1879fb39c851c&v=4
+ url: https://github.com/richin13
+- login: VatsalJagani
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/20964366?u=43552644be05c9107c029e26d5ab3be5a1920f45&v=4
+ url: https://github.com/VatsalJagani
+- login: khaledadrani
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/45245894?u=49ed5056426a149a5af29d385d8bd3847101d3a4&v=4
+ url: https://github.com/khaledadrani
+- login: acidjunk
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
+ url: https://github.com/acidjunk
+- login: agn-7
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/14202344?u=a1d05998ceaf4d06d1063575a7c4ef6e7ae5890e&v=4
+ url: https://github.com/agn-7
+- login: ThirVondukr
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/50728601?u=167c0bd655e52817082e50979a86d2f98f95b1a3&v=4
+ url: https://github.com/ThirVondukr
+- login: hussein-awala
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/21311487?u=cbbc60943d3fedfb869e49b604020a821f589659&v=4
+ url: https://github.com/hussein-awala
+- login: JoshYuJump
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/5901894?u=cdbca6296ac4cdcdf6945c112a1ce8d5342839ea&v=4
+ url: https://github.com/JoshYuJump
+- login: bhumkong
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/13270137?u=1490432e6a0184fbc3d5c8d1b5df553ca92e7e5b&v=4
+ url: https://github.com/bhumkong
+- login: falkben
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/653031?u=ad9838e089058c9e5a0bab94c0eec7cc181e0cd0&v=4
+ url: https://github.com/falkben
+- login: mielvds
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/1032980?u=722c96b0a234752df23f04df150ef36441ceb43c&v=4
+ url: https://github.com/mielvds
+- login: admo1
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/14835916?v=4
+ url: https://github.com/admo1
+- login: pbasista
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/1535892?u=e9a8bd5b3b2f95340cfeb4bc97886e9334911669&v=4
+ url: https://github.com/pbasista
+- login: bogdan-coman-uv
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/92912507?v=4
+ url: https://github.com/bogdan-coman-uv
+- login: leonidktoto
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/159561986?v=4
+ url: https://github.com/leonidktoto
+- login: DJoepie
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/78362619?u=fe6e8d05f94d8d4c0679a4da943955a686f96177&v=4
+ url: https://github.com/DJoepie
+- login: binbjz
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/8213913?u=22b68b7a0d5bf5e09c02084c0f5f53d7503114cd&v=4
+ url: https://github.com/binbjz
+- login: JonnyBootsNpants
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/155071540?u=2d3a72b74a2c4c8eaacdb625c7ac850369579352&v=4
+ url: https://github.com/JonnyBootsNpants
+- login: TarasKuzyo
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/7178184?v=4
+ url: https://github.com/TarasKuzyo
+- login: msehnout
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/9369632?u=8c988f1b008a3f601385a3616f9327820f66e3a5&v=4
+ url: https://github.com/msehnout
+- login: rafalkrupinski
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/3732079?u=929e95d40d524301cb481da05208a25ed059400d&v=4
+ url: https://github.com/rafalkrupinski
+- login: morian
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/1735308?u=8ef15491399b040bd95e2675bb8c8f2462e977b0&v=4
+ url: https://github.com/morian
+- login: garg10may
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/8787120?u=7028d2b3a2a26534c1806eb76c7425a3fac9732f&v=4
+ url: https://github.com/garg10may
+six_months_experts:
+- login: Kludex
+ count: 108
+ avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
+ url: https://github.com/Kludex
+- login: jgould22
+ count: 67
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
+- login: YuriiMotov
+ count: 43
+ avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=e83a39697a2d33ab2ec9bfbced794ee48bc29cec&v=4
+ url: https://github.com/YuriiMotov
+- login: JavierSanchezCastro
+ count: 35
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
+- login: n8sty
+ count: 21
+ avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
+ url: https://github.com/n8sty
+- login: hasansezertasan
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
+- login: WilliamStam
+ count: 9
+ avatarUrl: https://avatars.githubusercontent.com/u/182800?v=4
+ url: https://github.com/WilliamStam
+- login: pythonweb2
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/32141163?v=4
+ url: https://github.com/pythonweb2
+- login: dolfinus
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/4661021?u=a51b39001a2e5e7529b45826980becf786de2327&v=4
+ url: https://github.com/dolfinus
+- login: aanchlia
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/2835374?u=3c3ed29aa8b09ccaf8d66def0ce82bc2f7e5aab6&v=4
+ url: https://github.com/aanchlia
+- login: Ventura94
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/43103937?u=ccb837005aaf212a449c374618c4339089e2f733&v=4
+ url: https://github.com/Ventura94
+- login: White-Mask
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
+ url: https://github.com/White-Mask
+- login: nymous
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
+ url: https://github.com/nymous
+- login: shashstormer
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/90090313?v=4
+ url: https://github.com/shashstormer
+- login: GodMoonGoodman
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/29688727?u=7b251da620d999644c37c1feeb292d033eed7ad6&v=4
+ url: https://github.com/GodMoonGoodman
+- login: JoshYuJump
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/5901894?u=cdbca6296ac4cdcdf6945c112a1ce8d5342839ea&v=4
+ url: https://github.com/JoshYuJump
+- login: flo-at
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/564288?v=4
+ url: https://github.com/flo-at
+- login: estebanx64
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/10840422?u=45f015f95e1c0f06df602be4ab688d4b854cc8a8&v=4
+ url: https://github.com/estebanx64
+- login: omarcruzpantoja
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/15116058?u=4b64c643fad49225d854e1aaecd1ffc6f9071a1b&v=4
+ url: https://github.com/omarcruzpantoja
+- login: fmelihh
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/99879453?u=f76c4460556e41a59eb624acd0cf6e342d660700&v=4
+ url: https://github.com/fmelihh
+- login: ahmedabdou14
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/104530599?u=05365b155a1ff911532e8be316acfad2e0736f98&v=4
+ url: https://github.com/ahmedabdou14
+- login: chrisK824
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
+ url: https://github.com/chrisK824
+- login: ebottos94
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
+ url: https://github.com/ebottos94
+- login: binbjz
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/8213913?u=22b68b7a0d5bf5e09c02084c0f5f53d7503114cd&v=4
+ url: https://github.com/binbjz
+- login: theobouwman
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/16098190?u=dc70db88a7a99b764c9a89a6e471e0b7ca478a35&v=4
+ url: https://github.com/theobouwman
+- login: sriram-kondakindi
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/32274323?v=4
+ url: https://github.com/sriram-kondakindi
+- login: yinziyan1206
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/37829370?u=da44ca53aefd5c23f346fab8e9fd2e108294c179&v=4
+ url: https://github.com/yinziyan1206
+- login: pcorvoh
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/48502122?u=89fe3e55f3cfd15d34ffac239b32af358cca6481&v=4
+ url: https://github.com/pcorvoh
+- login: osangu
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/80697064?u=de9bae685e2228bffd4e202274e1df1afaf54a0d&v=4
+ url: https://github.com/osangu
+- login: PhysicallyActive
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/160476156?u=7a8e44f4a43d3bba636f795bb7d9476c9233b4d8&v=4
+ url: https://github.com/PhysicallyActive
+- login: richin13
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/8370058?u=8e37a4cdbc78983a5f4b4847f6d1879fb39c851c&v=4
+ url: https://github.com/richin13
+- login: amacfie
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/889657?u=d70187989940b085bcbfa3bedad8dbc5f3ab1fe7&v=4
+ url: https://github.com/amacfie
+- login: WSH032
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/126865849?v=4
+ url: https://github.com/WSH032
+- login: MRigal
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/2190327?u=557f399ee90319da7bc4a7d9274e110836b0bd60&v=4
+ url: https://github.com/MRigal
+- login: VatsalJagani
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/20964366?u=43552644be05c9107c029e26d5ab3be5a1920f45&v=4
+ url: https://github.com/VatsalJagani
+- login: nameer
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/3931725?u=6199fb065df098fc13ac0a5e649f89672b586732&v=4
+ url: https://github.com/nameer
+- login: kiraware
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/117554978?v=4
+ url: https://github.com/kiraware
+- login: iudeen
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
+ url: https://github.com/iudeen
+- login: khaledadrani
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/45245894?u=49ed5056426a149a5af29d385d8bd3847101d3a4&v=4
+ url: https://github.com/khaledadrani
+- login: acidjunk
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
+ url: https://github.com/acidjunk
+- login: yavuzakyazici
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/148442912?u=1d2d150172c53daf82020b950c6483a6c6a77b7e&v=4
+ url: https://github.com/yavuzakyazici
+- login: AntonioBarral
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/22151181?u=64416447a37a420e6dfd16e675cf74f66c9f204d&v=4
+ url: https://github.com/AntonioBarral
+- login: agn-7
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/14202344?u=a1d05998ceaf4d06d1063575a7c4ef6e7ae5890e&v=4
+ url: https://github.com/agn-7
+- login: ThirVondukr
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/50728601?u=167c0bd655e52817082e50979a86d2f98f95b1a3&v=4
+ url: https://github.com/ThirVondukr
+- login: hussein-awala
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/21311487?u=cbbc60943d3fedfb869e49b604020a821f589659&v=4
+ url: https://github.com/hussein-awala
+- login: jcphlux
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/996689?v=4
+ url: https://github.com/jcphlux
+- login: bhumkong
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/13270137?u=1490432e6a0184fbc3d5c8d1b5df553ca92e7e5b&v=4
+ url: https://github.com/bhumkong
+- login: falkben
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/653031?u=ad9838e089058c9e5a0bab94c0eec7cc181e0cd0&v=4
+ url: https://github.com/falkben
+- login: mielvds
+ count: 2
+ avatarUrl: https://avatars.githubusercontent.com/u/1032980?u=722c96b0a234752df23f04df150ef36441ceb43c&v=4
+ url: https://github.com/mielvds
+one_year_experts:
+- login: Kludex
+ count: 218
+ avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
+ url: https://github.com/Kludex
+- login: jgould22
+ count: 133
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
+- login: JavierSanchezCastro
+ count: 55
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
+- login: YuriiMotov
+ count: 43
+ avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=e83a39697a2d33ab2ec9bfbced794ee48bc29cec&v=4
+ url: https://github.com/YuriiMotov
+- login: n8sty
+ count: 37
+ avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
+ url: https://github.com/n8sty
+- login: chrisK824
+ count: 22
+ avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
+ url: https://github.com/chrisK824
+- login: hasansezertasan
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
+- login: nymous
+ count: 13
+ avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
+ url: https://github.com/nymous
+- login: ahmedabdou14
+ count: 13
+ avatarUrl: https://avatars.githubusercontent.com/u/104530599?u=05365b155a1ff911532e8be316acfad2e0736f98&v=4
+ url: https://github.com/ahmedabdou14
+- login: abhint
+ count: 12
+ avatarUrl: https://avatars.githubusercontent.com/u/25699289?u=b5d219277b4d001ac26fb8be357fddd88c29d51b&v=4
+ url: https://github.com/abhint
+- login: arjwilliams
+ count: 12
+ avatarUrl: https://avatars.githubusercontent.com/u/22227620?v=4
+ url: https://github.com/arjwilliams
+- login: iudeen
+ count: 11
+ avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
+ url: https://github.com/iudeen
+- login: WilliamStam
+ count: 10
+ avatarUrl: https://avatars.githubusercontent.com/u/182800?v=4
+ url: https://github.com/WilliamStam
+- login: yinziyan1206
+ count: 9
+ avatarUrl: https://avatars.githubusercontent.com/u/37829370?u=da44ca53aefd5c23f346fab8e9fd2e108294c179&v=4
+ url: https://github.com/yinziyan1206
+- login: mateoradman
+ count: 7
+ avatarUrl: https://avatars.githubusercontent.com/u/48420316?u=066f36b8e8e263b0d90798113b0f291d3266db7c&v=4
+ url: https://github.com/mateoradman
+- login: Viicos
+ count: 7
+ avatarUrl: https://avatars.githubusercontent.com/u/65306057?u=fcd677dc1b9bef12aa103613e5ccb3f8ce305af9&v=4
+ url: https://github.com/Viicos
+- login: pythonweb2
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/32141163?v=4
+ url: https://github.com/pythonweb2
+- login: ebottos94
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
+ url: https://github.com/ebottos94
+- login: dolfinus
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/4661021?u=a51b39001a2e5e7529b45826980becf786de2327&v=4
+ url: https://github.com/dolfinus
+- login: aanchlia
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/2835374?u=3c3ed29aa8b09ccaf8d66def0ce82bc2f7e5aab6&v=4
+ url: https://github.com/aanchlia
+- login: romabozhanovgithub
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/67696229?u=e4b921eef096415300425aca249348f8abb78ad7&v=4
+ url: https://github.com/romabozhanovgithub
+- login: Ventura94
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/43103937?u=ccb837005aaf212a449c374618c4339089e2f733&v=4
+ url: https://github.com/Ventura94
+- login: White-Mask
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
+ url: https://github.com/White-Mask
+- login: mikeedjones
+ count: 6
+ avatarUrl: https://avatars.githubusercontent.com/u/4087139?u=cc4a242896ac2fcf88a53acfaf190d0fe0a1f0c9&v=4
+ url: https://github.com/mikeedjones
+- login: ThirVondukr
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/50728601?u=167c0bd655e52817082e50979a86d2f98f95b1a3&v=4
+ url: https://github.com/ThirVondukr
+- login: dmontagu
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
+ url: https://github.com/dmontagu
+- login: alex-pobeditel-2004
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/14791483?v=4
+ url: https://github.com/alex-pobeditel-2004
+- login: shashstormer
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/90090313?v=4
+ url: https://github.com/shashstormer
+- login: nzig
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/7372858?u=e769add36ed73c778cdb136eb10bf96b1e119671&v=4
+ url: https://github.com/nzig
+- login: wu-clan
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/52145145?u=f8c9e5c8c259d248e1683fedf5027b4ee08a0967&v=4
+ url: https://github.com/wu-clan
+- login: 8thgencore
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/30128845?u=a747e840f751a1d196d70d0ecf6d07a530d412a1&v=4
+ url: https://github.com/8thgencore
+- login: anthonycepeda
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=60bdf46240cff8fca482ff0fc07d963fd5e1a27c&v=4
+ url: https://github.com/anthonycepeda
+- login: acidjunk
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
+ url: https://github.com/acidjunk
+- login: GodMoonGoodman
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/29688727?u=7b251da620d999644c37c1feeb292d033eed7ad6&v=4
+ url: https://github.com/GodMoonGoodman
+- login: JoshYuJump
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/5901894?u=cdbca6296ac4cdcdf6945c112a1ce8d5342839ea&v=4
+ url: https://github.com/JoshYuJump
+- login: flo-at
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/564288?v=4
+ url: https://github.com/flo-at
+- login: commonism
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/164513?v=4
+ url: https://github.com/commonism
+- login: estebanx64
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/10840422?u=45f015f95e1c0f06df602be4ab688d4b854cc8a8&v=4
+ url: https://github.com/estebanx64
+- login: djimontyp
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/53098395?u=583bade70950b277c322d35f1be2b75c7b0f189c&v=4
+ url: https://github.com/djimontyp
+- login: sanzoghenzo
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/977953?u=d94445b7b87b7096a92a2d4b652ca6c560f34039&v=4
+ url: https://github.com/sanzoghenzo
+- login: adriangb
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
+ url: https://github.com/adriangb
+- login: 9en9i
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/44907258?u=297d0f31ea99c22b718118c1deec82001690cadb&v=4
+ url: https://github.com/9en9i
+- login: mht2953658596
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/59814105?v=4
+ url: https://github.com/mht2953658596
+- login: omarcruzpantoja
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/15116058?u=4b64c643fad49225d854e1aaecd1ffc6f9071a1b&v=4
+ url: https://github.com/omarcruzpantoja
+- login: fmelihh
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/99879453?u=f76c4460556e41a59eb624acd0cf6e342d660700&v=4
+ url: https://github.com/fmelihh
+- login: amacfie
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/889657?u=d70187989940b085bcbfa3bedad8dbc5f3ab1fe7&v=4
+ url: https://github.com/amacfie
+- login: nameer
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/3931725?u=6199fb065df098fc13ac0a5e649f89672b586732&v=4
+ url: https://github.com/nameer
+- login: hhartzer
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/100533792?v=4
+ url: https://github.com/hhartzer
+- login: binbjz
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/8213913?u=22b68b7a0d5bf5e09c02084c0f5f53d7503114cd&v=4
+ url: https://github.com/binbjz
top_contributors:
+- login: nilslindemann
+ count: 127
+ avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
+ url: https://github.com/nilslindemann
+- login: jaystone776
+ count: 49
+ avatarUrl: https://avatars.githubusercontent.com/u/11191137?u=299205a95e9b6817a43144a48b643346a5aac5cc&v=4
+ url: https://github.com/jaystone776
- login: waynerv
count: 25
avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4
url: https://github.com/waynerv
- login: tokusumi
- count: 22
+ count: 24
avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4
url: https://github.com/tokusumi
- login: Kludex
- count: 21
+ count: 22
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
-- login: jaystone776
- count: 18
- avatarUrl: https://avatars.githubusercontent.com/u/11191137?u=299205a95e9b6817a43144a48b643346a5aac5cc&v=4
- url: https://github.com/jaystone776
+- login: SwftAlpc
+ count: 21
+ avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4
+ url: https://github.com/SwftAlpc
- login: dmontagu
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
@@ -251,10 +842,34 @@ top_contributors:
count: 12
avatarUrl: https://avatars.githubusercontent.com/u/11489395?u=4adb6986bf3debfc2b8216ae701f2bd47d73da7d&v=4
url: https://github.com/mariacamilagl
+- login: hasansezertasan
+ count: 12
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
- login: Smlep
count: 11
avatarUrl: https://avatars.githubusercontent.com/u/16785985?v=4
url: https://github.com/Smlep
+- login: AlertRED
+ count: 11
+ avatarUrl: https://avatars.githubusercontent.com/u/15695000?u=f5a4944c6df443030409c88da7d7fa0b7ead985c&v=4
+ url: https://github.com/AlertRED
+- login: hard-coders
+ count: 10
+ avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4
+ url: https://github.com/hard-coders
+- login: alejsdev
+ count: 10
+ avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=1ee3a9fbef27abc9448ef5951350f99c7d76f7af&v=4
+ url: https://github.com/alejsdev
+- login: KaniKim
+ count: 10
+ avatarUrl: https://avatars.githubusercontent.com/u/19832624?u=d8ff6fca8542d22f94388cd2c4292e76e3898584&v=4
+ url: https://github.com/KaniKim
+- login: xzmeng
+ count: 9
+ avatarUrl: https://avatars.githubusercontent.com/u/40202897?v=4
+ url: https://github.com/xzmeng
- login: Serrones
count: 8
avatarUrl: https://avatars.githubusercontent.com/u/22691749?u=4795b880e13ca33a73e52fc0ef7dc9c60c8fce47&v=4
@@ -263,14 +878,14 @@ top_contributors:
count: 8
avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4
url: https://github.com/rjNemo
+- login: pablocm83
+ count: 8
+ avatarUrl: https://avatars.githubusercontent.com/u/28315068?u=3310fbb05bb8bfc50d2c48b6cb64ac9ee4a14549&v=4
+ url: https://github.com/pablocm83
- login: RunningIkkyu
count: 7
avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=494ecc298e3f26197495bb357ad0f57cfd5f7a32&v=4
url: https://github.com/RunningIkkyu
-- login: hard-coders
- count: 7
- avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4
- url: https://github.com/hard-coders
- login: Alexandrhub
count: 7
avatarUrl: https://avatars.githubusercontent.com/u/119126536?u=9fc0d48f3307817bafecc5861eb2168401a6cb04&v=4
@@ -291,10 +906,6 @@ top_contributors:
count: 5
avatarUrl: https://avatars.githubusercontent.com/u/4039449?u=42eb3b833047c8c4b4f647a031eaef148c16d93f&v=4
url: https://github.com/samuelcolvin
-- login: SwftAlpc
- count: 5
- avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4
- url: https://github.com/SwftAlpc
- login: Attsun1031
count: 5
avatarUrl: https://avatars.githubusercontent.com/u/1175560?v=4
@@ -303,6 +914,10 @@ top_contributors:
count: 5
avatarUrl: https://avatars.githubusercontent.com/u/43503750?u=f440bc9062afb3c43b9b9c6cdfdcfe31d58699ef&v=4
url: https://github.com/ComicShrimp
+- login: rostik1410
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/11443899?u=e26a635c2ba220467b308a326a579b8ccf4a8701&v=4
+ url: https://github.com/rostik1410
- login: tamtam-fitness
count: 5
avatarUrl: https://avatars.githubusercontent.com/u/62091034?u=8da19a6bd3d02f5d6ba30c7247d5b46c98dd1403&v=4
@@ -317,7 +932,7 @@ top_contributors:
url: https://github.com/jfunez
- login: ycd
count: 4
- avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=bba5af018423a2858d49309bed2a899bb5c34ac5&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=45aa6ef58220a3f1e8a3c3cd5f1b75a1a0a73347&v=4
url: https://github.com/ycd
- login: komtaki
count: 4
@@ -335,6 +950,10 @@ top_contributors:
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4
url: https://github.com/lsglucas
+- login: BilalAlpaslan
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4
+ url: https://github.com/BilalAlpaslan
- login: adriangb
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
@@ -351,13 +970,25 @@ top_contributors:
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/36765187?u=c6e0ba571c1ccb6db9d94e62e4b8b5eda811a870&v=4
url: https://github.com/ivan-abc
-- login: rostik1410
- count: 4
- avatarUrl: https://avatars.githubusercontent.com/u/11443899?u=e26a635c2ba220467b308a326a579b8ccf4a8701&v=4
- url: https://github.com/rostik1410
+- login: divums
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/1397556?v=4
+ url: https://github.com/divums
+- login: prostomarkeloff
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/28061158?u=72309cc1f2e04e40fa38b29969cb4e9d3f722e7b&v=4
+ url: https://github.com/prostomarkeloff
+- login: nsidnev
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/22559461?u=a9cc3238217e21dc8796a1a500f01b722adb082c&v=4
+ url: https://github.com/nsidnev
+- login: pawamoy
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/3999221?u=b030e4c89df2f3a36bc4710b925bdeb6745c9856&v=4
+ url: https://github.com/pawamoy
top_reviewers:
- login: Kludex
- count: 145
+ count: 156
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
- login: BilalAlpaslan
@@ -365,7 +996,7 @@ top_reviewers:
avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4
url: https://github.com/BilalAlpaslan
- login: yezz123
- count: 82
+ count: 84
avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=d7062cbc6eb7671d5dc9cc0e32a24ae335e0f225&v=4
url: https://github.com/yezz123
- login: iudeen
@@ -390,12 +1021,20 @@ top_reviewers:
url: https://github.com/Laineyzhang55
- login: ycd
count: 45
- avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=bba5af018423a2858d49309bed2a899bb5c34ac5&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=45aa6ef58220a3f1e8a3c3cd5f1b75a1a0a73347&v=4
url: https://github.com/ycd
- login: cikay
count: 41
avatarUrl: https://avatars.githubusercontent.com/u/24587499?u=e772190a051ab0eaa9c8542fcff1892471638f2b&v=4
url: https://github.com/cikay
+- login: hasansezertasan
+ count: 41
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
+- login: alejsdev
+ count: 37
+ avatarUrl: https://avatars.githubusercontent.com/u/90076947?u=1ee3a9fbef27abc9448ef5951350f99c7d76f7af&v=4
+ url: https://github.com/alejsdev
- login: JarroVGIT
count: 34
avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4
@@ -410,7 +1049,7 @@ top_reviewers:
url: https://github.com/ArcLightSlavik
- login: cassiobotaro
count: 28
- avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=b0a652331da17efeb85cd6e3a4969182e5004804&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=a08022b191ddbd0a6159b2981d9d878b6d5bb71f&v=4
url: https://github.com/cassiobotaro
- login: lsglucas
count: 27
@@ -428,18 +1067,26 @@ top_reviewers:
count: 24
avatarUrl: https://avatars.githubusercontent.com/u/16273730?u=095b66f243a2cd6a0aadba9a095009f8aaf18393&v=4
url: https://github.com/LorhanSohaky
+- login: YuriiMotov
+ count: 24
+ avatarUrl: https://avatars.githubusercontent.com/u/109919500?u=e83a39697a2d33ab2ec9bfbced794ee48bc29cec&v=4
+ url: https://github.com/YuriiMotov
- login: dmontagu
count: 23
avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
url: https://github.com/dmontagu
+- login: nilslindemann
+ count: 23
+ avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
+ url: https://github.com/nilslindemann
+- login: hard-coders
+ count: 23
+ avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4
+ url: https://github.com/hard-coders
- login: rjNemo
count: 21
avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4
url: https://github.com/rjNemo
-- login: hard-coders
- count: 21
- avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4
- url: https://github.com/hard-coders
- login: odiseo0
count: 20
avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=241a71f6b7068738b81af3e57f45ffd723538401&v=4
@@ -468,10 +1115,6 @@ top_reviewers:
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4
url: https://github.com/SwftAlpc
-- login: nilslindemann
- count: 16
- avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
- url: https://github.com/nilslindemann
- login: axel584
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/1334088?u=9667041f5b15dc002b6f9665fda8c0412933ac04&v=4
@@ -484,10 +1127,6 @@ top_reviewers:
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/87962045?u=08e10fa516e844934f4b3fc7c38b33c61697e4a1&v=4
url: https://github.com/DevDae
-- login: hasansezertasan
- count: 16
- avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
- url: https://github.com/hasansezertasan
- login: pedabraham
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/16860088?u=abf922a7b920bf8fdb7867d8b43e091f1e796178&v=4
@@ -496,10 +1135,18 @@ top_reviewers:
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/63476957?u=6c86e59b48e0394d4db230f37fc9ad4d7e2c27c7&v=4
url: https://github.com/delhi09
+- login: Aruelius
+ count: 14
+ avatarUrl: https://avatars.githubusercontent.com/u/25380989?u=574f8cfcda3ea77a3f81884f6b26a97068e36a9d&v=4
+ url: https://github.com/Aruelius
- login: sh0nk
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/6478810?u=af15d724875cec682ed8088a86d36b2798f981c0&v=4
url: https://github.com/sh0nk
+- login: junah201
+ count: 13
+ avatarUrl: https://avatars.githubusercontent.com/u/75025529?u=2451c256e888fa2a06bcfc0646d09b87ddb6a945&v=4
+ url: https://github.com/junah201
- login: wdh99
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/108172295?u=8a8fb95d5afe3e0fa33257b2aecae88d436249eb&v=4
@@ -508,6 +1155,10 @@ top_reviewers:
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/5357541?u=6428442d875d5d71aaa1bb38bb11c4be1a526bc2&v=4
url: https://github.com/r0b2g1t
+- login: JavierSanchezCastro
+ count: 13
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
- login: RunningIkkyu
count: 12
avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=494ecc298e3f26197495bb357ad0f57cfd5f7a32&v=4
@@ -516,39 +1167,216 @@ top_reviewers:
count: 12
avatarUrl: https://avatars.githubusercontent.com/u/36765187?u=c6e0ba571c1ccb6db9d94e62e4b8b5eda811a870&v=4
url: https://github.com/ivan-abc
+- login: AlertRED
+ count: 12
+ avatarUrl: https://avatars.githubusercontent.com/u/15695000?u=f5a4944c6df443030409c88da7d7fa0b7ead985c&v=4
+ url: https://github.com/AlertRED
- login: solomein-sv
count: 11
avatarUrl: https://avatars.githubusercontent.com/u/46193920?u=789927ee09cfabd752d3bd554fa6baf4850d2777&v=4
url: https://github.com/solomein-sv
+- login: dpinezich
+ count: 11
+ avatarUrl: https://avatars.githubusercontent.com/u/3204540?u=a2e1465e3ee10d537614d513589607eddefde09f&v=4
+ url: https://github.com/dpinezich
- login: mariacamilagl
count: 10
avatarUrl: https://avatars.githubusercontent.com/u/11489395?u=4adb6986bf3debfc2b8216ae701f2bd47d73da7d&v=4
url: https://github.com/mariacamilagl
-- login: raphaelauv
- count: 10
- avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4
- url: https://github.com/raphaelauv
-- login: Attsun1031
- count: 10
- avatarUrl: https://avatars.githubusercontent.com/u/1175560?v=4
- url: https://github.com/Attsun1031
-- login: maoyibo
- count: 10
- avatarUrl: https://avatars.githubusercontent.com/u/7887703?v=4
- url: https://github.com/maoyibo
-- login: ComicShrimp
- count: 10
- avatarUrl: https://avatars.githubusercontent.com/u/43503750?u=f440bc9062afb3c43b9b9c6cdfdcfe31d58699ef&v=4
- url: https://github.com/ComicShrimp
+top_translations_reviewers:
+- login: s111d
+ count: 143
+ avatarUrl: https://avatars.githubusercontent.com/u/4954856?v=4
+ url: https://github.com/s111d
+- login: Xewus
+ count: 128
+ avatarUrl: https://avatars.githubusercontent.com/u/85196001?u=f8e2dc7e5104f109cef944af79050ea8d1b8f914&v=4
+ url: https://github.com/Xewus
+- login: tokusumi
+ count: 104
+ avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4
+ url: https://github.com/tokusumi
+- login: hasansezertasan
+ count: 84
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
+- login: AlertRED
+ count: 70
+ avatarUrl: https://avatars.githubusercontent.com/u/15695000?u=f5a4944c6df443030409c88da7d7fa0b7ead985c&v=4
+ url: https://github.com/AlertRED
+- login: Alexandrhub
+ count: 68
+ avatarUrl: https://avatars.githubusercontent.com/u/119126536?u=9fc0d48f3307817bafecc5861eb2168401a6cb04&v=4
+ url: https://github.com/Alexandrhub
+- login: waynerv
+ count: 63
+ avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4
+ url: https://github.com/waynerv
+- login: hard-coders
+ count: 53
+ avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=95db33927bbff1ed1c07efddeb97ac2ff33068ed&v=4
+ url: https://github.com/hard-coders
+- login: Laineyzhang55
+ count: 48
+ avatarUrl: https://avatars.githubusercontent.com/u/59285379?v=4
+ url: https://github.com/Laineyzhang55
+- login: Kludex
+ count: 46
+ avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
+ url: https://github.com/Kludex
+- login: komtaki
+ count: 45
+ avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4
+ url: https://github.com/komtaki
+- login: Winand
+ count: 40
+ avatarUrl: https://avatars.githubusercontent.com/u/53390?u=bb0e71a2fc3910a8e0ee66da67c33de40ea695f8&v=4
+ url: https://github.com/Winand
+- login: solomein-sv
+ count: 38
+ avatarUrl: https://avatars.githubusercontent.com/u/46193920?u=789927ee09cfabd752d3bd554fa6baf4850d2777&v=4
+ url: https://github.com/solomein-sv
+- login: alperiox
+ count: 37
+ avatarUrl: https://avatars.githubusercontent.com/u/34214152?u=2c5acad3461d4dbc2d48371ba86cac56ae9b25cc&v=4
+ url: https://github.com/alperiox
+- login: lsglucas
+ count: 36
+ avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4
+ url: https://github.com/lsglucas
+- login: SwftAlpc
+ count: 36
+ avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4
+ url: https://github.com/SwftAlpc
+- login: nilslindemann
+ count: 35
+ avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
+ url: https://github.com/nilslindemann
+- login: rjNemo
+ count: 34
+ avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4
+ url: https://github.com/rjNemo
+- login: akarev0
+ count: 33
+ avatarUrl: https://avatars.githubusercontent.com/u/53393089?u=6e528bb4789d56af887ce6fe237bea4010885406&v=4
+ url: https://github.com/akarev0
- login: romashevchenko
- count: 9
+ count: 32
avatarUrl: https://avatars.githubusercontent.com/u/132477732?v=4
url: https://github.com/romashevchenko
-- login: izaguerreiro
- count: 9
- avatarUrl: https://avatars.githubusercontent.com/u/2241504?v=4
- url: https://github.com/izaguerreiro
-- login: graingert
- count: 9
- avatarUrl: https://avatars.githubusercontent.com/u/413772?u=64b77b6aa405c68a9c6bcf45f84257c66eea5f32&v=4
- url: https://github.com/graingert
+- login: LorhanSohaky
+ count: 30
+ avatarUrl: https://avatars.githubusercontent.com/u/16273730?u=095b66f243a2cd6a0aadba9a095009f8aaf18393&v=4
+ url: https://github.com/LorhanSohaky
+- login: cassiobotaro
+ count: 29
+ avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=a08022b191ddbd0a6159b2981d9d878b6d5bb71f&v=4
+ url: https://github.com/cassiobotaro
+- login: wdh99
+ count: 29
+ avatarUrl: https://avatars.githubusercontent.com/u/108172295?u=8a8fb95d5afe3e0fa33257b2aecae88d436249eb&v=4
+ url: https://github.com/wdh99
+- login: pedabraham
+ count: 28
+ avatarUrl: https://avatars.githubusercontent.com/u/16860088?u=abf922a7b920bf8fdb7867d8b43e091f1e796178&v=4
+ url: https://github.com/pedabraham
+- login: Smlep
+ count: 28
+ avatarUrl: https://avatars.githubusercontent.com/u/16785985?v=4
+ url: https://github.com/Smlep
+- login: dedkot01
+ count: 28
+ avatarUrl: https://avatars.githubusercontent.com/u/26196675?u=e2966887124e67932853df4f10f86cb526edc7b0&v=4
+ url: https://github.com/dedkot01
+- login: dpinezich
+ count: 28
+ avatarUrl: https://avatars.githubusercontent.com/u/3204540?u=a2e1465e3ee10d537614d513589607eddefde09f&v=4
+ url: https://github.com/dpinezich
+- login: maoyibo
+ count: 27
+ avatarUrl: https://avatars.githubusercontent.com/u/7887703?v=4
+ url: https://github.com/maoyibo
+- login: 0417taehyun
+ count: 27
+ avatarUrl: https://avatars.githubusercontent.com/u/63915557?u=47debaa860fd52c9b98c97ef357ddcec3b3fb399&v=4
+ url: https://github.com/0417taehyun
+- login: BilalAlpaslan
+ count: 26
+ avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4
+ url: https://github.com/BilalAlpaslan
+- login: zy7y
+ count: 25
+ avatarUrl: https://avatars.githubusercontent.com/u/67154681?u=5d634834cc514028ea3f9115f7030b99a1f4d5a4&v=4
+ url: https://github.com/zy7y
+- login: mycaule
+ count: 25
+ avatarUrl: https://avatars.githubusercontent.com/u/6161385?u=e3cec75bd6d938a0d73fae0dc5534d1ab2ed1b0e&v=4
+ url: https://github.com/mycaule
+- login: sh0nk
+ count: 23
+ avatarUrl: https://avatars.githubusercontent.com/u/6478810?u=af15d724875cec682ed8088a86d36b2798f981c0&v=4
+ url: https://github.com/sh0nk
+- login: axel584
+ count: 23
+ avatarUrl: https://avatars.githubusercontent.com/u/1334088?u=9667041f5b15dc002b6f9665fda8c0412933ac04&v=4
+ url: https://github.com/axel584
+- login: AGolicyn
+ count: 21
+ avatarUrl: https://avatars.githubusercontent.com/u/86262613?u=3c21606ab8d210a061a1673decff1e7d5592b380&v=4
+ url: https://github.com/AGolicyn
+- login: Attsun1031
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/1175560?v=4
+ url: https://github.com/Attsun1031
+- login: ycd
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=45aa6ef58220a3f1e8a3c3cd5f1b75a1a0a73347&v=4
+ url: https://github.com/ycd
+- login: delhi09
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/63476957?u=6c86e59b48e0394d4db230f37fc9ad4d7e2c27c7&v=4
+ url: https://github.com/delhi09
+- login: rogerbrinkmann
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/5690226?v=4
+ url: https://github.com/rogerbrinkmann
+- login: DevDae
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/87962045?u=08e10fa516e844934f4b3fc7c38b33c61697e4a1&v=4
+ url: https://github.com/DevDae
+- login: sattosan
+ count: 19
+ avatarUrl: https://avatars.githubusercontent.com/u/20574756?u=b0d8474d2938189c6954423ae8d81d91013f80a8&v=4
+ url: https://github.com/sattosan
+- login: ComicShrimp
+ count: 18
+ avatarUrl: https://avatars.githubusercontent.com/u/43503750?u=f440bc9062afb3c43b9b9c6cdfdcfe31d58699ef&v=4
+ url: https://github.com/ComicShrimp
+- login: simatheone
+ count: 18
+ avatarUrl: https://avatars.githubusercontent.com/u/78508673?u=1b9658d9ee0bde33f56130dd52275493ddd38690&v=4
+ url: https://github.com/simatheone
+- login: ivan-abc
+ count: 18
+ avatarUrl: https://avatars.githubusercontent.com/u/36765187?u=c6e0ba571c1ccb6db9d94e62e4b8b5eda811a870&v=4
+ url: https://github.com/ivan-abc
+- login: bezaca
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/69092910?u=4ac58eab99bd37d663f3d23551df96d4fbdbf760&v=4
+ url: https://github.com/bezaca
+- login: lbmendes
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/80999926?u=646619e2f07ac5a7c3f65fe7834197461a4fff9f&v=4
+ url: https://github.com/lbmendes
+- login: rostik1410
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/11443899?u=e26a635c2ba220467b308a326a579b8ccf4a8701&v=4
+ url: https://github.com/rostik1410
+- login: spacesphere
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/34628304?u=cde91f6002dd33156e1bf8005f11a7a3ed76b790&v=4
+ url: https://github.com/spacesphere
+- login: panko
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/1569515?u=a84a5d255621ed82f8e1ca052f5f2eeb75997da2&v=4
+ url: https://github.com/panko
diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml
index 121a3b761..85ac30d6d 100644
--- a/docs/en/data/sponsors.yml
+++ b/docs/en/data/sponsors.yml
@@ -20,22 +20,19 @@ gold:
- url: https://www.propelauth.com/?utm_source=fastapi&utm_campaign=1223&utm_medium=mainbadge
title: Auth, user management and more for your B2B product
img: https://fastapi.tiangolo.com/img/sponsors/propelauth.png
+ - url: https://www.withcoherence.com/?utm_medium=advertising&utm_source=fastapi&utm_campaign=banner%20january%2024
+ title: Coherence
+ img: https://fastapi.tiangolo.com/img/sponsors/coherence.png
+ - url: https://www.mongodb.com/developer/languages/python/python-quickstart-fastapi/?utm_campaign=fastapi_framework&utm_source=fastapi_sponsorship&utm_medium=web_referral
+ title: Simplify Full Stack Development with FastAPI & MongoDB
+ img: https://fastapi.tiangolo.com/img/sponsors/mongodb.png
silver:
- - url: https://www.deta.sh/?ref=fastapi
- title: The launchpad for all your (team's) ideas
- img: https://fastapi.tiangolo.com/img/sponsors/deta.svg
- url: https://training.talkpython.fm/fastapi-courses
title: FastAPI video courses on demand from people you trust
- img: https://fastapi.tiangolo.com/img/sponsors/talkpython.png
- - url: https://testdriven.io/courses/tdd-fastapi/
- title: Learn to build high-quality web apps with best practices
- img: https://fastapi.tiangolo.com/img/sponsors/testdriven.svg
+ img: https://fastapi.tiangolo.com/img/sponsors/talkpython-v2.jpg
- url: https://github.com/deepset-ai/haystack/
title: Build powerful search from composable, open source building blocks
img: https://fastapi.tiangolo.com/img/sponsors/haystack-fastapi.svg
- - url: https://careers.powens.com/
- title: Powens is hiring!
- img: https://fastapi.tiangolo.com/img/sponsors/powens.png
- url: https://databento.com/
title: Pay as you go for market data
img: https://fastapi.tiangolo.com/img/sponsors/databento.svg
@@ -52,6 +49,6 @@ bronze:
- url: https://www.exoflare.com/open-source/?utm_source=FastAPI&utm_campaign=open_source
title: Biosecurity risk assessments made easy.
img: https://fastapi.tiangolo.com/img/sponsors/exoflare.png
- - url: https://bit.ly/3JJ7y5C
- title: Build cross-modal and multimodal applications on the cloud
- img: https://fastapi.tiangolo.com/img/sponsors/jina2.svg
+ - url: https://testdriven.io/courses/tdd-fastapi/
+ title: Learn to build high-quality web apps with best practices
+ img: https://fastapi.tiangolo.com/img/sponsors/testdriven.svg
diff --git a/docs/en/data/sponsors_badge.yml b/docs/en/data/sponsors_badge.yml
index 4078454a8..00cbec7d2 100644
--- a/docs/en/data/sponsors_badge.yml
+++ b/docs/en/data/sponsors_badge.yml
@@ -23,3 +23,8 @@ logins:
- svixhq
- Alek99
- codacy
+ - zanfaruqui
+ - scalar
+ - bump-sh
+ - andrew-propelauth
+ - svix
diff --git a/docs/en/docs/advanced/behind-a-proxy.md b/docs/en/docs/advanced/behind-a-proxy.md
index 01998cc91..b25c11b17 100644
--- a/docs/en/docs/advanced/behind-a-proxy.md
+++ b/docs/en/docs/advanced/behind-a-proxy.md
@@ -18,7 +18,11 @@ In this case, the original path `/app` would actually be served at `/api/v1/app`
Even though all your code is written assuming there's just `/app`.
-And the proxy would be **"stripping"** the **path prefix** on the fly before transmitting the request to Uvicorn, keep your application convinced that it is serving at `/app`, so that you don't have to update all your code to include the prefix `/api/v1`.
+```Python hl_lines="6"
+{!../../../docs_src/behind_a_proxy/tutorial001.py!}
+```
+
+And the proxy would be **"stripping"** the **path prefix** on the fly before transmitting the request to Uvicorn, keeping your application convinced that it is being served at `/app`, so that you don't have to update all your code to include the prefix `/api/v1`.
Up to here, everything would work as normally.
@@ -341,6 +345,6 @@ and then it won't include it in the OpenAPI schema.
## Mounting a sub-application
-If you need to mount a sub-application (as described in [Sub Applications - Mounts](./sub-applications.md){.internal-link target=_blank}) while also using a proxy with `root_path`, you can do it normally, as you would expect.
+If you need to mount a sub-application (as described in [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}) while also using a proxy with `root_path`, you can do it normally, as you would expect.
FastAPI will internally use the `root_path` smartly, so it will just work. ✨
diff --git a/docs/en/docs/advanced/custom-response.md b/docs/en/docs/advanced/custom-response.md
index 827776f5e..45c7c7bd5 100644
--- a/docs/en/docs/advanced/custom-response.md
+++ b/docs/en/docs/advanced/custom-response.md
@@ -23,7 +23,7 @@ Import the `Response` class (sub-class) you want to use and declare it in the *p
For large responses, returning a `Response` directly is much faster than returning a dictionary.
-This is because by default, FastAPI will inspect every item inside and make sure it is serializable with JSON, using the same [JSON Compatible Encoder](../tutorial/encoder.md){.internal-link target=_blank} explained in the tutorial. This is what allows you to return **arbitrary objects**, for example database models.
+This is because by default, FastAPI will inspect every item inside and make sure it is serializable as JSON, using the same [JSON Compatible Encoder](../tutorial/encoder.md){.internal-link target=_blank} explained in the tutorial. This is what allows you to return **arbitrary objects**, for example database models.
But if you are certain that the content that you are returning is **serializable with JSON**, you can pass it directly to the response class and avoid the extra overhead that FastAPI would have by passing your return content through the `jsonable_encoder` before passing it to the response class.
@@ -73,7 +73,7 @@ The same example from above, returning an `HTMLResponse`, could look like:
A `Response` returned directly by your *path operation function* won't be documented in OpenAPI (for example, the `Content-Type` won't be documented) and won't be visible in the automatic interactive docs.
!!! info
- Of course, the actual `Content-Type` header, status code, etc, will come from the `Response` object your returned.
+ Of course, the actual `Content-Type` header, status code, etc, will come from the `Response` object you returned.
### Document in OpenAPI and override `Response`
diff --git a/docs/en/docs/advanced/dataclasses.md b/docs/en/docs/advanced/dataclasses.md
index ed1d5610f..286e8f93f 100644
--- a/docs/en/docs/advanced/dataclasses.md
+++ b/docs/en/docs/advanced/dataclasses.md
@@ -8,7 +8,7 @@ But FastAPI also supports using internal support for `dataclasses`.
+This is still supported thanks to **Pydantic**, as it has internal support for `dataclasses`.
So, even with the code above that doesn't use Pydantic explicitly, FastAPI is using Pydantic to convert those standard dataclasses to Pydantic's own flavor of dataclasses.
@@ -77,7 +77,7 @@ In that case, you can simply swap the standard `dataclasses` with `pydantic.data
As always, in FastAPI you can combine `def` and `async def` as needed.
- If you need a refresher about when to use which, check out the section _"In a hurry?"_ in the docs about `async` and `await`.
+ If you need a refresher about when to use which, check out the section _"In a hurry?"_ in the docs about [`async` and `await`](../async.md#in-a-hurry){.internal-link target=_blank}.
9. This *path operation function* is not returning dataclasses (although it could), but a list of dictionaries with internal data.
@@ -91,7 +91,7 @@ Check the in-code annotation tips above to see more specific details.
You can also combine `dataclasses` with other Pydantic models, inherit from them, include them in your own models, etc.
-To learn more, check the Pydantic docs about dataclasses.
+To learn more, check the Pydantic docs about dataclasses.
## Version
diff --git a/docs/en/docs/advanced/events.md b/docs/en/docs/advanced/events.md
index ca9d86ae4..703fcb7ae 100644
--- a/docs/en/docs/advanced/events.md
+++ b/docs/en/docs/advanced/events.md
@@ -159,4 +159,4 @@ Underneath, in the ASGI technical specification, this is part of the OpenAPI Generator.
-If you are building a **frontend**, a very interesting alternative is openapi-typescript-codegen.
+If you are building a **frontend**, a very interesting alternative is openapi-ts.
## Client and SDK Generators - Sponsor
@@ -58,14 +58,14 @@ And that same information from the models that is included in OpenAPI is what ca
Now that we have the app with the models, we can generate the client code for the frontend.
-#### Install `openapi-typescript-codegen`
+#### Install `openapi-ts`
-You can install `openapi-typescript-codegen` in your frontend code with:
+You can install `openapi-ts` in your frontend code with:
diff --git a/docs/en/docs/advanced/path-operation-advanced-configuration.md b/docs/en/docs/advanced/path-operation-advanced-configuration.md
index 8b79bfe22..c5544a78b 100644
--- a/docs/en/docs/advanced/path-operation-advanced-configuration.md
+++ b/docs/en/docs/advanced/path-operation-advanced-configuration.md
@@ -59,7 +59,7 @@ That defines the metadata about the main response of a *path operation*.
You can also declare additional responses with their models, status codes, etc.
-There's a whole chapter here in the documentation about it, you can read it at [Additional Responses in OpenAPI](./additional-responses.md){.internal-link target=_blank}.
+There's a whole chapter here in the documentation about it, you can read it at [Additional Responses in OpenAPI](additional-responses.md){.internal-link target=_blank}.
## OpenAPI Extra
@@ -77,7 +77,7 @@ This *path operation*-specific OpenAPI schema is normally generated automaticall
!!! tip
This is a low level extension point.
- If you only need to declare additional responses, a more convenient way to do it is with [Additional Responses in OpenAPI](./additional-responses.md){.internal-link target=_blank}.
+ If you only need to declare additional responses, a more convenient way to do it is with [Additional Responses in OpenAPI](additional-responses.md){.internal-link target=_blank}.
You can extend the OpenAPI schema for a *path operation* using the parameter `openapi_extra`.
diff --git a/docs/en/docs/advanced/security/index.md b/docs/en/docs/advanced/security/index.md
index c18baf64b..c9ede4231 100644
--- a/docs/en/docs/advanced/security/index.md
+++ b/docs/en/docs/advanced/security/index.md
@@ -2,7 +2,7 @@
## Additional Features
-There are some extra features to handle security apart from the ones covered in the [Tutorial - User Guide: Security](../../tutorial/security/){.internal-link target=_blank}.
+There are some extra features to handle security apart from the ones covered in the [Tutorial - User Guide: Security](../../tutorial/security/index.md){.internal-link target=_blank}.
!!! tip
The next sections are **not necessarily "advanced"**.
@@ -11,6 +11,6 @@ There are some extra features to handle security apart from the ones covered in
## Read the Tutorial first
-The next sections assume you already read the main [Tutorial - User Guide: Security](../../tutorial/security/){.internal-link target=_blank}.
+The next sections assume you already read the main [Tutorial - User Guide: Security](../../tutorial/security/index.md){.internal-link target=_blank}.
They are all based on the same concepts, but allow some extra functionalities.
diff --git a/docs/en/docs/advanced/settings.md b/docs/en/docs/advanced/settings.md
index f6db8d2b1..8f72bf63a 100644
--- a/docs/en/docs/advanced/settings.md
+++ b/docs/en/docs/advanced/settings.md
@@ -232,7 +232,7 @@ And then use it in a file `main.py`:
```
!!! tip
- You would also need a file `__init__.py` as you saw on [Bigger Applications - Multiple Files](../tutorial/bigger-applications.md){.internal-link target=_blank}.
+ You would also need a file `__init__.py` as you saw in [Bigger Applications - Multiple Files](../tutorial/bigger-applications.md){.internal-link target=_blank}.
## Settings in a dependency
diff --git a/docs/en/docs/advanced/sub-applications.md b/docs/en/docs/advanced/sub-applications.md
index a089632ac..8c52e091f 100644
--- a/docs/en/docs/advanced/sub-applications.md
+++ b/docs/en/docs/advanced/sub-applications.md
@@ -70,4 +70,4 @@ That way, the sub-application will know to use that path prefix for the docs UI.
And the sub-application could also have its own mounted sub-applications and everything would work correctly, because FastAPI handles all these `root_path`s automatically.
-You will learn more about the `root_path` and how to use it explicitly in the section about [Behind a Proxy](./behind-a-proxy.md){.internal-link target=_blank}.
+You will learn more about the `root_path` and how to use it explicitly in the section about [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank}.
diff --git a/docs/en/docs/advanced/wsgi.md b/docs/en/docs/advanced/wsgi.md
index cfe3c78c1..852e25019 100644
--- a/docs/en/docs/advanced/wsgi.md
+++ b/docs/en/docs/advanced/wsgi.md
@@ -1,6 +1,6 @@
# Including WSGI - Flask, Django, others
-You can mount WSGI applications as you saw with [Sub Applications - Mounts](./sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](./behind-a-proxy.md){.internal-link target=_blank}.
+You can mount WSGI applications as you saw with [Sub Applications - Mounts](sub-applications.md){.internal-link target=_blank}, [Behind a Proxy](behind-a-proxy.md){.internal-link target=_blank}.
For that, you can use the `WSGIMiddleware` and use it to wrap your WSGI application, for example, Flask, Django, etc.
diff --git a/docs/en/docs/alternatives.md b/docs/en/docs/alternatives.md
index 70bbcac91..9a101a8a1 100644
--- a/docs/en/docs/alternatives.md
+++ b/docs/en/docs/alternatives.md
@@ -1,6 +1,6 @@
# Alternatives, Inspiration and Comparisons
-What inspired **FastAPI**, how it compares to other alternatives and what it learned from them.
+What inspired **FastAPI**, how it compares to alternatives and what it learned from them.
## Intro
@@ -117,7 +117,7 @@ That's why when talking about version 2.0 it's common to say "Swagger", and for
* Swagger UI
* ReDoc
- These two were chosen for being fairly popular and stable, but doing a quick search, you could find dozens of additional alternative user interfaces for OpenAPI (that you can use with **FastAPI**).
+ These two were chosen for being fairly popular and stable, but doing a quick search, you could find dozens of alternative user interfaces for OpenAPI (that you can use with **FastAPI**).
### Flask REST frameworks
@@ -291,7 +291,7 @@ As it is based on the previous standard for synchronous Python web frameworks (W
!!! info
Hug was created by Timothy Crosley, the same creator of `isort`, a great tool to automatically sort imports in Python files.
-!!! check "Ideas inspired in **FastAPI**"
+!!! check "Ideas inspiring **FastAPI**"
Hug inspired parts of APIStar, and was one of the tools I found most promising, alongside APIStar.
Hug helped inspiring **FastAPI** to use Python type hints to declare parameters, and to generate a schema defining the API automatically.
@@ -342,7 +342,7 @@ Now APIStar is a set of tools to validate OpenAPI specifications, not a web fram
## Used by **FastAPI**
-### Pydantic
+### Pydantic
Pydantic is a library to define data validation, serialization and documentation (using JSON Schema) based on Python type hints.
diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md
index 2ead1f2db..a0c00933a 100644
--- a/docs/en/docs/async.md
+++ b/docs/en/docs/async.md
@@ -397,7 +397,7 @@ All that is what powers FastAPI (through Starlette) and what makes it have such
These are very technical details of how **FastAPI** works underneath.
- If you have quite some technical knowledge (co-routines, threads, blocking, etc.) and are curious about how FastAPI handles `async def` vs normal `def`, go ahead.
+ If you have quite some technical knowledge (coroutines, threads, blocking, etc.) and are curious about how FastAPI handles `async def` vs normal `def`, go ahead.
### Path operation functions
@@ -405,15 +405,15 @@ When you declare a *path operation function* with normal `def` instead of `async
If you are coming from another async framework that does not work in the way described above and you are used to defining trivial compute-only *path operation functions* with plain `def` for a tiny performance gain (about 100 nanoseconds), please note that in **FastAPI** the effect would be quite opposite. In these cases, it's better to use `async def` unless your *path operation functions* use code that performs blocking I/O.
-Still, in both situations, chances are that **FastAPI** will [still be faster](/#performance){.internal-link target=_blank} than (or at least comparable to) your previous framework.
+Still, in both situations, chances are that **FastAPI** will [still be faster](index.md#performance){.internal-link target=_blank} than (or at least comparable to) your previous framework.
### Dependencies
-The same applies for [dependencies](./tutorial/dependencies/index.md){.internal-link target=_blank}. If a dependency is a standard `def` function instead of `async def`, it is run in the external threadpool.
+The same applies for [dependencies](tutorial/dependencies/index.md){.internal-link target=_blank}. If a dependency is a standard `def` function instead of `async def`, it is run in the external threadpool.
### Sub-dependencies
-You can have multiple dependencies and [sub-dependencies](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} requiring each other (as parameters of the function definitions), some of them might be created with `async def` and some with normal `def`. It would still work, and the ones created with normal `def` would be called on an external thread (from the threadpool) instead of being "awaited".
+You can have multiple dependencies and [sub-dependencies](tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} requiring each other (as parameters of the function definitions), some of them might be created with `async def` and some with normal `def`. It would still work, and the ones created with normal `def` would be called on an external thread (from the threadpool) instead of being "awaited".
### Other utility functions
diff --git a/docs/en/docs/benchmarks.md b/docs/en/docs/benchmarks.md
index d746b6d7c..62266c449 100644
--- a/docs/en/docs/benchmarks.md
+++ b/docs/en/docs/benchmarks.md
@@ -1,6 +1,6 @@
# Benchmarks
-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). (*)
+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).
But when checking benchmarks and comparisons you should keep the following in mind.
diff --git a/docs/en/docs/css/custom.css b/docs/en/docs/css/custom.css
index 187040792..386aa9d7e 100644
--- a/docs/en/docs/css/custom.css
+++ b/docs/en/docs/css/custom.css
@@ -136,10 +136,6 @@ code {
display: inline-block;
}
-.md-content__inner h1 {
- direction: ltr !important;
-}
-
.illustration {
margin-top: 2em;
margin-bottom: 2em;
diff --git a/docs/en/docs/deployment/cloud.md b/docs/en/docs/deployment/cloud.md
index b2836aeb4..d34fbe2f7 100644
--- a/docs/en/docs/deployment/cloud.md
+++ b/docs/en/docs/deployment/cloud.md
@@ -14,4 +14,4 @@ You might want to try their services and follow their guides:
* Platform.sh
* Porter
-* Deta
+* Coherence
diff --git a/docs/en/docs/deployment/concepts.md b/docs/en/docs/deployment/concepts.md
index cc01fb24e..b771ae663 100644
--- a/docs/en/docs/deployment/concepts.md
+++ b/docs/en/docs/deployment/concepts.md
@@ -25,7 +25,7 @@ But for now, let's check these important **conceptual ideas**. These concepts al
## Security - HTTPS
-In the [previous chapter about HTTPS](./https.md){.internal-link target=_blank} we learned about how HTTPS provides encryption for your API.
+In the [previous chapter about HTTPS](https.md){.internal-link target=_blank} we learned about how HTTPS provides encryption for your API.
We also saw that HTTPS is normally provided by a component **external** to your application server, a **TLS Termination Proxy**.
@@ -187,7 +187,7 @@ When you run **multiple processes** of the same API program, they are commonly c
### Worker Processes and Ports
-Remember from the docs [About HTTPS](./https.md){.internal-link target=_blank} that only one process can be listening on one combination of port and IP address in a server?
+Remember from the docs [About HTTPS](https.md){.internal-link target=_blank} that only one process can be listening on one combination of port and IP address in a server?
This is still true.
@@ -230,18 +230,18 @@ The main constraint to consider is that there has to be a **single** component h
Here are some possible combinations and strategies:
* **Gunicorn** managing **Uvicorn workers**
- * Gunicorn would be the **process manager** listening on the **IP** and **port**, the replication would be by having **multiple Uvicorn worker processes**
+ * Gunicorn would be the **process manager** listening on the **IP** and **port**, the replication would be by having **multiple Uvicorn worker processes**.
* **Uvicorn** managing **Uvicorn workers**
- * One Uvicorn **process manager** would listen on the **IP** and **port**, and it would start **multiple Uvicorn worker processes**
+ * One Uvicorn **process manager** would listen on the **IP** and **port**, and it would start **multiple Uvicorn worker processes**.
* **Kubernetes** and other distributed **container systems**
- * Something in the **Kubernetes** layer would listen on the **IP** and **port**. The replication would be by having **multiple containers**, each with **one Uvicorn process** running
+ * Something in the **Kubernetes** layer would listen on the **IP** and **port**. The replication would be by having **multiple containers**, each with **one Uvicorn process** running.
* **Cloud services** that handle this for you
* The cloud service will probably **handle replication for you**. It would possibly let you define **a process to run**, or a **container image** to use, in any case, it would most probably be **a single Uvicorn process**, and the cloud service would be in charge of replicating it.
!!! tip
Don't worry if some of these items about **containers**, Docker, or Kubernetes don't make a lot of sense yet.
- I'll tell you more about container images, Docker, Kubernetes, etc. in a future chapter: [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank}.
+ I'll tell you more about container images, Docker, Kubernetes, etc. in a future chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}.
## Previous Steps Before Starting
@@ -273,7 +273,7 @@ Here are some possible ideas:
* You would still need a way to start/restart *that* bash script, detect errors, etc.
!!! tip
- I'll give you more concrete examples for doing this with containers in a future chapter: [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank}.
+ I'll give you more concrete examples for doing this with containers in a future chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}.
## Resource Utilization
diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md
index 8a542622e..467ba72de 100644
--- a/docs/en/docs/deployment/docker.md
+++ b/docs/en/docs/deployment/docker.md
@@ -108,7 +108,7 @@ It would depend mainly on the tool you use to **install** those requirements.
The most common way to do it is to have a file `requirements.txt` with the package names and their versions, one per line.
-You would of course use the same ideas you read in [About FastAPI versions](./versions.md){.internal-link target=_blank} to set the ranges of versions.
+You would of course use the same ideas you read in [About FastAPI versions](versions.md){.internal-link target=_blank} to set the ranges of versions.
For example, your `requirements.txt` could look like:
@@ -373,7 +373,7 @@ Then adjust the Uvicorn command to use the new module `main` instead of `app.mai
## Deployment Concepts
-Let's talk again about some of the same [Deployment Concepts](./concepts.md){.internal-link target=_blank} in terms of containers.
+Let's talk again about some of the same [Deployment Concepts](concepts.md){.internal-link target=_blank} in terms of containers.
Containers are mainly a tool to simplify the process of **building and deploying** an application, but they don't enforce a particular approach to handle these **deployment concepts**, and there are several possible strategies.
@@ -514,7 +514,7 @@ If you have a simple setup, with a **single container** that then starts multipl
## Official Docker Image with Gunicorn - Uvicorn
-There is an official Docker image that includes Gunicorn running with Uvicorn workers, as detailed in a previous chapter: [Server Workers - Gunicorn with Uvicorn](./server-workers.md){.internal-link target=_blank}.
+There is an official Docker image that includes Gunicorn running with Uvicorn workers, as detailed in a previous chapter: [Server Workers - Gunicorn with Uvicorn](server-workers.md){.internal-link target=_blank}.
This image would be useful mainly in the situations described above in: [Containers with Multiple Processes and Special Cases](#containers-with-multiple-processes-and-special-cases).
diff --git a/docs/en/docs/deployment/server-workers.md b/docs/en/docs/deployment/server-workers.md
index 2df9f3d43..5fe2309a9 100644
--- a/docs/en/docs/deployment/server-workers.md
+++ b/docs/en/docs/deployment/server-workers.md
@@ -13,12 +13,12 @@ Up to this point, with all the tutorials in the docs, you have probably been run
When deploying applications you will probably want to have some **replication of processes** to take advantage of **multiple cores** and to be able to handle more requests.
-As you saw in the previous chapter about [Deployment Concepts](./concepts.md){.internal-link target=_blank}, there are multiple strategies you can use.
+As you saw in the previous chapter about [Deployment Concepts](concepts.md){.internal-link target=_blank}, there are multiple strategies you can use.
Here I'll show you how to use **Gunicorn** with **Uvicorn worker processes**.
!!! info
- If you are using containers, for example with Docker or Kubernetes, I'll tell you more about that in the next chapter: [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank}.
+ If you are using containers, for example with Docker or Kubernetes, I'll tell you more about that in the next chapter: [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank}.
In particular, when running on **Kubernetes** you will probably **not** want to use Gunicorn and instead run **a single Uvicorn process per container**, but I'll tell you about it later in that chapter.
@@ -165,7 +165,7 @@ From the list of deployment concepts from above, using workers would mainly help
## Containers and Docker
-In the next chapter about [FastAPI in Containers - Docker](./docker.md){.internal-link target=_blank} I'll tell some strategies you could use to handle the other **deployment concepts**.
+In the next chapter about [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank} I'll tell some strategies you could use to handle the other **deployment concepts**.
I'll also show you the **official Docker image** that includes **Gunicorn with Uvicorn workers** and some default configurations that can be useful for simple cases.
diff --git a/docs/en/docs/fastapi-people.md b/docs/en/docs/fastapi-people.md
index 7e26358d8..2bd01ba43 100644
--- a/docs/en/docs/fastapi-people.md
+++ b/docs/en/docs/fastapi-people.md
@@ -7,7 +7,7 @@ hide:
FastAPI has an amazing community that welcomes people from all backgrounds.
-## Creator - Maintainer
+## Creator
Hey! 👋
@@ -23,7 +23,7 @@ This is me:
httpx - Required if you want to use the `TestClient`.
* jinja2 - Required if you want to use the default template configuration.
-* python-multipart - Required if you want to support form "parsing", with `request.form()`.
+* 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).
-* ujson - Required if you want to use `UJSONResponse`.
Used by FastAPI / Starlette:
* uvicorn - for the server that loads and serves your application.
* orjson - Required if you want to use `ORJSONResponse`.
+* ujson - Required if you want to use `UJSONResponse`.
You can install all of these with `pip install "fastapi[all]"`.
diff --git a/docs/en/docs/project-generation.md b/docs/en/docs/project-generation.md
index 8ba34fa11..d142862ee 100644
--- a/docs/en/docs/project-generation.md
+++ b/docs/en/docs/project-generation.md
@@ -1,84 +1,27 @@
-# Project Generation - Template
+# Full Stack FastAPI Template
-You can use a project generator to get started, as it includes a lot of the initial set up, security, database and some API endpoints already done for you.
+Templates, while typically come with a specific setup, are designed to be flexible and customizable. This allows you to modify and adapt them to your project's requirements, making them an excellent starting point. 🏁
-A project generator will always have a very opinionated setup that you should update and adapt for your own needs, but it might be a good starting point for your project.
+You can use this template to get started, as it includes a lot of the initial set up, security, database and some API endpoints already done for you.
-## Full Stack FastAPI PostgreSQL
+GitHub Repository: Full Stack FastAPI Template
-GitHub: https://github.com/tiangolo/full-stack-fastapi-postgresql
+## Full Stack FastAPI Template - Technology Stack and Features
-### Full Stack FastAPI PostgreSQL - Features
-
-* Full **Docker** integration (Docker based).
-* Docker Swarm Mode deployment.
-* **Docker Compose** integration and optimization for local development.
-* **Production ready** Python web server using Uvicorn and Gunicorn.
-* Python **FastAPI** backend:
- * **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic).
- * **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.
- * **Robust**: Get production-ready code. With automatic interactive documentation.
- * **Standards-based**: Based on (and fully compatible with) the open standards for APIs: OpenAPI and JSON Schema.
- * **Many other features** including automatic validation, serialization, interactive documentation, authentication with OAuth2 JWT tokens, etc.
-* **Secure password** hashing by default.
-* **JWT token** authentication.
-* **SQLAlchemy** models (independent of Flask extensions, so they can be used with Celery workers directly).
-* Basic starting models for users (modify and remove as you need).
-* **Alembic** migrations.
-* **CORS** (Cross Origin Resource Sharing).
-* **Celery** worker that can import and use models and code from the rest of the backend selectively.
-* REST backend tests based on **Pytest**, integrated with Docker, so you can test the full API interaction, independent on the database. As it runs in Docker, it can build a new data store from scratch each time (so you can use ElasticSearch, MongoDB, CouchDB, or whatever you want, and just test that the API works).
-* Easy Python integration with **Jupyter Kernels** for remote or in-Docker development with extensions like Atom Hydrogen or Visual Studio Code Jupyter.
-* **Vue** frontend:
- * Generated with Vue CLI.
- * **JWT Authentication** handling.
- * Login view.
- * After login, main dashboard view.
- * Main dashboard with user creation and edition.
- * Self user edition.
- * **Vuex**.
- * **Vue-router**.
- * **Vuetify** for beautiful material design components.
- * **TypeScript**.
- * Docker server based on **Nginx** (configured to play nicely with Vue-router).
- * Docker multi-stage building, so you don't need to save or commit compiled code.
- * Frontend tests ran at build time (can be disabled too).
- * Made as modular as possible, so it works out of the box, but you can re-generate with Vue CLI or create it as you need, and re-use what you want.
-* **PGAdmin** for PostgreSQL database, you can modify it to use PHPMyAdmin and MySQL easily.
-* **Flower** for Celery jobs monitoring.
-* Load balancing between frontend and backend with **Traefik**, so you can have both under the same domain, separated by path, but served by different containers.
-* Traefik integration, including Let's Encrypt **HTTPS** certificates automatic generation.
-* GitLab **CI** (continuous integration), including frontend and backend testing.
-
-## Full Stack FastAPI Couchbase
-
-GitHub: https://github.com/tiangolo/full-stack-fastapi-couchbase
-
-⚠️ **WARNING** ⚠️
-
-If you are starting a new project from scratch, check the alternatives here.
-
-For example, the project generator Full Stack FastAPI PostgreSQL might be a better alternative, as it is actively maintained and used. And it includes all the new features and improvements.
-
-You are still free to use the Couchbase-based generator if you want to, it should probably still work fine, and if you already have a project generated with it that's fine as well (and you probably already updated it to suit your needs).
-
-You can read more about it in the docs for the repo.
-
-## Full Stack FastAPI MongoDB
-
-...might come later, depending on my time availability and other factors. 😅 🎉
-
-## Machine Learning models with spaCy and FastAPI
-
-GitHub: https://github.com/microsoft/cookiecutter-spacy-fastapi
-
-### Machine Learning models with spaCy and FastAPI - Features
-
-* **spaCy** NER model integration.
-* **Azure Cognitive Search** request format built in.
-* **Production ready** Python web server using Uvicorn and Gunicorn.
-* **Azure DevOps** Kubernetes (AKS) CI/CD deployment built in.
-* **Multilingual** Easily choose one of spaCy's built in languages during project setup.
-* **Easily extensible** to other model frameworks (Pytorch, Tensorflow), not just spaCy.
+- ⚡ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.
+ - 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).
+ - 🔍 [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.
+ - 💾 [PostgreSQL](https://www.postgresql.org) as the SQL database.
+- 🚀 [React](https://react.dev) for the frontend.
+ - 💃 Using TypeScript, hooks, Vite, and other parts of a modern frontend stack.
+ - 🎨 [Chakra UI](https://chakra-ui.com) for the frontend components.
+ - 🤖 An automatically generated frontend client.
+ - 🦇 Dark mode support.
+- 🐋 [Docker Compose](https://www.docker.com) for development and production.
+- 🔒 Secure password hashing by default.
+- 🔑 JWT token authentication.
+- 📫 Email based password recovery.
+- ✅ Tests with [Pytest](https://pytest.org).
+- 📞 [Traefik](https://traefik.io) as a reverse proxy / load balancer.
+- 🚢 Deployment instructions using Docker Compose, including how to set up a frontend Traefik proxy to handle automatic HTTPS certificates.
+- 🏭 CI (continuous integration) and CD (continuous deployment) based on GitHub Actions.
diff --git a/docs/en/docs/python-types.md b/docs/en/docs/python-types.md
index cdd22ea4a..3e8267aea 100644
--- a/docs/en/docs/python-types.md
+++ b/docs/en/docs/python-types.md
@@ -186,7 +186,7 @@ For example, let's define a variable to be a `list` of `str`.
From `typing`, import `List` (with a capital `L`):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
@@ -434,7 +434,7 @@ It doesn't mean "`one_person` is the **class** called `Person`".
## Pydantic models
-Pydantic is a Python library to perform data validation.
+Pydantic is a Python library to perform data validation.
You declare the "shape" of the data as classes with attributes.
@@ -465,14 +465,14 @@ An example from the official Pydantic docs:
```
!!! info
- To learn more about Pydantic, check its docs.
+ To learn more about Pydantic, check its docs.
**FastAPI** is all based on Pydantic.
You will see a lot more of all this in practice in the [Tutorial - User Guide](tutorial/index.md){.internal-link target=_blank}.
!!! tip
- Pydantic has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about Required Optional fields.
+ Pydantic has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about Required Optional fields.
## Type Hints with Metadata Annotations
diff --git a/docs/en/docs/reference/apirouter.md b/docs/en/docs/reference/apirouter.md
index b779ad291..d77364e45 100644
--- a/docs/en/docs/reference/apirouter.md
+++ b/docs/en/docs/reference/apirouter.md
@@ -1,7 +1,6 @@
# `APIRouter` class
-Here's the reference information for the `APIRouter` class, with all its parameters,
-attributes and methods.
+Here's the reference information for the `APIRouter` class, with all its parameters, attributes and methods.
You can import the `APIRouter` class directly from `fastapi`:
diff --git a/docs/en/docs/reference/background.md b/docs/en/docs/reference/background.md
index e0c0be899..f65619590 100644
--- a/docs/en/docs/reference/background.md
+++ b/docs/en/docs/reference/background.md
@@ -1,8 +1,6 @@
# Background Tasks - `BackgroundTasks`
-You can declare a parameter in a *path operation function* or dependency function
-with the type `BackgroundTasks`, and then you can use it to schedule the execution
-of background tasks after the response is sent.
+You can declare a parameter in a *path operation function* or dependency function with the type `BackgroundTasks`, and then you can use it to schedule the execution of background tasks after the response is sent.
You can import it directly from `fastapi`:
diff --git a/docs/en/docs/reference/dependencies.md b/docs/en/docs/reference/dependencies.md
index 099968267..2959a21da 100644
--- a/docs/en/docs/reference/dependencies.md
+++ b/docs/en/docs/reference/dependencies.md
@@ -2,8 +2,7 @@
## `Depends()`
-Dependencies are handled mainly with the special function `Depends()` that takes a
-callable.
+Dependencies are handled mainly with the special function `Depends()` that takes a callable.
Here is the reference for it and its parameters.
@@ -17,11 +16,9 @@ from fastapi import Depends
## `Security()`
-For many scenarios, you can handle security (authorization, authentication, etc.) with
-dependencies, using `Depends()`.
+For many scenarios, you can handle security (authorization, authentication, etc.) with dependencies, using `Depends()`.
-But when you want to also declare OAuth2 scopes, you can use `Security()` instead of
-`Depends()`.
+But when you want to also declare OAuth2 scopes, you can use `Security()` instead of `Depends()`.
You can import `Security()` directly from `fastapi`:
diff --git a/docs/en/docs/reference/exceptions.md b/docs/en/docs/reference/exceptions.md
index 7c4808349..1392d2a80 100644
--- a/docs/en/docs/reference/exceptions.md
+++ b/docs/en/docs/reference/exceptions.md
@@ -2,9 +2,7 @@
These are the exceptions that you can raise to show errors to the client.
-When you raise an exception, as would happen with normal Python, the rest of the
-execution is aborted. This way you can raise these exceptions from anywhere in the
-code to abort a request and show the error to the client.
+When you raise an exception, as would happen with normal Python, the rest of the execution is aborted. This way you can raise these exceptions from anywhere in the code to abort a request and show the error to the client.
You can use:
diff --git a/docs/en/docs/reference/fastapi.md b/docs/en/docs/reference/fastapi.md
index 8b87664cb..d5367ff34 100644
--- a/docs/en/docs/reference/fastapi.md
+++ b/docs/en/docs/reference/fastapi.md
@@ -1,7 +1,6 @@
# `FastAPI` class
-Here's the reference information for the `FastAPI` class, with all its parameters,
-attributes and methods.
+Here's the reference information for the `FastAPI` class, with all its parameters, attributes and methods.
You can import the `FastAPI` class directly from `fastapi`:
diff --git a/docs/en/docs/reference/httpconnection.md b/docs/en/docs/reference/httpconnection.md
index 43dfc46f9..b7b87871a 100644
--- a/docs/en/docs/reference/httpconnection.md
+++ b/docs/en/docs/reference/httpconnection.md
@@ -1,8 +1,6 @@
# `HTTPConnection` class
-When you want to define dependencies that should be compatible with both HTTP and
-WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a
-`Request` or a `WebSocket`.
+When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
You can import it from `fastapi.requests`:
diff --git a/docs/en/docs/reference/middleware.md b/docs/en/docs/reference/middleware.md
index 89704d3c8..3c666ccda 100644
--- a/docs/en/docs/reference/middleware.md
+++ b/docs/en/docs/reference/middleware.md
@@ -2,8 +2,7 @@
There are several middlewares available provided by Starlette directly.
-Read more about them in the
-[FastAPI docs for Middleware](https://fastapi.tiangolo.com/advanced/middleware/).
+Read more about them in the [FastAPI docs for Middleware](https://fastapi.tiangolo.com/advanced/middleware/).
::: fastapi.middleware.cors.CORSMiddleware
diff --git a/docs/en/docs/reference/parameters.md b/docs/en/docs/reference/parameters.md
index 8f77f0161..d304c013c 100644
--- a/docs/en/docs/reference/parameters.md
+++ b/docs/en/docs/reference/parameters.md
@@ -2,8 +2,7 @@
Here's the reference information for the request parameters.
-These are the special functions that you can put in *path operation function*
-parameters or dependency functions with `Annotated` to get data from the request.
+These are the special functions that you can put in *path operation function* parameters or dependency functions with `Annotated` to get data from the request.
It includes:
diff --git a/docs/en/docs/reference/request.md b/docs/en/docs/reference/request.md
index 91ec7d37b..0326f3fc7 100644
--- a/docs/en/docs/reference/request.md
+++ b/docs/en/docs/reference/request.md
@@ -1,8 +1,6 @@
# `Request` class
-You can declare a parameter in a *path operation function* or dependency to be of type
-`Request` and then you can access the raw request object directly, without any
-validation, etc.
+You can declare a parameter in a *path operation function* or dependency to be of type `Request` and then you can access the raw request object directly, without any validation, etc.
You can import it directly from `fastapi`:
@@ -11,8 +9,6 @@ from fastapi import Request
```
!!! tip
- When you want to define dependencies that should be compatible with both HTTP and
- WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a
- `Request` or a `WebSocket`.
+ When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
::: fastapi.Request
diff --git a/docs/en/docs/reference/response.md b/docs/en/docs/reference/response.md
index 916254583..00cf2c499 100644
--- a/docs/en/docs/reference/response.md
+++ b/docs/en/docs/reference/response.md
@@ -1,10 +1,8 @@
# `Response` class
-You can declare a parameter in a *path operation function* or dependency to be of type
-`Response` and then you can set data for the response like headers or cookies.
+You can declare a parameter in a *path operation function* or dependency to be of type `Response` and then you can set data for the response like headers or cookies.
-You can also use it directly to create an instance of it and return it from your *path
-operations*.
+You can also use it directly to create an instance of it and return it from your *path operations*.
You can import it directly from `fastapi`:
diff --git a/docs/en/docs/reference/responses.md b/docs/en/docs/reference/responses.md
index 2cbbd8963..46f014fcc 100644
--- a/docs/en/docs/reference/responses.md
+++ b/docs/en/docs/reference/responses.md
@@ -1,10 +1,8 @@
# Custom Response Classes - File, HTML, Redirect, Streaming, etc.
-There are several custom response classes you can use to create an instance and return
-them directly from your *path operations*.
+There are several custom response classes you can use to create an instance and return them directly from your *path operations*.
-Read more about it in the
-[FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
+Read more about it in the [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
You can import them directly from `fastapi.responses`:
diff --git a/docs/en/docs/reference/security/index.md b/docs/en/docs/reference/security/index.md
index ff86e9e30..9a5c5e15f 100644
--- a/docs/en/docs/reference/security/index.md
+++ b/docs/en/docs/reference/security/index.md
@@ -2,12 +2,9 @@
When you need to declare dependencies with OAuth2 scopes you use `Security()`.
-But you still need to define what is the dependable, the callable that you pass as
-a parameter to `Depends()` or `Security()`.
+But you still need to define what is the dependable, the callable that you pass as a parameter to `Depends()` or `Security()`.
-There are multiple tools that you can use to create those dependables, and they get
-integrated into OpenAPI so they are shown in the automatic docs UI, they can be used
-by automatically generated clients and SDKs, etc.
+There are multiple tools that you can use to create those dependables, and they get integrated into OpenAPI so they are shown in the automatic docs UI, they can be used by automatically generated clients and SDKs, etc.
You can import them from `fastapi.security`:
diff --git a/docs/en/docs/reference/staticfiles.md b/docs/en/docs/reference/staticfiles.md
index ce66f17b3..271231078 100644
--- a/docs/en/docs/reference/staticfiles.md
+++ b/docs/en/docs/reference/staticfiles.md
@@ -2,8 +2,7 @@
You can use the `StaticFiles` class to serve static files, like JavaScript, CSS, images, etc.
-Read more about it in the
-[FastAPI docs for Static Files](https://fastapi.tiangolo.com/tutorial/static-files/).
+Read more about it in the [FastAPI docs for Static Files](https://fastapi.tiangolo.com/tutorial/static-files/).
You can import it directly from `fastapi.staticfiles`:
diff --git a/docs/en/docs/reference/status.md b/docs/en/docs/reference/status.md
index a23800792..6e0e816d3 100644
--- a/docs/en/docs/reference/status.md
+++ b/docs/en/docs/reference/status.md
@@ -16,12 +16,9 @@ For example:
* 403: `status.HTTP_403_FORBIDDEN`
* etc.
-It can be convenient to quickly access HTTP (and WebSocket) status codes in your app,
-using autocompletion for the name without having to remember the integer status codes
-by memory.
+It can be convenient to quickly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to remember the integer status codes by memory.
-Read more about it in the
-[FastAPI docs about Response Status Code](https://fastapi.tiangolo.com/tutorial/response-status-code/).
+Read more about it in the [FastAPI docs about Response Status Code](https://fastapi.tiangolo.com/tutorial/response-status-code/).
## Example
diff --git a/docs/en/docs/reference/templating.md b/docs/en/docs/reference/templating.md
index c865badfc..eedfe44d5 100644
--- a/docs/en/docs/reference/templating.md
+++ b/docs/en/docs/reference/templating.md
@@ -2,8 +2,7 @@
You can use the `Jinja2Templates` class to render Jinja templates.
-Read more about it in the
-[FastAPI docs for Templates](https://fastapi.tiangolo.com/advanced/templates/).
+Read more about it in the [FastAPI docs for Templates](https://fastapi.tiangolo.com/advanced/templates/).
You can import it directly from `fastapi.templating`:
diff --git a/docs/en/docs/reference/testclient.md b/docs/en/docs/reference/testclient.md
index e391d964a..2966ed792 100644
--- a/docs/en/docs/reference/testclient.md
+++ b/docs/en/docs/reference/testclient.md
@@ -2,8 +2,7 @@
You can use the `TestClient` class to test FastAPI applications without creating an actual HTTP and socket connection, just communicating directly with the FastAPI code.
-Read more about it in the
-[FastAPI docs for Testing](https://fastapi.tiangolo.com/tutorial/testing/).
+Read more about it in the [FastAPI docs for Testing](https://fastapi.tiangolo.com/tutorial/testing/).
You can import it directly from `fastapi.testclient`:
diff --git a/docs/en/docs/reference/uploadfile.md b/docs/en/docs/reference/uploadfile.md
index 45c644b18..43a753730 100644
--- a/docs/en/docs/reference/uploadfile.md
+++ b/docs/en/docs/reference/uploadfile.md
@@ -1,7 +1,6 @@
# `UploadFile` class
-You can define *path operation function* parameters to be of the type `UploadFile`
-to receive files from the request.
+You can define *path operation function* parameters to be of the type `UploadFile` to receive files from the request.
You can import it directly from `fastapi`:
diff --git a/docs/en/docs/reference/websockets.md b/docs/en/docs/reference/websockets.md
index 2a0469467..d21e81a07 100644
--- a/docs/en/docs/reference/websockets.md
+++ b/docs/en/docs/reference/websockets.md
@@ -1,7 +1,6 @@
# WebSockets
-When defining WebSockets, you normally declare a parameter of type `WebSocket` and
-with it you can read data from the client and send data to it.
+When defining WebSockets, you normally declare a parameter of type `WebSocket` and with it you can read data from the client and send data to it.
It is provided directly by Starlette, but you can import it from `fastapi`:
@@ -10,9 +9,7 @@ from fastapi import WebSocket
```
!!! tip
- When you want to define dependencies that should be compatible with both HTTP and
- WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a
- `Request` or a `WebSocket`.
+ When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an `HTTPConnection` instead of a `Request` or a `WebSocket`.
::: fastapi.WebSocket
options:
@@ -44,8 +41,7 @@ from fastapi import WebSocket
- send_json
- close
-When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch
-it.
+When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
You can import it directly form `fastapi`:
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 5e02e2352..7668a3edf 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,7 +7,333 @@ hide:
## Latest Changes
-* ✏️ Fix Pydantic method name in `docs/en/docs/advanced/path-operation-advanced-configuration.md`. PR [#10826](https://github.com/tiangolo/fastapi/pull/10826) by [@ahmedabdou14](https://github.com/ahmedabdou14).
+### Docs
+
+* ✏️ Fix typo in `security/http.py`. PR [#11455](https://github.com/tiangolo/fastapi/pull/11455) by [@omarmoo5](https://github.com/omarmoo5).
+
+### Translations
+
+* 🌐 Add Spanish translation for cookie-params `docs/es/docs/tutorial/cookie-params.md`. PR [#11410](https://github.com/tiangolo/fastapi/pull/11410) by [@fabianfalon](https://github.com/fabianfalon).
+
+### Internal
+
+* ⬆️ Upgrade MkDocs Material and re-enable cards. PR [#11466](https://github.com/tiangolo/fastapi/pull/11466) by [@tiangolo](https://github.com/tiangolo).
+* ⬆ Bump pillow from 10.2.0 to 10.3.0. PR [#11403](https://github.com/tiangolo/fastapi/pull/11403) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* 🔧 Ungroup dependabot updates. PR [#11465](https://github.com/tiangolo/fastapi/pull/11465) by [@tiangolo](https://github.com/tiangolo).
+
+## 0.110.2
+
+### Fixes
+
+* 🐛 Fix support for query parameters with list types, handle JSON encoding Pydantic `UndefinedType`. PR [#9929](https://github.com/tiangolo/fastapi/pull/9929) by [@arjwilliams](https://github.com/arjwilliams).
+
+### Refactors
+
+* ♻️ Simplify Pydantic configs in OpenAPI models in `fastapi/openapi/models.py`. PR [#10886](https://github.com/tiangolo/fastapi/pull/10886) by [@JoeTanto2](https://github.com/JoeTanto2).
+* ✨ Add support for Pydantic's 2.7 new deprecated Field parameter, remove URL from validation errors response. PR [#11461](https://github.com/tiangolo/fastapi/pull/11461) by [@tiangolo](https://github.com/tiangolo).
+
+### Docs
+
+* 📝 Fix types in examples under `docs_src/extra_data_types`. PR [#10535](https://github.com/tiangolo/fastapi/pull/10535) by [@nilslindemann](https://github.com/nilslindemann).
+* 📝 Update references to UJSON. PR [#11464](https://github.com/tiangolo/fastapi/pull/11464) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Tweak docs and translations links, typos, format. PR [#11389](https://github.com/tiangolo/fastapi/pull/11389) by [@nilslindemann](https://github.com/nilslindemann).
+* 📝 Fix typo in `docs/es/docs/async.md`. PR [#11400](https://github.com/tiangolo/fastapi/pull/11400) by [@fabianfalon](https://github.com/fabianfalon).
+* 📝 Update OpenAPI client generation docs to use `@hey-api/openapi-ts`. PR [#11339](https://github.com/tiangolo/fastapi/pull/11339) by [@jordanshatford](https://github.com/jordanshatford).
+
+### Translations
+
+* 🌐 Update Chinese translation for `docs/zh/docs/index.html`. PR [#11430](https://github.com/tiangolo/fastapi/pull/11430) by [@waketzheng](https://github.com/waketzheng).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. PR [#11411](https://github.com/tiangolo/fastapi/pull/11411) by [@anton2yakovlev](https://github.com/anton2yakovlev).
+* 🌐 Add Portuguese translations for `learn/index.md` `resources/index.md` `help/index.md` `about/index.md`. PR [#10807](https://github.com/tiangolo/fastapi/pull/10807) by [@nazarepiedady](https://github.com/nazarepiedady).
+* 🌐 Update Russian translations for deployments docs. PR [#11271](https://github.com/tiangolo/fastapi/pull/11271) by [@Lufa1u](https://github.com/Lufa1u).
+* 🌐 Add Bengali translations for `docs/bn/docs/python-types.md`. PR [#11376](https://github.com/tiangolo/fastapi/pull/11376) by [@imtiaz101325](https://github.com/imtiaz101325).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/security/simple-oauth2.md`. PR [#5744](https://github.com/tiangolo/fastapi/pull/5744) by [@KdHyeon0661](https://github.com/KdHyeon0661).
+* 🌐 Add Korean translation for `docs/ko/docs/help-fastapi.md`. PR [#4139](https://github.com/tiangolo/fastapi/pull/4139) by [@kty4119](https://github.com/kty4119).
+* 🌐 Add Korean translation for `docs/ko/docs/advanced/events.md`. PR [#5087](https://github.com/tiangolo/fastapi/pull/5087) by [@pers0n4](https://github.com/pers0n4).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/path-operation-configuration.md`. PR [#1954](https://github.com/tiangolo/fastapi/pull/1954) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/request-forms-and-files.md`. PR [#1946](https://github.com/tiangolo/fastapi/pull/1946) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10532](https://github.com/tiangolo/fastapi/pull/10532) by [@AlertRED](https://github.com/AlertRED).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/debugging.md`. PR [#5695](https://github.com/tiangolo/fastapi/pull/5695) by [@JungWooGeon](https://github.com/JungWooGeon).
+
+### Internal
+
+* ⬆️ Upgrade version of typer for docs. PR [#11393](https://github.com/tiangolo/fastapi/pull/11393) by [@tiangolo](https://github.com/tiangolo).
+
+## 0.110.1
+
+### Fixes
+
+* 🐛 Fix parameterless `Depends()` with generics. PR [#9479](https://github.com/tiangolo/fastapi/pull/9479) by [@nzig](https://github.com/nzig).
+
+### Refactors
+
+* ♻️ Update mypy. PR [#11049](https://github.com/tiangolo/fastapi/pull/11049) by [@k0t3n](https://github.com/k0t3n).
+* ♻️ Simplify string format with f-strings in `fastapi/applications.py`. PR [#11335](https://github.com/tiangolo/fastapi/pull/11335) by [@igeni](https://github.com/igeni).
+
+### Upgrades
+
+* ⬆️ Upgrade Starlette to >=0.37.2,<0.38.0, remove Starlette filterwarning for internal tests. PR [#11266](https://github.com/tiangolo/fastapi/pull/11266) by [@nothielf](https://github.com/nothielf).
+
+### Docs
+
+* 📝 Tweak docs and translations links and remove old docs translations. PR [#11381](https://github.com/tiangolo/fastapi/pull/11381) by [@tiangolo](https://github.com/tiangolo).
+* ✏️ Fix typo in `fastapi/security/oauth2.py`. PR [#11368](https://github.com/tiangolo/fastapi/pull/11368) by [@shandongbinzhou](https://github.com/shandongbinzhou).
+* 📝 Update links to Pydantic docs to point to new website. PR [#11328](https://github.com/tiangolo/fastapi/pull/11328) by [@alejsdev](https://github.com/alejsdev).
+* ✏️ Fix typo in `docs/en/docs/tutorial/extra-models.md`. PR [#11329](https://github.com/tiangolo/fastapi/pull/11329) by [@alejsdev](https://github.com/alejsdev).
+* 📝 Update `project-generation.md`. PR [#11326](https://github.com/tiangolo/fastapi/pull/11326) by [@alejsdev](https://github.com/alejsdev).
+* 📝 Update External Links. PR [#11327](https://github.com/tiangolo/fastapi/pull/11327) by [@alejsdev](https://github.com/alejsdev).
+* 🔥 Remove link to Pydantic's benchmark, on other i18n pages.. PR [#11224](https://github.com/tiangolo/fastapi/pull/11224) by [@hirotoKirimaru](https://github.com/hirotoKirimaru).
+* ✏️ Fix typos in docstrings. PR [#11295](https://github.com/tiangolo/fastapi/pull/11295) by [@davidhuser](https://github.com/davidhuser).
+* 🛠️ Improve Node.js script in docs to generate TypeScript clients. PR [#11293](https://github.com/tiangolo/fastapi/pull/11293) by [@alejsdev](https://github.com/alejsdev).
+* 📝 Update examples for tests to replace "inexistent" for "nonexistent". PR [#11220](https://github.com/tiangolo/fastapi/pull/11220) by [@Homesteady](https://github.com/Homesteady).
+* 📝 Update `python-multipart` GitHub link in all docs from `https://andrew-d.github.io/python-multipart/` to `https://github.com/Kludex/python-multipart`. PR [#11239](https://github.com/tiangolo/fastapi/pull/11239) by [@joshjhans](https://github.com/joshjhans).
+
+### Translations
+
+* 🌐 Add German translation for `docs/de/docs/tutorial/response-status-code.md`. PR [#10357](https://github.com/tiangolo/fastapi/pull/10357) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/query-params.md`. PR [#3480](https://github.com/tiangolo/fastapi/pull/3480) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/body.md`. PR [#3481](https://github.com/tiangolo/fastapi/pull/3481) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/path-params.md`. PR [#3479](https://github.com/tiangolo/fastapi/pull/3479) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/tutorial/body-fields.md`. PR [#3496](https://github.com/tiangolo/fastapi/pull/3496) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/tutorial/extra-models.md`. PR [#3497](https://github.com/tiangolo/fastapi/pull/3497) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/metadata.md`. PR [#2667](https://github.com/tiangolo/fastapi/pull/2667) by [@tokusumi](https://github.com/tokusumi).
+* 🌐 Add German translation for `docs/de/docs/contributing.md`. PR [#10487](https://github.com/tiangolo/fastapi/pull/10487) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update Japanese translation of `docs/ja/docs/tutorial/query-params.md`. PR [#10808](https://github.com/tiangolo/fastapi/pull/10808) by [@urushio](https://github.com/urushio).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/security/get-current-user.md`. PR [#3842](https://github.com/tiangolo/fastapi/pull/3842) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/openapi-callbacks.md`. PR [#3825](https://github.com/tiangolo/fastapi/pull/3825) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/extending-openapi.md`. PR [#3823](https://github.com/tiangolo/fastapi/pull/3823) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/testing-dependencies.md`. PR [#3819](https://github.com/tiangolo/fastapi/pull/3819) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/custom-request-and-route.md`. PR [#3816](https://github.com/tiangolo/fastapi/pull/3816) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/external-links.md`. PR [#3833](https://github.com/tiangolo/fastapi/pull/3833) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/templates.md`. PR [#3812](https://github.com/tiangolo/fastapi/pull/3812) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/sub-applications.md`. PR [#3811](https://github.com/tiangolo/fastapi/pull/3811) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/async-sql-databases.md`. PR [#3805](https://github.com/tiangolo/fastapi/pull/3805) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/middleware.md`. PR [#3804](https://github.com/tiangolo/fastapi/pull/3804) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/dataclasses.md`. PR [#3803](https://github.com/tiangolo/fastapi/pull/3803) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/using-request-directly.md`. PR [#3802](https://github.com/tiangolo/fastapi/pull/3802) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/security/http-basic-auth.md`. PR [#3801](https://github.com/tiangolo/fastapi/pull/3801) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/security/oauth2-scopes.md`. PR [#3800](https://github.com/tiangolo/fastapi/pull/3800) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/cookie-params.md`. PR [#3486](https://github.com/tiangolo/fastapi/pull/3486) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/header-params.md`. PR [#3487](https://github.com/tiangolo/fastapi/pull/3487) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Update Chinese translation for `docs/tutorial/response-status-code.md`. PR [#3498](https://github.com/tiangolo/fastapi/pull/3498) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add German translation for `docs/de/docs/tutorial/security/first-steps.md`. PR [#10432](https://github.com/tiangolo/fastapi/pull/10432) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/events.md`. PR [#10693](https://github.com/tiangolo/fastapi/pull/10693) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/cloud.md`. PR [#10746](https://github.com/tiangolo/fastapi/pull/10746) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/behind-a-proxy.md`. PR [#10675](https://github.com/tiangolo/fastapi/pull/10675) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/help-fastapi.md`. PR [#10455](https://github.com/tiangolo/fastapi/pull/10455) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update German translation for `docs/de/docs/python-types.md`. PR [#10287](https://github.com/tiangolo/fastapi/pull/10287) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/path-params.md`. PR [#10290](https://github.com/tiangolo/fastapi/pull/10290) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/handling-errors.md`. PR [#10379](https://github.com/tiangolo/fastapi/pull/10379) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update German translation for `docs/de/docs/index.md`. PR [#10283](https://github.com/tiangolo/fastapi/pull/10283) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/security/http-basic-auth.md`. PR [#10651](https://github.com/tiangolo/fastapi/pull/10651) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/bigger-applications.md`. PR [#10554](https://github.com/tiangolo/fastapi/pull/10554) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/path-operation-advanced-configuration.md`. PR [#10612](https://github.com/tiangolo/fastapi/pull/10612) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/static-files.md`. PR [#10584](https://github.com/tiangolo/fastapi/pull/10584) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/security/oauth2-jwt.md`. PR [#10522](https://github.com/tiangolo/fastapi/pull/10522) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/response-model.md`. PR [#10345](https://github.com/tiangolo/fastapi/pull/10345) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/extra-models.md`. PR [#10351](https://github.com/tiangolo/fastapi/pull/10351) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/body-updates.md`. PR [#10396](https://github.com/tiangolo/fastapi/pull/10396) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/alternatives.md`. PR [#10855](https://github.com/tiangolo/fastapi/pull/10855) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/templates.md`. PR [#10678](https://github.com/tiangolo/fastapi/pull/10678) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/security/oauth2-scopes.md`. PR [#10643](https://github.com/tiangolo/fastapi/pull/10643) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/async-tests.md`. PR [#10708](https://github.com/tiangolo/fastapi/pull/10708) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/metadata.md`. PR [#10581](https://github.com/tiangolo/fastapi/pull/10581) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/testing.md`. PR [#10586](https://github.com/tiangolo/fastapi/pull/10586) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/schema-extra-example.md`. PR [#10597](https://github.com/tiangolo/fastapi/pull/10597) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/index.md`. PR [#10611](https://github.com/tiangolo/fastapi/pull/10611) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/response-directly.md`. PR [#10618](https://github.com/tiangolo/fastapi/pull/10618) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/additional-responses.md`. PR [#10626](https://github.com/tiangolo/fastapi/pull/10626) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/response-cookies.md`. PR [#10627](https://github.com/tiangolo/fastapi/pull/10627) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/response-headers.md`. PR [#10628](https://github.com/tiangolo/fastapi/pull/10628) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/response-change-status-code.md`. PR [#10632](https://github.com/tiangolo/fastapi/pull/10632) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/advanced-dependencies.md`. PR [#10633](https://github.com/tiangolo/fastapi/pull/10633) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/security/index.md`. PR [#10635](https://github.com/tiangolo/fastapi/pull/10635) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/using-request-directly.md`. PR [#10653](https://github.com/tiangolo/fastapi/pull/10653) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/dataclasses.md`. PR [#10667](https://github.com/tiangolo/fastapi/pull/10667) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/middleware.md`. PR [#10668](https://github.com/tiangolo/fastapi/pull/10668) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/sub-applications.md`. PR [#10671](https://github.com/tiangolo/fastapi/pull/10671) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/websockets.md`. PR [#10687](https://github.com/tiangolo/fastapi/pull/10687) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/testing-websockets.md`. PR [#10703](https://github.com/tiangolo/fastapi/pull/10703) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/testing-events.md`. PR [#10704](https://github.com/tiangolo/fastapi/pull/10704) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/testing-dependencies.md`. PR [#10706](https://github.com/tiangolo/fastapi/pull/10706) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/openapi-callbacks.md`. PR [#10710](https://github.com/tiangolo/fastapi/pull/10710) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/settings.md`. PR [#10709](https://github.com/tiangolo/fastapi/pull/10709) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/wsgi.md`. PR [#10713](https://github.com/tiangolo/fastapi/pull/10713) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/index.md`. PR [#10733](https://github.com/tiangolo/fastapi/pull/10733) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/https.md`. PR [#10737](https://github.com/tiangolo/fastapi/pull/10737) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/manually.md`. PR [#10738](https://github.com/tiangolo/fastapi/pull/10738) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/concepts.md`. PR [#10744](https://github.com/tiangolo/fastapi/pull/10744) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update German translation for `docs/de/docs/features.md`. PR [#10284](https://github.com/tiangolo/fastapi/pull/10284) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/server-workers.md`. PR [#10747](https://github.com/tiangolo/fastapi/pull/10747) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/docker.md`. PR [#10759](https://github.com/tiangolo/fastapi/pull/10759) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/index.md`. PR [#10769](https://github.com/tiangolo/fastapi/pull/10769) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/general.md`. PR [#10770](https://github.com/tiangolo/fastapi/pull/10770) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/graphql.md`. PR [#10788](https://github.com/tiangolo/fastapi/pull/10788) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/custom-request-and-route.md`. PR [#10789](https://github.com/tiangolo/fastapi/pull/10789) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/conditional-openapi.md`. PR [#10790](https://github.com/tiangolo/fastapi/pull/10790) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/separate-openapi-schemas.md`. PR [#10796](https://github.com/tiangolo/fastapi/pull/10796) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/configure-swagger-ui.md`. PR [#10804](https://github.com/tiangolo/fastapi/pull/10804) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/how-to/custom-docs-ui-assets.md`. PR [#10803](https://github.com/tiangolo/fastapi/pull/10803) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/parameters.md`. PR [#10814](https://github.com/tiangolo/fastapi/pull/10814) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/status.md`. PR [#10815](https://github.com/tiangolo/fastapi/pull/10815) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/uploadfile.md`. PR [#10816](https://github.com/tiangolo/fastapi/pull/10816) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/exceptions.md`. PR [#10817](https://github.com/tiangolo/fastapi/pull/10817) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/dependencies.md`. PR [#10818](https://github.com/tiangolo/fastapi/pull/10818) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/apirouter.md`. PR [#10819](https://github.com/tiangolo/fastapi/pull/10819) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/websockets.md`. PR [#10822](https://github.com/tiangolo/fastapi/pull/10822) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/httpconnection.md`. PR [#10823](https://github.com/tiangolo/fastapi/pull/10823) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/response.md`. PR [#10824](https://github.com/tiangolo/fastapi/pull/10824) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/middleware.md`. PR [#10837](https://github.com/tiangolo/fastapi/pull/10837) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/openapi/*.md`. PR [#10838](https://github.com/tiangolo/fastapi/pull/10838) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/security/index.md`. PR [#10839](https://github.com/tiangolo/fastapi/pull/10839) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/staticfiles.md`. PR [#10841](https://github.com/tiangolo/fastapi/pull/10841) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/testclient.md`. PR [#10843](https://github.com/tiangolo/fastapi/pull/10843) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/project-generation.md`. PR [#10851](https://github.com/tiangolo/fastapi/pull/10851) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/history-design-future.md`. PR [#10865](https://github.com/tiangolo/fastapi/pull/10865) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10422](https://github.com/tiangolo/fastapi/pull/10422) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/dependencies/global-dependencies.md`. PR [#10420](https://github.com/tiangolo/fastapi/pull/10420) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update German translation for `docs/de/docs/fastapi-people.md`. PR [#10285](https://github.com/tiangolo/fastapi/pull/10285) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/dependencies/sub-dependencies.md`. PR [#10409](https://github.com/tiangolo/fastapi/pull/10409) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/security/index.md`. PR [#10429](https://github.com/tiangolo/fastapi/pull/10429) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. PR [#10411](https://github.com/tiangolo/fastapi/pull/10411) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/extra-data-types.md`. PR [#10534](https://github.com/tiangolo/fastapi/pull/10534) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/security/simple-oauth2.md`. PR [#10504](https://github.com/tiangolo/fastapi/pull/10504) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/security/get-current-user.md`. PR [#10439](https://github.com/tiangolo/fastapi/pull/10439) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/request-forms-and-files.md`. PR [#10368](https://github.com/tiangolo/fastapi/pull/10368) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/encoder.md`. PR [#10385](https://github.com/tiangolo/fastapi/pull/10385) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/request-forms.md`. PR [#10361](https://github.com/tiangolo/fastapi/pull/10361) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/deployment/versions.md`. PR [#10491](https://github.com/tiangolo/fastapi/pull/10491) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/async.md`. PR [#10449](https://github.com/tiangolo/fastapi/pull/10449) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/cookie-params.md`. PR [#10323](https://github.com/tiangolo/fastapi/pull/10323) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/dependencies/classes-as-dependencies.md`. PR [#10407](https://github.com/tiangolo/fastapi/pull/10407) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/dependencies/index.md`. PR [#10399](https://github.com/tiangolo/fastapi/pull/10399) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/header-params.md`. PR [#10326](https://github.com/tiangolo/fastapi/pull/10326) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/path-params-numeric-validations.md`. PR [#10307](https://github.com/tiangolo/fastapi/pull/10307) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/query-params-str-validations.md`. PR [#10304](https://github.com/tiangolo/fastapi/pull/10304) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/request-files.md`. PR [#10364](https://github.com/tiangolo/fastapi/pull/10364) by [@nilslindemann](https://github.com/nilslindemann).
+* :globe_with_meridians: Add Portuguese translation for `docs/pt/docs/advanced/templates.md`. PR [#11338](https://github.com/tiangolo/fastapi/pull/11338) by [@SamuelBFavarin](https://github.com/SamuelBFavarin).
+* 🌐 Add Bengali translations for `docs/bn/docs/learn/index.md`. PR [#11337](https://github.com/tiangolo/fastapi/pull/11337) by [@imtiaz101325](https://github.com/imtiaz101325).
+* 🌐 Fix Korean translation for `docs/ko/docs/index.md`. PR [#11296](https://github.com/tiangolo/fastapi/pull/11296) by [@choi-haram](https://github.com/choi-haram).
+* 🌐 Add Korean translation for `docs/ko/docs/about/index.md`. PR [#11299](https://github.com/tiangolo/fastapi/pull/11299) by [@choi-haram](https://github.com/choi-haram).
+* 🌐 Add Korean translation for `docs/ko/docs/advanced/index.md`. PR [#9613](https://github.com/tiangolo/fastapi/pull/9613) by [@ElliottLarsen](https://github.com/ElliottLarsen).
+* 🌐 Add German translation for `docs/de/docs/how-to/extending-openapi.md`. PR [#10794](https://github.com/tiangolo/fastapi/pull/10794) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/metadata.md`. PR [#11286](https://github.com/tiangolo/fastapi/pull/11286) by [@jackleeio](https://github.com/jackleeio).
+* 🌐 Update Chinese translation for `docs/zh/docs/contributing.md`. PR [#10887](https://github.com/tiangolo/fastapi/pull/10887) by [@Aruelius](https://github.com/Aruelius).
+* 🌐 Add Azerbaijani translation for `docs/az/docs/fastapi-people.md`. PR [#11195](https://github.com/tiangolo/fastapi/pull/11195) by [@vusallyv](https://github.com/vusallyv).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/dependencies/index.md`. PR [#11223](https://github.com/tiangolo/fastapi/pull/11223) by [@kohiry](https://github.com/kohiry).
+* 🌐 Update Chinese translation for `docs/zh/docs/tutorial/query-params.md`. PR [#11242](https://github.com/tiangolo/fastapi/pull/11242) by [@jackleeio](https://github.com/jackleeio).
+* 🌐 Add Azerbaijani translation for `docs/az/learn/index.md`. PR [#11192](https://github.com/tiangolo/fastapi/pull/11192) by [@vusallyv](https://github.com/vusallyv).
+
+### Internal
+
+* 👥 Update FastAPI People. PR [#11387](https://github.com/tiangolo/fastapi/pull/11387) by [@tiangolo](https://github.com/tiangolo).
+* ⬆ Bump actions/cache from 3 to 4. PR [#10988](https://github.com/tiangolo/fastapi/pull/10988) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.11 to 1.8.14. PR [#11318](https://github.com/tiangolo/fastapi/pull/11318) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ⬆ Bump pillow from 10.1.0 to 10.2.0. PR [#11011](https://github.com/tiangolo/fastapi/pull/11011) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ⬆ Bump black from 23.3.0 to 24.3.0. PR [#11325](https://github.com/tiangolo/fastapi/pull/11325) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* 👷 Add cron to run test once a week on monday. PR [#11377](https://github.com/tiangolo/fastapi/pull/11377) by [@estebanx64](https://github.com/estebanx64).
+* ➕ Replace mkdocs-markdownextradata-plugin with mkdocs-macros-plugin. PR [#11383](https://github.com/tiangolo/fastapi/pull/11383) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Disable MkDocs insiders social plugin while an issue in MkDocs Material is handled. PR [#11373](https://github.com/tiangolo/fastapi/pull/11373) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Fix logic for when to install and use MkDocs Insiders. PR [#11372](https://github.com/tiangolo/fastapi/pull/11372) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Do not use Python packages cache for publish. PR [#11366](https://github.com/tiangolo/fastapi/pull/11366) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Add CI to test sdists for redistribution (e.g. Linux distros). PR [#11365](https://github.com/tiangolo/fastapi/pull/11365) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Update build-docs GitHub Action path filter. PR [#11354](https://github.com/tiangolo/fastapi/pull/11354) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update Ruff config, add extra ignore rule from SQLModel. PR [#11353](https://github.com/tiangolo/fastapi/pull/11353) by [@tiangolo](https://github.com/tiangolo).
+* ⬆️ Upgrade configuration for Ruff v0.2.0. PR [#11075](https://github.com/tiangolo/fastapi/pull/11075) by [@charliermarsh](https://github.com/charliermarsh).
+* 🔧 Update sponsors, add MongoDB. PR [#11346](https://github.com/tiangolo/fastapi/pull/11346) by [@tiangolo](https://github.com/tiangolo).
+* ⬆ Bump dorny/paths-filter from 2 to 3. PR [#11028](https://github.com/tiangolo/fastapi/pull/11028) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ⬆ Bump dawidd6/action-download-artifact from 3.0.0 to 3.1.4. PR [#11310](https://github.com/tiangolo/fastapi/pull/11310) by [@dependabot[bot]](https://github.com/apps/dependabot).
+* ♻️ Refactor computing FastAPI People, include 3 months, 6 months, 1 year, based on comment date, not discussion date. PR [#11304](https://github.com/tiangolo/fastapi/pull/11304) by [@tiangolo](https://github.com/tiangolo).
+* 👥 Update FastAPI People. PR [#11228](https://github.com/tiangolo/fastapi/pull/11228) by [@tiangolo](https://github.com/tiangolo).
+* 🔥 Remove Jina AI QA Bot from the docs. PR [#11268](https://github.com/tiangolo/fastapi/pull/11268) by [@nan-wang](https://github.com/nan-wang).
+* 🔧 Update sponsors, remove Jina, remove Powens, move TestDriven.io. PR [#11213](https://github.com/tiangolo/fastapi/pull/11213) by [@tiangolo](https://github.com/tiangolo).
+
+## 0.110.0
+
+### Breaking Changes
+
+* 🐛 Fix unhandled growing memory for internal server errors, refactor dependencies with `yield` and `except` to require raising again as in regular Python. PR [#11191](https://github.com/tiangolo/fastapi/pull/11191) by [@tiangolo](https://github.com/tiangolo).
+ * This is a breaking change (and only slightly) if you used dependencies with `yield`, used `except` in those dependencies, and didn't raise again.
+ * This was reported internally by [@rushilsrivastava](https://github.com/rushilsrivastava) as a memory leak when the server had unhandled exceptions that would produce internal server errors, the memory allocated before that point would not be released.
+ * Read the new docs: [Dependencies with `yield` and `except`](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#dependencies-with-yield-and-except).
+
+In short, if you had dependencies that looked like:
+
+```Python
+def my_dep():
+ try:
+ yield
+ except SomeException:
+ pass
+```
+
+Now you need to make sure you raise again after `except`, just as you would in regular Python:
+
+```Python
+def my_dep():
+ try:
+ yield
+ except SomeException:
+ raise
+```
+
+### Docs
+
+* ✏️ Fix minor typos in `docs/ko/docs/`. PR [#11126](https://github.com/tiangolo/fastapi/pull/11126) by [@KaniKim](https://github.com/KaniKim).
+* ✏️ Fix minor typo in `fastapi/applications.py`. PR [#11099](https://github.com/tiangolo/fastapi/pull/11099) by [@JacobHayes](https://github.com/JacobHayes).
+
+### Translations
+
+* 🌐 Add German translation for `docs/de/docs/reference/background.md`. PR [#10820](https://github.com/tiangolo/fastapi/pull/10820) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/templating.md`. PR [#10842](https://github.com/tiangolo/fastapi/pull/10842) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/external-links.md`. PR [#10852](https://github.com/tiangolo/fastapi/pull/10852) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Update Turkish translation for `docs/tr/docs/tutorial/query-params.md`. PR [#11162](https://github.com/tiangolo/fastapi/pull/11162) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add German translation for `docs/de/docs/reference/encoders.md`. PR [#10840](https://github.com/tiangolo/fastapi/pull/10840) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/responses.md`. PR [#10825](https://github.com/tiangolo/fastapi/pull/10825) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/reference/request.md`. PR [#10821](https://github.com/tiangolo/fastapi/pull/10821) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add Turkish translation for `docs/tr/docs/tutorial/query-params.md`. PR [#11078](https://github.com/tiangolo/fastapi/pull/11078) by [@emrhnsyts](https://github.com/emrhnsyts).
+* 🌐 Add German translation for `docs/de/docs/reference/fastapi.md`. PR [#10813](https://github.com/tiangolo/fastapi/pull/10813) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/newsletter.md`. PR [#10853](https://github.com/tiangolo/fastapi/pull/10853) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add Traditional Chinese translation for `docs/zh-hant/docs/learn/index.md`. PR [#11142](https://github.com/tiangolo/fastapi/pull/11142) by [@hsuanchi](https://github.com/hsuanchi).
+* 🌐 Add Korean translation for `/docs/ko/docs/tutorial/dependencies/global-dependencies.md`. PR [#11123](https://github.com/tiangolo/fastapi/pull/11123) by [@riroan](https://github.com/riroan).
+* 🌐 Add Korean translation for `/docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. PR [#11124](https://github.com/tiangolo/fastapi/pull/11124) by [@riroan](https://github.com/riroan).
+* 🌐 Add Korean translation for `/docs/ko/docs/tutorial/schema-extra-example.md`. PR [#11121](https://github.com/tiangolo/fastapi/pull/11121) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Add Korean translation for `/docs/ko/docs/tutorial/body-fields.md`. PR [#11112](https://github.com/tiangolo/fastapi/pull/11112) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Add Korean translation for `/docs/ko/docs/tutorial/cookie-params.md`. PR [#11118](https://github.com/tiangolo/fastapi/pull/11118) by [@riroan](https://github.com/riroan).
+* 🌐 Update Korean translation for `/docs/ko/docs/dependencies/index.md`. PR [#11114](https://github.com/tiangolo/fastapi/pull/11114) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Update Korean translation for `/docs/ko/docs/deployment/docker.md`. PR [#11113](https://github.com/tiangolo/fastapi/pull/11113) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Update Turkish translation for `docs/tr/docs/tutorial/first-steps.md`. PR [#11094](https://github.com/tiangolo/fastapi/pull/11094) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add Spanish translation for `docs/es/docs/advanced/security/index.md`. PR [#2278](https://github.com/tiangolo/fastapi/pull/2278) by [@Xaraxx](https://github.com/Xaraxx).
+* 🌐 Add Spanish translation for `docs/es/docs/advanced/response-headers.md`. PR [#2276](https://github.com/tiangolo/fastapi/pull/2276) by [@Xaraxx](https://github.com/Xaraxx).
+* 🌐 Add Spanish translation for `docs/es/docs/deployment/index.md` and `~/deployment/versions.md`. PR [#9669](https://github.com/tiangolo/fastapi/pull/9669) by [@pabloperezmoya](https://github.com/pabloperezmoya).
+* 🌐 Add Spanish translation for `docs/es/docs/benchmarks.md`. PR [#10928](https://github.com/tiangolo/fastapi/pull/10928) by [@pablocm83](https://github.com/pablocm83).
+* 🌐 Add Spanish translation for `docs/es/docs/advanced/response-change-status-code.md`. PR [#11100](https://github.com/tiangolo/fastapi/pull/11100) by [@alejsdev](https://github.com/alejsdev).
+
+## 0.109.2
+
+### Upgrades
+
+* ⬆️ Upgrade version of Starlette to `>= 0.36.3`. PR [#11086](https://github.com/tiangolo/fastapi/pull/11086) by [@tiangolo](https://github.com/tiangolo).
+
+### Translations
+
+* 🌐 Update Turkish translation for `docs/tr/docs/fastapi-people.md`. PR [#10547](https://github.com/tiangolo/fastapi/pull/10547) by [@alperiox](https://github.com/alperiox).
+
+### Internal
+
+* 🍱 Add new FastAPI logo. PR [#11090](https://github.com/tiangolo/fastapi/pull/11090) by [@tiangolo](https://github.com/tiangolo).
+
+## 0.109.1
+
+### Security fixes
+
+* ⬆️ Upgrade minimum version of `python-multipart` to `>=0.0.7` to fix a vulnerability when using form data with a ReDos attack. You can also simply upgrade `python-multipart`.
+
+Read more in the [advisory: Content-Type Header ReDoS](https://github.com/tiangolo/fastapi/security/advisories/GHSA-qf9m-vfgh-m389).
+
+### Features
+
+* ✨ Include HTTP 205 in status codes with no body. PR [#10969](https://github.com/tiangolo/fastapi/pull/10969) by [@tiangolo](https://github.com/tiangolo).
### Refactors
@@ -18,6 +344,13 @@ hide:
### Docs
+* 📝 Tweak wording in `help-fastapi.md`. PR [#11040](https://github.com/tiangolo/fastapi/pull/11040) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Tweak docs for Behind a Proxy. PR [#11038](https://github.com/tiangolo/fastapi/pull/11038) by [@tiangolo](https://github.com/tiangolo).
+* 📝 Add External Link: 10 Tips for adding SQLAlchemy to FastAPI. PR [#11036](https://github.com/tiangolo/fastapi/pull/11036) by [@Donnype](https://github.com/Donnype).
+* 📝 Add External Link: Tips on migrating from Flask to FastAPI and vice-versa. PR [#11029](https://github.com/tiangolo/fastapi/pull/11029) by [@jtemporal](https://github.com/jtemporal).
+* 📝 Deprecate old tutorials: Peewee, Couchbase, encode/databases. PR [#10979](https://github.com/tiangolo/fastapi/pull/10979) by [@tiangolo](https://github.com/tiangolo).
+* ✏️ Fix typo in `fastapi/security/oauth2.py`. PR [#10972](https://github.com/tiangolo/fastapi/pull/10972) by [@RafalSkolasinski](https://github.com/RafalSkolasinski).
+* 📝 Update `HTTPException` details in `docs/en/docs/tutorial/handling-errors.md`. PR [#5418](https://github.com/tiangolo/fastapi/pull/5418) by [@papb](https://github.com/papb).
* ✏️ A few tweaks in `docs/de/docs/tutorial/first-steps.md`. PR [#10959](https://github.com/tiangolo/fastapi/pull/10959) by [@nilslindemann](https://github.com/nilslindemann).
* ✏️ Fix link in `docs/en/docs/advanced/async-tests.md`. PR [#10960](https://github.com/tiangolo/fastapi/pull/10960) by [@nilslindemann](https://github.com/nilslindemann).
* ✏️ Fix typos for Spanish documentation. PR [#10957](https://github.com/tiangolo/fastapi/pull/10957) by [@jlopezlira](https://github.com/jlopezlira).
@@ -35,9 +368,100 @@ hide:
* 📝 Reword in docs, from "have in mind" to "keep in mind". PR [#10376](https://github.com/tiangolo/fastapi/pull/10376) by [@malicious](https://github.com/malicious).
* 📝 Add External Link: Talk by Jeny Sadadia. PR [#10265](https://github.com/tiangolo/fastapi/pull/10265) by [@JenySadadia](https://github.com/JenySadadia).
* 📝 Add location info to `tutorial/bigger-applications.md`. PR [#10552](https://github.com/tiangolo/fastapi/pull/10552) by [@nilslindemann](https://github.com/nilslindemann).
+* ✏️ Fix Pydantic method name in `docs/en/docs/advanced/path-operation-advanced-configuration.md`. PR [#10826](https://github.com/tiangolo/fastapi/pull/10826) by [@ahmedabdou14](https://github.com/ahmedabdou14).
### Translations
+* 🌐 Add Spanish translation for `docs/es/docs/external-links.md`. PR [#10933](https://github.com/tiangolo/fastapi/pull/10933) by [@pablocm83](https://github.com/pablocm83).
+* 🌐 Update Korean translation for `docs/ko/docs/tutorial/first-steps.md`, `docs/ko/docs/tutorial/index.md`, `docs/ko/docs/tutorial/path-params.md`, and `docs/ko/docs/tutorial/query-params.md`. PR [#4218](https://github.com/tiangolo/fastapi/pull/4218) by [@SnowSuno](https://github.com/SnowSuno).
+* 🌐 Add Chinese translation for `docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10870](https://github.com/tiangolo/fastapi/pull/10870) by [@zhiquanchi](https://github.com/zhiquanchi).
+* 🌐 Add Chinese translation for `docs/zh/docs/deployment/concepts.md`. PR [#10282](https://github.com/tiangolo/fastapi/pull/10282) by [@xzmeng](https://github.com/xzmeng).
+* 🌐 Add Azerbaijani translation for `docs/az/docs/index.md`. PR [#11047](https://github.com/tiangolo/fastapi/pull/11047) by [@aykhans](https://github.com/aykhans).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/middleware.md`. PR [#2829](https://github.com/tiangolo/fastapi/pull/2829) by [@JeongHyeongKim](https://github.com/JeongHyeongKim).
+* 🌐 Add German translation for `docs/de/docs/tutorial/body-nested-models.md`. PR [#10313](https://github.com/tiangolo/fastapi/pull/10313) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add Persian translation for `docs/fa/docs/tutorial/middleware.md`. PR [#9695](https://github.com/tiangolo/fastapi/pull/9695) by [@mojtabapaso](https://github.com/mojtabapaso).
+* 🌐 Update Farsi translation for `docs/fa/docs/index.md`. PR [#10216](https://github.com/tiangolo/fastapi/pull/10216) by [@theonlykingpin](https://github.com/theonlykingpin).
+* 🌐 Add German translation for `docs/de/docs/tutorial/body-fields.md`. PR [#10310](https://github.com/tiangolo/fastapi/pull/10310) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/body.md`. PR [#10295](https://github.com/tiangolo/fastapi/pull/10295) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/body-multiple-params.md`. PR [#10308](https://github.com/tiangolo/fastapi/pull/10308) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/security/get-current-user.md`. PR [#2681](https://github.com/tiangolo/fastapi/pull/2681) by [@sh0nk](https://github.com/sh0nk).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/advanced-dependencies.md`. PR [#3798](https://github.com/tiangolo/fastapi/pull/3798) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/events.md`. PR [#3815](https://github.com/tiangolo/fastapi/pull/3815) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/behind-a-proxy.md`. PR [#3820](https://github.com/tiangolo/fastapi/pull/3820) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/testing-events.md`. PR [#3818](https://github.com/tiangolo/fastapi/pull/3818) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/testing-websockets.md`. PR [#3817](https://github.com/tiangolo/fastapi/pull/3817) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/advanced/testing-database.md`. PR [#3821](https://github.com/tiangolo/fastapi/pull/3821) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/deployment/deta.md`. PR [#3837](https://github.com/tiangolo/fastapi/pull/3837) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/history-design-future.md`. PR [#3832](https://github.com/tiangolo/fastapi/pull/3832) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/project-generation.md`. PR [#3831](https://github.com/tiangolo/fastapi/pull/3831) by [@jaystone776](https://github.com/jaystone776).
+* 🌐 Add Chinese translation for `docs/zh/docs/deployment/docker.md`. PR [#10296](https://github.com/tiangolo/fastapi/pull/10296) by [@xzmeng](https://github.com/xzmeng).
+* 🌐 Update Spanish translation for `docs/es/docs/features.md`. PR [#10884](https://github.com/tiangolo/fastapi/pull/10884) by [@pablocm83](https://github.com/pablocm83).
+* 🌐 Add Spanish translation for `docs/es/docs/newsletter.md`. PR [#10922](https://github.com/tiangolo/fastapi/pull/10922) by [@pablocm83](https://github.com/pablocm83).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/background-tasks.md`. PR [#5910](https://github.com/tiangolo/fastapi/pull/5910) by [@junah201](https://github.com/junah201).
+* :globe_with_meridians: Add Turkish translation for `docs/tr/docs/alternatives.md`. PR [#10502](https://github.com/tiangolo/fastapi/pull/10502) by [@alperiox](https://github.com/alperiox).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/dependencies/index.md`. PR [#10989](https://github.com/tiangolo/fastapi/pull/10989) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Add Korean translation for `/docs/ko/docs/tutorial/body.md`. PR [#11000](https://github.com/tiangolo/fastapi/pull/11000) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/schema-extra-example.md`. PR [#4065](https://github.com/tiangolo/fastapi/pull/4065) by [@luccasmmg](https://github.com/luccasmmg).
+* 🌐 Add Turkish translation for `docs/tr/docs/history-design-future.md`. PR [#11012](https://github.com/tiangolo/fastapi/pull/11012) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add Turkish translation for `docs/tr/docs/resources/index.md`. PR [#11020](https://github.com/tiangolo/fastapi/pull/11020) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add Turkish translation for `docs/tr/docs/how-to/index.md`. PR [#11021](https://github.com/tiangolo/fastapi/pull/11021) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add German translation for `docs/de/docs/tutorial/query-params.md`. PR [#10293](https://github.com/tiangolo/fastapi/pull/10293) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/benchmarks.md`. PR [#10866](https://github.com/tiangolo/fastapi/pull/10866) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add Turkish translation for `docs/tr/docs/learn/index.md`. PR [#11014](https://github.com/tiangolo/fastapi/pull/11014) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add Persian translation for `docs/fa/docs/tutorial/security/index.md`. PR [#9945](https://github.com/tiangolo/fastapi/pull/9945) by [@mojtabapaso](https://github.com/mojtabapaso).
+* 🌐 Add Turkish translation for `docs/tr/docs/help/index.md`. PR [#11013](https://github.com/tiangolo/fastapi/pull/11013) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add Turkish translation for `docs/tr/docs/about/index.md`. PR [#11006](https://github.com/tiangolo/fastapi/pull/11006) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Update Turkish translation for `docs/tr/docs/benchmarks.md`. PR [#11005](https://github.com/tiangolo/fastapi/pull/11005) by [@hasansezertasan](https://github.com/hasansezertasan).
+* 🌐 Add Italian translation for `docs/it/docs/index.md`. PR [#5233](https://github.com/tiangolo/fastapi/pull/5233) by [@matteospanio](https://github.com/matteospanio).
+* 🌐 Add Korean translation for `docs/ko/docs/help/index.md`. PR [#10983](https://github.com/tiangolo/fastapi/pull/10983) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Add Korean translation for `docs/ko/docs/features.md`. PR [#10976](https://github.com/tiangolo/fastapi/pull/10976) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/security/get-current-user.md`. PR [#5737](https://github.com/tiangolo/fastapi/pull/5737) by [@KdHyeon0661](https://github.com/KdHyeon0661).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/security/first-steps.md`. PR [#10541](https://github.com/tiangolo/fastapi/pull/10541) by [@AlertRED](https://github.com/AlertRED).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/handling-errors.md`. PR [#10375](https://github.com/tiangolo/fastapi/pull/10375) by [@AlertRED](https://github.com/AlertRED).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/encoder.md`. PR [#10374](https://github.com/tiangolo/fastapi/pull/10374) by [@AlertRED](https://github.com/AlertRED).
+* 🌐 Add Russian translation for `docs/ru/docs/tutorial/body-updates.md`. PR [#10373](https://github.com/tiangolo/fastapi/pull/10373) by [@AlertRED](https://github.com/AlertRED).
+* 🌐 Russian translation: updated `fastapi-people.md`.. PR [#10255](https://github.com/tiangolo/fastapi/pull/10255) by [@NiKuma0](https://github.com/NiKuma0).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/security/index.md`. PR [#5798](https://github.com/tiangolo/fastapi/pull/5798) by [@3w36zj6](https://github.com/3w36zj6).
+* 🌐 Add German translation for `docs/de/docs/advanced/generate-clients.md`. PR [#10725](https://github.com/tiangolo/fastapi/pull/10725) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/openapi-webhooks.md`. PR [#10712](https://github.com/tiangolo/fastapi/pull/10712) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/custom-response.md`. PR [#10624](https://github.com/tiangolo/fastapi/pull/10624) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/advanced/additional-status-codes.md`. PR [#10617](https://github.com/tiangolo/fastapi/pull/10617) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add German translation for `docs/de/docs/tutorial/middleware.md`. PR [#10391](https://github.com/tiangolo/fastapi/pull/10391) by [@JohannesJungbluth](https://github.com/JohannesJungbluth).
+* 🌐 Add German translation for introduction documents. PR [#10497](https://github.com/tiangolo/fastapi/pull/10497) by [@nilslindemann](https://github.com/nilslindemann).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/encoder.md`. PR [#1955](https://github.com/tiangolo/fastapi/pull/1955) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/extra-data-types.md`. PR [#1932](https://github.com/tiangolo/fastapi/pull/1932) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Turkish translation for `docs/tr/docs/async.md`. PR [#5191](https://github.com/tiangolo/fastapi/pull/5191) by [@BilalAlpaslan](https://github.com/BilalAlpaslan).
+* 🌐 Add Turkish translation for `docs/tr/docs/project-generation.md`. PR [#5192](https://github.com/tiangolo/fastapi/pull/5192) by [@BilalAlpaslan](https://github.com/BilalAlpaslan).
+* 🌐 Add Korean translation for `docs/ko/docs/deployment/docker.md`. PR [#5657](https://github.com/tiangolo/fastapi/pull/5657) by [@nearnear](https://github.com/nearnear).
+* 🌐 Add Korean translation for `docs/ko/docs/deployment/server-workers.md`. PR [#4935](https://github.com/tiangolo/fastapi/pull/4935) by [@jujumilk3](https://github.com/jujumilk3).
+* 🌐 Add Korean translation for `docs/ko/docs/deployment/index.md`. PR [#4561](https://github.com/tiangolo/fastapi/pull/4561) by [@jujumilk3](https://github.com/jujumilk3).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/path-operation-configuration.md`. PR [#3639](https://github.com/tiangolo/fastapi/pull/3639) by [@jungsu-kwon](https://github.com/jungsu-kwon).
+* 🌐 Modify the description of `zh` - Traditional Chinese. PR [#10889](https://github.com/tiangolo/fastapi/pull/10889) by [@cherinyy](https://github.com/cherinyy).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/static-files.md`. PR [#2957](https://github.com/tiangolo/fastapi/pull/2957) by [@jeesang7](https://github.com/jeesang7).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/response-model.md`. PR [#2766](https://github.com/tiangolo/fastapi/pull/2766) by [@hard-coders](https://github.com/hard-coders).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/body-multiple-params.md`. PR [#2461](https://github.com/tiangolo/fastapi/pull/2461) by [@PandaHun](https://github.com/PandaHun).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/query-params-str-validations.md`. PR [#2415](https://github.com/tiangolo/fastapi/pull/2415) by [@hard-coders](https://github.com/hard-coders).
+* 🌐 Add Korean translation for `docs/ko/docs/python-types.md`. PR [#2267](https://github.com/tiangolo/fastapi/pull/2267) by [@jrim](https://github.com/jrim).
+* 🌐 Add Korean translation for `docs/ko/docs/tutorial/body-nested-models.md`. PR [#2506](https://github.com/tiangolo/fastapi/pull/2506) by [@hard-coders](https://github.com/hard-coders).
+* 🌐 Add Korean translation for `docs/ko/docs/learn/index.md`. PR [#10977](https://github.com/tiangolo/fastapi/pull/10977) by [@KaniKim](https://github.com/KaniKim).
+* 🌐 Initialize translations for Traditional Chinese. PR [#10505](https://github.com/tiangolo/fastapi/pull/10505) by [@hsuanchi](https://github.com/hsuanchi).
+* ✏️ Tweak the german translation of `docs/de/docs/tutorial/index.md`. PR [#10962](https://github.com/tiangolo/fastapi/pull/10962) by [@nilslindemann](https://github.com/nilslindemann).
+* ✏️ Fix typo error in `docs/ko/docs/tutorial/path-params.md`. PR [#10758](https://github.com/tiangolo/fastapi/pull/10758) by [@2chanhaeng](https://github.com/2chanhaeng).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#1961](https://github.com/tiangolo/fastapi/pull/1961) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md`. PR [#1960](https://github.com/tiangolo/fastapi/pull/1960) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/dependencies/sub-dependencies.md`. PR [#1959](https://github.com/tiangolo/fastapi/pull/1959) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/background-tasks.md`. PR [#2668](https://github.com/tiangolo/fastapi/pull/2668) by [@tokusumi](https://github.com/tokusumi).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/dependencies/index.md` and `docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md`. PR [#1958](https://github.com/tiangolo/fastapi/pull/1958) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/response-model.md`. PR [#1938](https://github.com/tiangolo/fastapi/pull/1938) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/body-multiple-params.md`. PR [#1903](https://github.com/tiangolo/fastapi/pull/1903) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/path-params-numeric-validations.md`. PR [#1902](https://github.com/tiangolo/fastapi/pull/1902) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/python-types.md`. PR [#1899](https://github.com/tiangolo/fastapi/pull/1899) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/handling-errors.md`. PR [#1953](https://github.com/tiangolo/fastapi/pull/1953) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/response-status-code.md`. PR [#1942](https://github.com/tiangolo/fastapi/pull/1942) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/extra-models.md`. PR [#1941](https://github.com/tiangolo/fastapi/pull/1941) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese tranlsation for `docs/ja/docs/tutorial/schema-extra-example.md`. PR [#1931](https://github.com/tiangolo/fastapi/pull/1931) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/body-nested-models.md`. PR [#1930](https://github.com/tiangolo/fastapi/pull/1930) by [@SwftAlpc](https://github.com/SwftAlpc).
+* 🌐 Add Japanese translation for `docs/ja/docs/tutorial/body-fields.md`. PR [#1923](https://github.com/tiangolo/fastapi/pull/1923) by [@SwftAlpc](https://github.com/SwftAlpc).
* 🌐 Add German translation for `docs/de/docs/tutorial/index.md`. PR [#9502](https://github.com/tiangolo/fastapi/pull/9502) by [@fhabers21](https://github.com/fhabers21).
* 🌐 Add German translation for `docs/de/docs/tutorial/background-tasks.md`. PR [#10566](https://github.com/tiangolo/fastapi/pull/10566) by [@nilslindemann](https://github.com/nilslindemann).
* ✏️ Fix typo in `docs/ru/docs/index.md`. PR [#10672](https://github.com/tiangolo/fastapi/pull/10672) by [@Delitel-WEB](https://github.com/Delitel-WEB).
@@ -46,6 +470,17 @@ hide:
### Internal
+* 👥 Update FastAPI People. PR [#11074](https://github.com/tiangolo/fastapi/pull/11074) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors: add Coherence. PR [#11066](https://github.com/tiangolo/fastapi/pull/11066) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Upgrade GitHub Action issue-manager. PR [#11056](https://github.com/tiangolo/fastapi/pull/11056) by [@tiangolo](https://github.com/tiangolo).
+* 🍱 Update sponsors: TalkPython badge. PR [#11052](https://github.com/tiangolo/fastapi/pull/11052) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors: TalkPython badge image. PR [#11048](https://github.com/tiangolo/fastapi/pull/11048) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update sponsors, remove Deta. PR [#11041](https://github.com/tiangolo/fastapi/pull/11041) by [@tiangolo](https://github.com/tiangolo).
+* 💄 Fix CSS breaking RTL languages (erroneously introduced by a previous RTL PR). PR [#11039](https://github.com/tiangolo/fastapi/pull/11039) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Add Italian to `mkdocs.yml`. PR [#11016](https://github.com/tiangolo/fastapi/pull/11016) by [@alejsdev](https://github.com/alejsdev).
+* 🔨 Verify `mkdocs.yml` languages in CI, update `docs.py`. PR [#11009](https://github.com/tiangolo/fastapi/pull/11009) by [@tiangolo](https://github.com/tiangolo).
+* 🔧 Update config in `label-approved.yml` to accept translations with 1 reviewer. PR [#11007](https://github.com/tiangolo/fastapi/pull/11007) by [@alejsdev](https://github.com/alejsdev).
+* 👷 Add changes-requested handling in GitHub Action issue manager. PR [#10971](https://github.com/tiangolo/fastapi/pull/10971) by [@tiangolo](https://github.com/tiangolo).
* 🔧 Group dependencies on dependabot updates. PR [#10952](https://github.com/tiangolo/fastapi/pull/10952) by [@Kludex](https://github.com/Kludex).
* ⬆ Bump actions/setup-python from 4 to 5. PR [#10764](https://github.com/tiangolo/fastapi/pull/10764) by [@dependabot[bot]](https://github.com/apps/dependabot).
* ⬆ Bump pypa/gh-action-pypi-publish from 1.8.10 to 1.8.11. PR [#10731](https://github.com/tiangolo/fastapi/pull/10731) by [@dependabot[bot]](https://github.com/apps/dependabot).
@@ -126,7 +561,7 @@ hide:
### Upgrades
-* ⬆️ Upgrade Starlette to `>=0.29.0,<0.33.0`, update docs and usage of templates with new Starlette arguments. PR [#10846](https://github.com/tiangolo/fastapi/pull/10846) by [@tiangolo](https://github.com/tiangolo).
+* ⬆️ Upgrade Starlette to `>=0.29.0,<0.33.0`, update docs and usage of templates with new Starlette arguments. Remove pin of AnyIO `>=3.7.1,<4.0.0`, add support for AnyIO 4.x.x. PR [#10846](https://github.com/tiangolo/fastapi/pull/10846) by [@tiangolo](https://github.com/tiangolo).
## 0.107.0
@@ -3197,7 +3632,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
* Add support and tests for Pydantic dataclasses in `response_model`. PR [#454](https://github.com/tiangolo/fastapi/pull/454) by [@dconathan](https://github.com/dconathan).
* Fix typo in OAuth2 JWT tutorial. PR [#447](https://github.com/tiangolo/fastapi/pull/447) by [@pablogamboa](https://github.com/pablogamboa).
* Use the `media_type` parameter in `Body()` params to set the media type in OpenAPI for `requestBody`. PR [#439](https://github.com/tiangolo/fastapi/pull/439) by [@divums](https://github.com/divums).
-* Add article [Deploying a scikit-learn model with ONNX and FastAPI](https://medium.com/@nico.axtmann95/deploying-a-scikit-learn-model-with-onnx-und-fastapi-1af398268915) by [https://www.linkedin.com/in/nico-axtmann](Nico Axtmann). PR [#438](https://github.com/tiangolo/fastapi/pull/438) by [@naxty](https://github.com/naxty).
+* Add article [Deploying a scikit-learn model with ONNX and FastAPI](https://medium.com/@nico.axtmann95/deploying-a-scikit-learn-model-with-onnx-und-fastapi-1af398268915) by [Nico Axtmann](https://www.linkedin.com/in/nico-axtmann). PR [#438](https://github.com/tiangolo/fastapi/pull/438) by [@naxty](https://github.com/naxty).
* Allow setting custom `422` (validation error) response/schema in OpenAPI.
* And use media type from response class instead of fixed `application/json` (the default).
* PR [#437](https://github.com/tiangolo/fastapi/pull/437) by [@divums](https://github.com/divums).
@@ -3259,7 +3694,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
* Upgrade Pydantic supported version to `0.29.0`.
* New supported version range is `"pydantic >=0.28,<=0.29.0"`.
- * This adds support for Pydantic [Generic Models](https://pydantic-docs.helpmanual.io/#generic-models), kudos to [@dmontagu](https://github.com/dmontagu).
+ * This adds support for Pydantic [Generic Models](https://docs.pydantic.dev/latest/#generic-models), kudos to [@dmontagu](https://github.com/dmontagu).
* PR [#344](https://github.com/tiangolo/fastapi/pull/344).
## 0.30.1
diff --git a/docs/en/docs/tutorial/bigger-applications.md b/docs/en/docs/tutorial/bigger-applications.md
index b2d928405..eccdd8aeb 100644
--- a/docs/en/docs/tutorial/bigger-applications.md
+++ b/docs/en/docs/tutorial/bigger-applications.md
@@ -136,7 +136,7 @@ We will now use a simple dependency to read a custom `X-Token` header:
!!! tip
We are using an invented header to simplify this example.
- But in real cases you will get better results using the integrated [Security utilities](./security/index.md){.internal-link target=_blank}.
+ But in real cases you will get better results using the integrated [Security utilities](security/index.md){.internal-link target=_blank}.
## Another module with `APIRouter`
@@ -329,7 +329,7 @@ The section:
from .routers import items, users
```
-Means:
+means:
* Starting in the same package that this module (the file `app/main.py`) lives in (the directory `app/`)...
* look for the subpackage `routers` (the directory at `app/routers/`)...
@@ -373,7 +373,7 @@ from .routers.items import router
from .routers.users import router
```
-The `router` from `users` would overwrite the one from `items` and we wouldn't be able to use them at the same time.
+the `router` from `users` would overwrite the one from `items` and we wouldn't be able to use them at the same time.
So, to be able to use both of them in the same file, we import the submodules directly:
diff --git a/docs/en/docs/tutorial/body-nested-models.md b/docs/en/docs/tutorial/body-nested-models.md
index 7058d4ad0..4c199f028 100644
--- a/docs/en/docs/tutorial/body-nested-models.md
+++ b/docs/en/docs/tutorial/body-nested-models.md
@@ -192,7 +192,7 @@ Again, doing just that declaration, with **FastAPI** you get:
Apart from normal singular types like `str`, `int`, `float`, etc. you can use more complex singular types that inherit from `str`.
-To see all the options you have, checkout the docs for Pydantic's exotic types. You will see some examples in the next chapter.
+To see all the options you have, checkout the docs for Pydantic's exotic types. You will see some examples in the next chapter.
For example, as in the `Image` model we have a `url` field, we can declare it to be an instance of Pydantic's `HttpUrl` instead of a `str`:
diff --git a/docs/en/docs/tutorial/body-updates.md b/docs/en/docs/tutorial/body-updates.md
index 39d133c55..3ba2632d8 100644
--- a/docs/en/docs/tutorial/body-updates.md
+++ b/docs/en/docs/tutorial/body-updates.md
@@ -48,7 +48,7 @@ You can also use the Pydantic models with all their power and benefits.
+To declare a **request** body, you use Pydantic models with all their power and benefits.
!!! info
To send data, you should use one of: `POST` (the more common), `PUT`, `DELETE` or `PATCH`.
diff --git a/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md b/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
index 842f2adf6..4b958a665 100644
--- a/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
+++ b/docs/en/docs/tutorial/dependencies/classes-as-dependencies.md
@@ -271,6 +271,12 @@ Now you can declare your dependency using this class.
Notice how we write `CommonQueryParams` twice in the above code:
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
+ ```
+
=== "Python 3.8+ non-Annotated"
!!! tip
@@ -280,12 +286,6 @@ Notice how we write `CommonQueryParams` twice in the above code:
commons: CommonQueryParams = Depends(CommonQueryParams)
```
-=== "Python 3.8+"
-
- ```Python
- commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
- ```
-
The last `CommonQueryParams`, in:
```Python
@@ -334,7 +334,7 @@ You could actually write just:
commons = Depends(CommonQueryParams)
```
-..as in:
+...as in:
=== "Python 3.10+"
@@ -380,6 +380,12 @@ But declaring the type is encouraged as that way your editor will know what will
But you see that we are having some code repetition here, writing `CommonQueryParams` twice:
+=== "Python 3.8+"
+
+ ```Python
+ commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
+ ```
+
=== "Python 3.8+ non-Annotated"
!!! tip
@@ -389,12 +395,6 @@ But you see that we are having some code repetition here, writing `CommonQueryPa
commons: CommonQueryParams = Depends(CommonQueryParams)
```
-=== "Python 3.8+"
-
- ```Python
- commons: Annotated[CommonQueryParams, Depends(CommonQueryParams)]
- ```
-
**FastAPI** provides a shortcut for these cases, in where the dependency is *specifically* a class that **FastAPI** will "call" to create an instance of the class itself.
For those specific cases, you can do the following:
diff --git a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
index de87ba315..ad5aed932 100644
--- a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -162,6 +162,63 @@ The same way, you could raise an `HTTPException` or similar in the exit code, af
An alternative you could use to catch exceptions (and possibly also raise another `HTTPException`) is to create a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+## Dependencies with `yield` and `except`
+
+If you catch an exception using `except` in a dependency with `yield` and you don't raise it again (or raise a new exception), FastAPI won't be able to notice there was an exception, the same way that would happen with regular Python:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="15-16"
+ {!> ../../../docs_src/dependencies/tutorial008c_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="14-15"
+ {!> ../../../docs_src/dependencies/tutorial008c_an.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="13-14"
+ {!> ../../../docs_src/dependencies/tutorial008c.py!}
+ ```
+
+In this case, the client will see an *HTTP 500 Internal Server Error* response as it should, given that we are not raising an `HTTPException` or similar, but the server will **not have any logs** or any other indication of what was the error. 😱
+
+### Always `raise` in Dependencies with `yield` and `except`
+
+If you catch an exception in a dependency with `yield`, unless you are raising another `HTTPException` or similar, you should re-raise the original exception.
+
+You can re-raise the same exception using `raise`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial008d_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/dependencies/tutorial008d_an.py!}
+ ```
+
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="15"
+ {!> ../../../docs_src/dependencies/tutorial008d.py!}
+ ```
+
+Now the client will get the same *HTTP 500 Internal Server Error* response, but the server will have our custom `InternalError` in the logs. 😎
+
## Execution of dependencies with `yield`
The sequence of execution is more or less like this diagram. Time flows from top to bottom. And each column is one of the parts interacting or executing code.
@@ -187,7 +244,6 @@ participant tasks as Background tasks
operation -->> dep: Raise Exception (e.g. HTTPException)
opt handle
dep -->> dep: Can catch exception, raise a new HTTPException, raise other exception
- dep -->> handler: Auto forward exception
end
handler -->> client: HTTP error response
end
@@ -210,15 +266,23 @@ participant tasks as Background tasks
!!! tip
This diagram shows `HTTPException`, but you could also raise any other exception that you catch in a dependency with `yield` or with a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
- If you raise any exception, it will be passed to the dependencies with yield, including `HTTPException`, and then **again** to the exception handlers. If there's no exception handler for that exception, it will then be handled by the default internal `ServerErrorMiddleware`, returning a 500 HTTP status code, to let the client know that there was an error in the server.
+ If you raise any exception, it will be passed to the dependencies with yield, including `HTTPException`. In most cases you will want to re-raise that same exception or a new one from the dependency with `yield` to make sure it's properly handled.
-## Dependencies with `yield`, `HTTPException` and Background Tasks
+## Dependencies with `yield`, `HTTPException`, `except` and Background Tasks
!!! warning
You most probably don't need these technical details, you can skip this section and continue below.
These details are useful mainly if you were using a version of FastAPI prior to 0.106.0 and used resources from dependencies with `yield` in background tasks.
+### Dependencies with `yield` and `except`, Technical Details
+
+Before FastAPI 0.110.0, if you used a dependency with `yield`, and then you captured an exception with `except` in that dependency, and you didn't raise the exception again, the exception would be automatically raised/forwarded to any exception handlers or the internal server error handler.
+
+This was changed in version 0.110.0 to fix unhandled memory consumption from forwarded exceptions without a handler (internal server errors), and to make it consistent with the behavior of regular Python code.
+
+### Background Tasks and Dependencies with `yield`, Technical Details
+
Before FastAPI 0.106.0, raising exceptions after `yield` was not possible, the exit code in dependencies with `yield` was executed *after* the response was sent, so [Exception Handlers](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} would have already run.
This was designed this way mainly to allow using the same objects "yielded" by dependencies inside of background tasks, because the exit code would be executed after the background tasks were finished.
diff --git a/docs/en/docs/tutorial/dependencies/index.md b/docs/en/docs/tutorial/dependencies/index.md
index 608ced407..e05d40685 100644
--- a/docs/en/docs/tutorial/dependencies/index.md
+++ b/docs/en/docs/tutorial/dependencies/index.md
@@ -257,7 +257,7 @@ And you can declare dependencies with `async def` inside of normal `def` *path o
It doesn't matter. **FastAPI** will know what to do.
!!! note
- If you don't know, check the [Async: *"In a hurry?"*](../../async.md){.internal-link target=_blank} section about `async` and `await` in the docs.
+ If you don't know, check the [Async: *"In a hurry?"*](../../async.md#in-a-hurry){.internal-link target=_blank} section about `async` and `await` in the docs.
## Integrated with OpenAPI
diff --git a/docs/en/docs/tutorial/extra-data-types.md b/docs/en/docs/tutorial/extra-data-types.md
index fd7a99af3..e705a18e4 100644
--- a/docs/en/docs/tutorial/extra-data-types.md
+++ b/docs/en/docs/tutorial/extra-data-types.md
@@ -36,7 +36,7 @@ Here are some of the additional data types you can use:
* `datetime.timedelta`:
* A Python `datetime.timedelta`.
* In requests and responses will be represented as a `float` of total seconds.
- * Pydantic also allows representing it as a "ISO 8601 time diff encoding", see the docs for more info.
+ * Pydantic also allows representing it as a "ISO 8601 time diff encoding", see the docs for more info.
* `frozenset`:
* In requests and responses, treated the same as a `set`:
* In requests, a list will be read, eliminating duplicates and converting it to a `set`.
diff --git a/docs/en/docs/tutorial/extra-models.md b/docs/en/docs/tutorial/extra-models.md
index d83b6bc85..cc0680cfd 100644
--- a/docs/en/docs/tutorial/extra-models.md
+++ b/docs/en/docs/tutorial/extra-models.md
@@ -83,7 +83,7 @@ So, continuing with the `user_dict` from above, writing:
UserInDB(**user_dict)
```
-Would result in something equivalent to:
+would result in something equivalent to:
```Python
UserInDB(
@@ -120,7 +120,7 @@ would be equivalent to:
UserInDB(**user_in.dict())
```
-...because `user_in.dict()` is a `dict`, and then we make Python "unwrap" it by passing it to `UserInDB` prepended with `**`.
+...because `user_in.dict()` is a `dict`, and then we make Python "unwrap" it by passing it to `UserInDB` prefixed with `**`.
So, we get a Pydantic model from the data in another Pydantic model.
@@ -184,7 +184,7 @@ It will be defined in OpenAPI with `anyOf`.
To do that, use the standard Python type hint `typing.Union`:
!!! note
- When defining a `Union`, include the most specific type first, followed by the less specific type. In the example below, the more specific `PlaneItem` comes before `CarItem` in `Union[PlaneItem, CarItem]`.
+ When defining a `Union`, include the most specific type first, followed by the less specific type. In the example below, the more specific `PlaneItem` comes before `CarItem` in `Union[PlaneItem, CarItem]`.
=== "Python 3.10+"
diff --git a/docs/en/docs/tutorial/handling-errors.md b/docs/en/docs/tutorial/handling-errors.md
index a03029e81..98ac55d1f 100644
--- a/docs/en/docs/tutorial/handling-errors.md
+++ b/docs/en/docs/tutorial/handling-errors.md
@@ -163,7 +163,7 @@ path -> item_id
!!! warning
These are technical details that you might skip if it's not important for you now.
-`RequestValidationError` is a sub-class of Pydantic's `ValidationError`.
+`RequestValidationError` is a sub-class of Pydantic's `ValidationError`.
**FastAPI** uses it so that, if you use a Pydantic model in `response_model`, and your data has an error, you will see the error in your log.
@@ -234,9 +234,7 @@ You will receive a response telling you that the data is invalid containing the
And **FastAPI**'s `HTTPException` error class inherits from Starlette's `HTTPException` error class.
-The only difference, is that **FastAPI**'s `HTTPException` allows you to add headers to be included in the response.
-
-This is needed/used internally for OAuth 2.0 and some security utilities.
+The only difference is that **FastAPI**'s `HTTPException` accepts any JSON-able data for the `detail` field, while Starlette's `HTTPException` only accepts strings for it.
So, you can keep raising **FastAPI**'s `HTTPException` as normally in your code.
diff --git a/docs/en/docs/tutorial/metadata.md b/docs/en/docs/tutorial/metadata.md
index 504204e98..4dce9af13 100644
--- a/docs/en/docs/tutorial/metadata.md
+++ b/docs/en/docs/tutorial/metadata.md
@@ -77,7 +77,7 @@ Use the `tags` parameter with your *path operations* (and `APIRouter`s) to assig
```
!!! info
- Read more about tags in [Path Operation Configuration](../path-operation-configuration/#tags){.internal-link target=_blank}.
+ Read more about tags in [Path Operation Configuration](path-operation-configuration.md#tags){.internal-link target=_blank}.
### Check the docs
diff --git a/docs/en/docs/tutorial/path-params.md b/docs/en/docs/tutorial/path-params.md
index 847b56334..6246d6680 100644
--- a/docs/en/docs/tutorial/path-params.md
+++ b/docs/en/docs/tutorial/path-params.md
@@ -95,7 +95,7 @@ The same way, there are many compatible tools. Including code generation tools f
## Pydantic
-All the data validation is performed under the hood by Pydantic, so you get all the benefits from it. And you know you are in good hands.
+All the data validation is performed under the hood by Pydantic, so you get all the benefits from it. And you know you are in good hands.
You can use the same type declarations with `str`, `float`, `bool` and many other complex data types.
diff --git a/docs/en/docs/tutorial/query-params-str-validations.md b/docs/en/docs/tutorial/query-params-str-validations.md
index 7a9bc4875..24784efad 100644
--- a/docs/en/docs/tutorial/query-params-str-validations.md
+++ b/docs/en/docs/tutorial/query-params-str-validations.md
@@ -500,7 +500,7 @@ To do that, you can declare that `None` is a valid type but still use `...` as t
```
!!! tip
- Pydantic, which is what powers all the data validation and serialization in FastAPI, has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about Required Optional fields.
+ Pydantic, which is what powers all the data validation and serialization in FastAPI, has a special behavior when you use `Optional` or `Union[Something, None]` without a default value, you can read more about it in the Pydantic docs about Required Optional fields.
!!! tip
Remember that in most of the cases, when something is required, you can simply omit the default, so you normally don't have to use `...`.
diff --git a/docs/en/docs/tutorial/request-files.md b/docs/en/docs/tutorial/request-files.md
index 8eb8ace64..17ac3b25d 100644
--- a/docs/en/docs/tutorial/request-files.md
+++ b/docs/en/docs/tutorial/request-files.md
@@ -3,7 +3,7 @@
You can define files to be uploaded by the client using `File`.
!!! info
- To receive uploaded files, first install `python-multipart`.
+ To receive uploaded files, first install `python-multipart`.
E.g. `pip install python-multipart`.
diff --git a/docs/en/docs/tutorial/request-forms-and-files.md b/docs/en/docs/tutorial/request-forms-and-files.md
index a58291dc8..676ed35ad 100644
--- a/docs/en/docs/tutorial/request-forms-and-files.md
+++ b/docs/en/docs/tutorial/request-forms-and-files.md
@@ -3,7 +3,7 @@
You can define files and form fields at the same time using `File` and `Form`.
!!! info
- To receive uploaded files and/or form data, first install `python-multipart`.
+ To receive uploaded files and/or form data, first install `python-multipart`.
E.g. `pip install python-multipart`.
diff --git a/docs/en/docs/tutorial/request-forms.md b/docs/en/docs/tutorial/request-forms.md
index 0e8ac5f4f..5f8f7b148 100644
--- a/docs/en/docs/tutorial/request-forms.md
+++ b/docs/en/docs/tutorial/request-forms.md
@@ -3,7 +3,7 @@
When you need to receive form fields instead of JSON, you can use `Form`.
!!! info
- To use forms, first install `python-multipart`.
+ To use forms, first install `python-multipart`.
E.g. `pip install python-multipart`.
diff --git a/docs/en/docs/tutorial/response-model.md b/docs/en/docs/tutorial/response-model.md
index d5683ac7f..75d5df106 100644
--- a/docs/en/docs/tutorial/response-model.md
+++ b/docs/en/docs/tutorial/response-model.md
@@ -338,7 +338,7 @@ Your response model could have default values, like:
* `description: Union[str, None] = None` (or `str | None = None` in Python 3.10) has a default of `None`.
* `tax: float = 10.5` has a default of `10.5`.
-* `tags: List[str] = []` as a default of an empty list: `[]`.
+* `tags: List[str] = []` has a default of an empty list: `[]`.
but you might want to omit them from the result if they were not actually stored.
@@ -383,7 +383,7 @@ So, if you send a request to that *path operation* for the item with ID `foo`, t
The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
!!! info
- FastAPI uses Pydantic model's `.dict()` with its `exclude_unset` parameter to achieve this.
+ FastAPI uses Pydantic model's `.dict()` with its `exclude_unset` parameter to achieve this.
!!! info
You can also use:
@@ -391,7 +391,7 @@ So, if you send a request to that *path operation* for the item with ID `foo`, t
* `response_model_exclude_defaults=True`
* `response_model_exclude_none=True`
- as described in the Pydantic docs for `exclude_defaults` and `exclude_none`.
+ as described in the Pydantic docs for `exclude_defaults` and `exclude_none`.
#### Data with values for fields with defaults
diff --git a/docs/en/docs/tutorial/schema-extra-example.md b/docs/en/docs/tutorial/schema-extra-example.md
index 9bb9ba4e3..40231dc0b 100644
--- a/docs/en/docs/tutorial/schema-extra-example.md
+++ b/docs/en/docs/tutorial/schema-extra-example.md
@@ -305,7 +305,7 @@ This new `examples` field in JSON Schema is **just a `list`** of examples, not a
### Pydantic and FastAPI `examples`
-When you add `examples` inside of a Pydantic model, using `schema_extra` or `Field(examples=["something"])` that example is added to the **JSON Schema** for that Pydantic model.
+When you add `examples` inside a Pydantic model, using `schema_extra` or `Field(examples=["something"])` that example is added to the **JSON Schema** for that Pydantic model.
And that **JSON Schema** of the Pydantic model is included in the **OpenAPI** of your API, and then it's used in the docs UI.
diff --git a/docs/en/docs/tutorial/security/first-steps.md b/docs/en/docs/tutorial/security/first-steps.md
index 2f39f1ec2..7d86e453e 100644
--- a/docs/en/docs/tutorial/security/first-steps.md
+++ b/docs/en/docs/tutorial/security/first-steps.md
@@ -45,7 +45,7 @@ Copy the example in a file `main.py`:
## Run it
!!! info
- First install `python-multipart`.
+ First install `python-multipart`.
E.g. `pip install python-multipart`.
diff --git a/docs/en/docs/tutorial/security/oauth2-jwt.md b/docs/en/docs/tutorial/security/oauth2-jwt.md
index 1c792e3d9..b02d00c3f 100644
--- a/docs/en/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/en/docs/tutorial/security/oauth2-jwt.md
@@ -260,7 +260,7 @@ If the token is invalid, return an HTTP error right away.
Create a `timedelta` with the expiration time of the token.
-Create a real JWT access token and return it
+Create a real JWT access token and return it.
=== "Python 3.10+"
diff --git a/docs/en/docs/tutorial/security/simple-oauth2.md b/docs/en/docs/tutorial/security/simple-oauth2.md
index 88edc9eab..6f40531d7 100644
--- a/docs/en/docs/tutorial/security/simple-oauth2.md
+++ b/docs/en/docs/tutorial/security/simple-oauth2.md
@@ -118,7 +118,7 @@ First, import `OAuth2PasswordRequestForm`, and use it as a dependency with `Depe
Now, get the user data from the (fake) database, using the `username` from the form field.
-If there is no such user, we return an error saying "incorrect username or password".
+If there is no such user, we return an error saying "Incorrect username or password".
For the error, we use the exception `HTTPException`:
@@ -416,7 +416,7 @@ Password: `secret2`
And try to use the operation `GET` with the path `/users/me`.
-You will get an "inactive user" error, like:
+You will get an "Inactive user" error, like:
```JSON
{
diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md
index 70d9482df..0b4d06b99 100644
--- a/docs/en/docs/tutorial/sql-databases.md
+++ b/docs/en/docs/tutorial/sql-databases.md
@@ -338,7 +338,7 @@ Not only the IDs of those items, but all the data that we defined in the Pydanti
Now, in the Pydantic *models* for reading, `Item` and `User`, add an internal `Config` class.
-This `Config` class is used to provide configurations to Pydantic.
+This `Config` class is used to provide configurations to Pydantic.
In the `Config` class, set the attribute `orm_mode = True`.
@@ -546,7 +546,7 @@ Our dependency will create a new SQLAlchemy `SessionLocal` that will be used in
This way we make sure the database session is always closed after the request. Even if there was an exception while processing the request.
- But you can't raise another exception from the exit code (after `yield`). See more in [Dependencies with `yield` and `HTTPException`](./dependencies/dependencies-with-yield.md#dependencies-with-yield-and-httpexception){.internal-link target=_blank}
+ But you can't raise another exception from the exit code (after `yield`). See more in [Dependencies with `yield` and `HTTPException`](dependencies/dependencies-with-yield.md#dependencies-with-yield-and-httpexception){.internal-link target=_blank}
And then, when using the dependency in a *path operation function*, we declare it with the type `Session` we imported directly from SQLAlchemy.
diff --git a/docs/en/docs/tutorial/testing.md b/docs/en/docs/tutorial/testing.md
index 3f8dd69a1..8d199a4c7 100644
--- a/docs/en/docs/tutorial/testing.md
+++ b/docs/en/docs/tutorial/testing.md
@@ -50,7 +50,7 @@ And your **FastAPI** application might also be composed of several files/modules
### **FastAPI** app file
-Let's say you have a file structure as described in [Bigger Applications](./bigger-applications.md){.internal-link target=_blank}:
+Let's say you have a file structure as described in [Bigger Applications](bigger-applications.md){.internal-link target=_blank}:
```
.
diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml
index 92d081aa1..933e7e4a2 100644
--- a/docs/en/mkdocs.yml
+++ b/docs/en/mkdocs.yml
@@ -41,8 +41,13 @@ repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
search: null
- markdownextradata:
- data: ../en/data
+ macros:
+ include_yaml:
+ - external_links: ../en/data/external_links.yml
+ - github_sponsors: ../en/data/github_sponsors.yml
+ - people: ../en/data/people.yml
+ - sponsors_badge: ../en/data/sponsors_badge.yml
+ - sponsors: ../en/data/sponsors.yml
redirects:
redirect_maps:
deployment/deta.md: deployment/cloud.md
@@ -174,9 +179,6 @@ nav:
- How To - Recipes:
- how-to/index.md
- how-to/general.md
- - how-to/sql-databases-peewee.md
- - how-to/async-sql-encode-databases.md
- - how-to/nosql-databases-couchbase.md
- how-to/graphql.md
- how-to/custom-request-and-route.md
- how-to/conditional-openapi.md
@@ -184,6 +186,9 @@ nav:
- how-to/separate-openapi-schemas.md
- how-to/custom-docs-ui-assets.md
- how-to/configure-swagger-ui.md
+ - how-to/sql-databases-peewee.md
+ - how-to/async-sql-encode-databases.md
+ - how-to/nosql-databases-couchbase.md
- Reference (Code API):
- reference/index.md
- reference/fastapi.md
@@ -242,6 +247,7 @@ markdown_extensions:
format: !!python/name:pymdownx.superfences.fence_code_format ''
pymdownx.tabbed:
alternate_style: true
+ pymdownx.tilde: null
attr_list: null
md_in_html: null
extra:
@@ -266,6 +272,10 @@ extra:
alternate:
- link: /
name: en - English
+ - link: /az/
+ name: az - azərbaycan dili
+ - link: /bn/
+ name: bn - বাংলা
- link: /de/
name: de - Deutsch
- link: /es/
@@ -280,6 +290,8 @@ extra:
name: hu - magyar
- link: /id/
name: id - Bahasa Indonesia
+ - link: /it/
+ name: it - italiano
- link: /ja/
name: ja - 日本語
- link: /ko/
@@ -301,7 +313,9 @@ extra:
- link: /yo/
name: yo - Yorùbá
- link: /zh/
- name: zh - 汉语
+ name: zh - 简体中文
+ - link: /zh-hant/
+ name: zh-hant - 繁體中文
- link: /em/
name: 😉
extra_css:
diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html
index 476b43676..28a912fb3 100644
--- a/docs/en/overrides/main.html
+++ b/docs/en/overrides/main.html
@@ -64,38 +64,18 @@
+
+
+
+
-Cojes tus hamburguesas 🍔 y vas a la mesa con esa persona 😍.
+Coges tus hamburguesas 🍔 y vas a la mesa con esa persona 😍.
Sólo las comes y listo 🍔 ⏹.
@@ -400,7 +400,7 @@ Cuando declaras una *path operation function* con `def` normal en lugar de `asyn
Si vienes de otro framework asíncrono que no funciona de la manera descrita anteriormente y estás acostumbrado a definir *path operation functions* del tipo sólo cálculo con `def` simple para una pequeña ganancia de rendimiento (aproximadamente 100 nanosegundos), ten en cuenta que en **FastAPI** el efecto sería bastante opuesto. En estos casos, es mejor usar `async def` a menos que tus *path operation functions* usen un código que realice el bloqueo I/O.
-Aún así, en ambas situaciones, es probable que **FastAPI** sea [aún más rápido](/#rendimiento){.Internal-link target=_blank} que (o al menos comparable) a tu framework anterior.
+Aún así, en ambas situaciones, es probable que **FastAPI** sea [aún más rápido](index.md#rendimiento){.Internal-link target=_blank} que (o al menos comparable) a tu framework anterior.
### Dependencias
diff --git a/docs/es/docs/benchmarks.md b/docs/es/docs/benchmarks.md
new file mode 100644
index 000000000..3e02d4e9f
--- /dev/null
+++ b/docs/es/docs/benchmarks.md
@@ -0,0 +1,33 @@
+# Benchmarks
+
+Los benchmarks independientes de TechEmpower muestran aplicaciones de **FastAPI** que se ejecutan en Uvicorn como uno de los frameworks de Python más rápidos disponibles, solo por debajo de Starlette y Uvicorn (utilizados internamente por FastAPI). (*)
+
+Pero al comprobar benchmarks y comparaciones debes tener en cuenta lo siguiente.
+
+## Benchmarks y velocidad
+
+Cuando revisas los benchmarks, es común ver varias herramientas de diferentes tipos comparadas como equivalentes.
+
+Específicamente, para ver Uvicorn, Starlette y FastAPI comparadas entre sí (entre muchas otras herramientas).
+
+Cuanto más sencillo sea el problema resuelto por la herramienta, mejor rendimiento obtendrá. Y la mayoría de los benchmarks no prueban las funciones adicionales proporcionadas por la herramienta.
+
+La jerarquía sería:
+
+* **Uvicorn**: como servidor ASGI
+ * **Starlette**: (usa Uvicorn) un microframework web
+ * **FastAPI**: (usa Starlette) un microframework API con varias características adicionales para construir APIs, con validación de datos, etc.
+* **Uvicorn**:
+ * Tendrá el mejor rendimiento, ya que no tiene mucho código extra aparte del propio servidor.
+ * No escribirías una aplicación directamente en Uvicorn. Eso significaría que tu código tendría que incluir más o menos, al menos, todo el código proporcionado por Starlette (o **FastAPI**). Y si hicieras eso, tu aplicación final tendría la misma sobrecarga que si hubieras usado un framework y minimizado el código de tu aplicación y los errores.
+ * Si estás comparando Uvicorn, compáralo con los servidores de aplicaciones Daphne, Hypercorn, uWSGI, etc.
+* **Starlette**:
+ * Tendrá el siguiente mejor desempeño, después de Uvicorn. De hecho, Starlette usa Uvicorn para correr. Por lo tanto, probablemente sólo pueda volverse "más lento" que Uvicorn al tener que ejecutar más código.
+ * Pero te proporciona las herramientas para crear aplicaciones web simples, con routing basado en paths, etc.
+ * Si estás comparando Starlette, compáralo con Sanic, Flask, Django, etc. Frameworks web (o microframeworks).
+* **FastAPI**:
+ * De la misma manera que Starlette usa Uvicorn y no puede ser más rápido que él, **FastAPI** usa Starlette, por lo que no puede ser más rápido que él.
+ * * FastAPI ofrece más características además de las de Starlette. Funciones que casi siempre necesitas al crear una API, como validación y serialización de datos. Y al usarlo, obtienes documentación automática de forma gratuita (la documentación automática ni siquiera agrega gastos generales a las aplicaciones en ejecución, se genera al iniciar).
+ * Si no usaras FastAPI y usaras Starlette directamente (u otra herramienta, como Sanic, Flask, Responder, etc.), tendrías que implementar toda la validación y serialización de datos tu mismo. Por lo tanto, tu aplicación final seguirá teniendo la misma sobrecarga que si se hubiera creado con FastAPI. Y en muchos casos, esta validación y serialización de datos constituye la mayor cantidad de código escrito en las aplicaciones.
+ * Entonces, al usar FastAPI estás ahorrando tiempo de desarrollo, errores, líneas de código y probablemente obtendrías el mismo rendimiento (o mejor) que obtendrías si no lo usaras (ya que tendrías que implementarlo todo en tu código).
+ * Si estás comparando FastAPI, compáralo con un framework de aplicaciones web (o conjunto de herramientas) que proporciona validación, serialización y documentación de datos, como Flask-apispec, NestJS, Molten, etc. Frameworks con validación, serialización y documentación automáticas integradas.
diff --git a/docs/es/docs/deployment/index.md b/docs/es/docs/deployment/index.md
new file mode 100644
index 000000000..74b0e22f0
--- /dev/null
+++ b/docs/es/docs/deployment/index.md
@@ -0,0 +1,21 @@
+# Despliegue - Introducción
+
+Desplegar una aplicación hecha con **FastAPI** es relativamente fácil.
+
+## ¿Qué significa desplegar una aplicación?
+
+**Desplegar** una aplicación significa realizar una serie de pasos para hacerla **disponible para los usuarios**.
+
+Para una **API web**, normalmente implica ponerla en una **máquina remota**, con un **programa de servidor** que proporcione un buen rendimiento, estabilidad, etc, para que sus **usuarios** puedan **acceder** a la aplicación de manera eficiente y sin interrupciones o problemas.
+
+Esto difiere en las fases de **desarrollo**, donde estás constantemente cambiando el código, rompiéndolo y arreglándolo, deteniendo y reiniciando el servidor de desarrollo, etc.
+
+## Estrategias de despliegue
+
+Existen varias formas de hacerlo dependiendo de tu caso de uso específico y las herramientas que uses.
+
+Puedes **desplegar un servidor** tú mismo usando un conjunto de herramientas, puedes usar **servicios en la nube** que haga parte del trabajo por ti, o usar otras posibles opciones.
+
+Te enseñaré algunos de los conceptos principales que debes tener en cuenta al desplegar aplicaciones hechas con **FastAPI** (aunque la mayoría de estos conceptos aplican para cualquier otro tipo de aplicación web).
+
+Podrás ver más detalles para tener en cuenta y algunas de las técnicas para hacerlo en las próximas secciones.✨
diff --git a/docs/es/docs/deployment/versions.md b/docs/es/docs/deployment/versions.md
new file mode 100644
index 000000000..d8719d6bd
--- /dev/null
+++ b/docs/es/docs/deployment/versions.md
@@ -0,0 +1,87 @@
+# Acerca de las versiones de FastAPI
+
+**FastAPI** está siendo utilizado en producción en muchas aplicaciones y sistemas. La cobertura de los tests se mantiene al 100%. Sin embargo, su desarrollo sigue siendo rápido.
+
+Se agregan nuevas características frecuentemente, se corrigen errores continuamente y el código está constantemente mejorando.
+
+Por eso las versiones actuales siguen siendo `0.x.x`, esto significa que cada versión puede potencialmente tener *breaking changes*. Las versiones siguen las convenciones de *Semantic Versioning*.
+
+Puedes crear aplicaciones listas para producción con **FastAPI** ahora mismo (y probablemente lo has estado haciendo por algún tiempo), solo tienes que asegurarte de usar la versión que funciona correctamente con el resto de tu código.
+
+## Fijar la versión de `fastapi`
+
+Lo primero que debes hacer en tu proyecto es "fijar" la última versión específica de **FastAPI** que sabes que funciona bien con tu aplicación.
+
+Por ejemplo, digamos que estás usando la versión `0.45.0` en tu aplicación.
+
+Si usas el archivo `requirements.txt` puedes especificar la versión con:
+
+```txt
+fastapi==0.45.0
+```
+
+esto significa que usarás específicamente la versión `0.45.0`.
+
+También puedes fijar las versiones de esta forma:
+
+```txt
+fastapi>=0.45.0,<0.46.0
+```
+
+esto significa que usarás la versión `0.45.0` o superiores, pero menores a la versión `0.46.0`, por ejemplo, la versión `0.45.2` sería aceptada.
+
+Si usas cualquier otra herramienta para manejar tus instalaciones, como Poetry, Pipenv, u otras, todas tienen una forma que puedes usar para definir versiones específicas para tus paquetes.
+
+## Versiones disponibles
+
+Puedes ver las versiones disponibles (por ejemplo, para revisar cuál es la actual) en las [Release Notes](../release-notes.md){.internal-link target=_blank}.
+
+## Acerca de las versiones
+
+Siguiendo las convenciones de *Semantic Versioning*, cualquier versión por debajo de `1.0.0` puede potencialmente tener *breaking changes*.
+
+FastAPI también sigue la convención de que cualquier cambio hecho en una "PATCH" version es para solucionar errores y *non-breaking changes*.
+
+!!! tip
+ El "PATCH" es el último número, por ejemplo, en `0.2.3`, la PATCH version es `3`.
+
+Entonces, deberías fijar la versión así:
+
+```txt
+fastapi>=0.45.0,<0.46.0
+```
+
+En versiones "MINOR" son añadidas nuevas características y posibles breaking changes.
+
+!!! tip
+ La versión "MINOR" es el número en el medio, por ejemplo, en `0.2.3`, la "MINOR" version es `2`.
+
+## Actualizando las versiones de FastAPI
+
+Para esto es recomendable primero añadir tests a tu aplicación.
+
+Con **FastAPI** es muy fácil (gracias a Starlette), revisa la documentación [Testing](../tutorial/testing.md){.internal-link target=_blank}
+
+Luego de tener los tests, puedes actualizar la versión de **FastAPI** a una más reciente y asegurarte de que tu código funciona correctamente ejecutando los tests.
+
+Si todo funciona correctamente, o haces los cambios necesarios para que esto suceda, y todos tus tests pasan, entonces puedes fijar tu versión de `fastapi` a la más reciente.
+
+## Acerca de Starlette
+
+No deberías fijar la versión de `starlette`.
+
+Diferentes versiones de **FastAPI** pueden usar una versión específica de Starlette.
+
+Entonces, puedes dejar que **FastAPI** se asegure por sí mismo de qué versión de Starlette usar.
+
+## Acerca de Pydantic
+
+Pydantic incluye los tests para **FastAPI** dentro de sus propios tests, esto significa que las versiones de Pydantic (superiores a `1.0.0`) son compatibles con FastAPI.
+
+Puedes fijar Pydantic a cualquier versión superior a `1.0.0` e inferior a `2.0.0` que funcione para ti.
+
+Por ejemplo:
+
+```txt
+pydantic>=1.2.0,<2.0.0
+```
diff --git a/docs/es/docs/external-links.md b/docs/es/docs/external-links.md
new file mode 100644
index 000000000..cfbdd68a6
--- /dev/null
+++ b/docs/es/docs/external-links.md
@@ -0,0 +1,33 @@
+# Enlaces Externos y Artículos
+
+**FastAPI** tiene una gran comunidad en constante crecimiento.
+
+Hay muchas publicaciones, artículos, herramientas y proyectos relacionados con **FastAPI**.
+
+Aquí hay una lista incompleta de algunos de ellos.
+
+!!! tip "Consejo"
+ Si tienes un artículo, proyecto, herramienta o cualquier cosa relacionada con **FastAPI** que aún no aparece aquí, crea un Pull Request agregándolo.
+
+{% for section_name, section_content in external_links.items() %}
+
+## {{ section_name }}
+
+{% for lang_name, lang_content in section_content.items() %}
+
+### {{ lang_name }}
+
+{% for item in lang_content %}
+
+* {{ item.title }} by {{ item.author }}.
+
+{% endfor %}
+{% endfor %}
+{% endfor %}
+
+## Projects
+
+Últimos proyectos de GitHub con el tema `fastapi`:
+
+httpx - Requerido si quieres usar el `TestClient`.
* jinja2 - Requerido si quieres usar la configuración por defecto de templates.
-* python-multipart - Requerido si quieres dar soporte a "parsing" de formularios, con `request.form()`.
+* python-multipart - Requerido si quieres dar soporte a "parsing" de formularios, con `request.form()`.
* itsdangerous - Requerido para dar soporte a `SessionMiddleware`.
* pyyaml - Requerido para dar soporte al `SchemaGenerator` de Starlette (probablemente no lo necesites con FastAPI).
* graphene - Requerido para dar soporte a `GraphQLApp`.
-* ujson - Requerido si quieres usar `UJSONResponse`.
Usado por FastAPI / Starlette:
* uvicorn - para el servidor que carga y sirve tu aplicación.
* orjson - Requerido si quieres usar `ORJSONResponse`.
+* ujson - Requerido si quieres usar `UJSONResponse`.
Puedes instalarlos con `pip install fastapi[all]`.
diff --git a/docs/es/docs/newsletter.md b/docs/es/docs/newsletter.md
new file mode 100644
index 000000000..f4dcfe155
--- /dev/null
+++ b/docs/es/docs/newsletter.md
@@ -0,0 +1,5 @@
+# Boletín de Noticias de FastAPI y amigos
+
+
+
+
diff --git a/docs/es/docs/python-types.md b/docs/es/docs/python-types.md
index b83cbe3f5..89edbb31e 100644
--- a/docs/es/docs/python-types.md
+++ b/docs/es/docs/python-types.md
@@ -237,7 +237,7 @@ Una vez más tendrás todo el soporte del editor:
## Modelos de Pydantic
-Pydantic es una library de Python para llevar a cabo validación de datos.
+Pydantic es una library de Python para llevar a cabo validación de datos.
Tú declaras la "forma" de los datos mediante clases con atributos.
@@ -254,7 +254,7 @@ Tomado de la documentación oficial de Pydantic:
```
!!! info "Información"
- Para aprender más sobre Pydantic mira su documentación.
+ Para aprender más sobre Pydantic mira su documentación.
**FastAPI** está todo basado en Pydantic.
diff --git a/docs/es/docs/tutorial/cookie-params.md b/docs/es/docs/tutorial/cookie-params.md
new file mode 100644
index 000000000..9f736575d
--- /dev/null
+++ b/docs/es/docs/tutorial/cookie-params.md
@@ -0,0 +1,97 @@
+# Parámetros de Cookie
+
+Puedes definir parámetros de Cookie de la misma manera que defines parámetros de `Query` y `Path`.
+
+## Importar `Cookie`
+
+Primero importa `Cookie`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+## Declarar parámetros de `Cookie`
+
+Luego declara los parámetros de cookie usando la misma estructura que con `Path` y `Query`.
+
+El primer valor es el valor por defecto, puedes pasar todos los parámetros adicionales de validación o anotación:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+!!! note "Detalles Técnicos"
+ `Cookie` es una clase "hermana" de `Path` y `Query`. También hereda de la misma clase común `Param`.
+
+ Pero recuerda que cuando importas `Query`, `Path`, `Cookie` y otros de `fastapi`, en realidad son funciones que devuelven clases especiales.
+
+!!! info
+ Para declarar cookies, necesitas usar `Cookie`, porque de lo contrario los parámetros serían interpretados como parámetros de query.
+
+## Resumen
+
+Declara cookies con `Cookie`, usando el mismo patrón común que `Query` y `Path`.
diff --git a/docs/es/docs/tutorial/first-steps.md b/docs/es/docs/tutorial/first-steps.md
index 2cb7e6308..c37ce00fb 100644
--- a/docs/es/docs/tutorial/first-steps.md
+++ b/docs/es/docs/tutorial/first-steps.md
@@ -310,7 +310,7 @@ También podrías definirla como una función estándar en lugar de `async def`:
```
!!! note "Nota"
- Si no sabes la diferencia, revisa el [Async: *"¿Tienes prisa?"*](../async.md#in-a-hurry){.internal-link target=_blank}.
+ Si no sabes la diferencia, revisa el [Async: *"¿Tienes prisa?"*](../async.md#tienes-prisa){.internal-link target=_blank}.
### Paso 5: devuelve el contenido
diff --git a/docs/es/docs/tutorial/index.md b/docs/es/docs/tutorial/index.md
index f0dff02b4..f11820ef2 100644
--- a/docs/es/docs/tutorial/index.md
+++ b/docs/es/docs/tutorial/index.md
@@ -50,7 +50,7 @@ $ pip install "fastapi[all]"
...eso también incluye `uvicorn` que puedes usar como el servidor que ejecuta tu código.
-!!! nota
+!!! note "Nota"
También puedes instalarlo parte por parte.
Esto es lo que probablemente harías una vez que desees implementar tu aplicación en producción:
diff --git a/docs/es/docs/tutorial/path-params.md b/docs/es/docs/tutorial/path-params.md
index 765ae4140..7faa92f51 100644
--- a/docs/es/docs/tutorial/path-params.md
+++ b/docs/es/docs/tutorial/path-params.md
@@ -93,7 +93,7 @@ De la misma manera hay muchas herramientas compatibles. Incluyendo herramientas
## Pydantic
-Toda la validación de datos es realizada tras bastidores por Pydantic, así que obtienes todos sus beneficios. Así sabes que estás en buenas manos.
+Toda la validación de datos es realizada tras bastidores por Pydantic, así que obtienes todos sus beneficios. Así sabes que estás en buenas manos.
Puedes usar las mismas declaraciones de tipos con `str`, `float`, `bool` y otros tipos de datos más complejos.
diff --git a/docs/es/docs/tutorial/query-params.md b/docs/es/docs/tutorial/query-params.md
index 482af8dc0..76dc331a9 100644
--- a/docs/es/docs/tutorial/query-params.md
+++ b/docs/es/docs/tutorial/query-params.md
@@ -194,4 +194,4 @@ En este caso hay 3 parámetros de query:
* `limit`, un `int` opcional.
!!! tip "Consejo"
- También podrías usar los `Enum`s de la misma manera que con los [Parámetros de path](path-params.md#predefined-values){.internal-link target=_blank}.
+ También podrías usar los `Enum`s de la misma manera que con los [Parámetros de path](path-params.md#valores-predefinidos){.internal-link target=_blank}.
diff --git a/docs/fa/docs/advanced/sub-applications.md b/docs/fa/docs/advanced/sub-applications.md
index f3a948414..6f2359b94 100644
--- a/docs/fa/docs/advanced/sub-applications.md
+++ b/docs/fa/docs/advanced/sub-applications.md
@@ -69,4 +69,4 @@ $ uvicorn main:app --reload
و زیر برنامه ها نیز می تواند زیر برنامه های متصل شده خود را داشته باشد و همه چیز به درستی کار کند، زیرا FastAPI تمام این مسیرهای `root_path` را به طور خودکار مدیریت می کند.
-در بخش [پشت پراکسی](./behind-a-proxy.md){.internal-link target=_blank}. درباره `root_path` و نحوه استفاده درست از آن بیشتر خواهید آموخت.
+در بخش [پشت پراکسی](behind-a-proxy.md){.internal-link target=_blank}. درباره `root_path` و نحوه استفاده درست از آن بیشتر خواهید آموخت.
diff --git a/docs/fa/docs/features.md b/docs/fa/docs/features.md
index 3040ce3dd..58c34b7fc 100644
--- a/docs/fa/docs/features.md
+++ b/docs/fa/docs/features.md
@@ -182,7 +182,7 @@ FastAPI شامل یک سیستم Pydantic
+### Pydantic
Pydantic est une bibliothèque permettant de définir la validation, la sérialisation et la documentation des données (à l'aide de JSON Schema) en se basant sur les Python type hints.
diff --git a/docs/fr/docs/async.md b/docs/fr/docs/async.md
index af4d6ca06..3f65032fe 100644
--- a/docs/fr/docs/async.md
+++ b/docs/fr/docs/async.md
@@ -365,7 +365,7 @@ Quand vous déclarez une *fonction de chemin* avec un `def` normal et non `async
Si vous venez d'un autre framework asynchrone qui ne fonctionne pas comme de la façon décrite ci-dessus et que vous êtes habitués à définir des *fonctions de chemin* basiques avec un simple `def` pour un faible gain de performance (environ 100 nanosecondes), veuillez noter que dans **FastAPI**, l'effet serait plutôt contraire. Dans ces cas-là, il vaut mieux utiliser `async def` à moins que votre *fonction de chemin* utilise du code qui effectue des opérations I/O bloquantes.
-Au final, dans les deux situations, il est fort probable que **FastAPI** soit tout de même [plus rapide](/#performance){.internal-link target=_blank} que (ou au moins de vitesse égale à) votre framework précédent.
+Au final, dans les deux situations, il est fort probable que **FastAPI** soit tout de même [plus rapide](index.md#performance){.internal-link target=_blank} que (ou au moins de vitesse égale à) votre framework précédent.
### Dépendances
diff --git a/docs/fr/docs/fastapi-people.md b/docs/fr/docs/fastapi-people.md
index 945f0794e..d99dcd9c2 100644
--- a/docs/fr/docs/fastapi-people.md
+++ b/docs/fr/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# La communauté FastAPI
FastAPI a une communauté extraordinaire qui accueille des personnes de tous horizons.
@@ -18,7 +23,7 @@ C'est moi :
requests - Obligatoire si vous souhaitez utiliser `TestClient`.
* jinja2 - Obligatoire si vous souhaitez utiliser la configuration de template par défaut.
-* python-multipart - Obligatoire si vous souhaitez supporter le "décodage" de formulaire avec `request.form()`.
+* python-multipart - Obligatoire si vous souhaitez supporter le "décodage" de formulaire avec `request.form()`.
* itsdangerous - Obligatoire pour la prise en charge de `SessionMiddleware`.
* pyyaml - Obligatoire pour le support `SchemaGenerator` de Starlette (vous n'en avez probablement pas besoin avec FastAPI).
-* ujson - Obligatoire si vous souhaitez utiliser `UJSONResponse`.
Utilisées par FastAPI / Starlette :
* uvicorn - Pour le serveur qui charge et sert votre application.
* orjson - Obligatoire si vous voulez utiliser `ORJSONResponse`.
+* ujson - Obligatoire si vous souhaitez utiliser `UJSONResponse`.
Vous pouvez tout installer avec `pip install fastapi[all]`.
diff --git a/docs/fr/docs/python-types.md b/docs/fr/docs/python-types.md
index f49fbafd3..4232633e3 100644
--- a/docs/fr/docs/python-types.md
+++ b/docs/fr/docs/python-types.md
@@ -265,7 +265,7 @@ Et vous aurez accès, encore une fois, au support complet offert par l'éditeur
## Les modèles Pydantic
-Pydantic est une bibliothèque Python pour effectuer de la validation de données.
+Pydantic est une bibliothèque Python pour effectuer de la validation de données.
Vous déclarez la forme de la donnée avec des classes et des attributs.
@@ -282,7 +282,7 @@ Extrait de la documentation officielle de **Pydantic** :
```
!!! info
- Pour en savoir plus à propos de Pydantic, allez jeter un coup d'oeil à sa documentation.
+ Pour en savoir plus à propos de Pydantic, allez jeter un coup d'oeil à sa documentation.
**FastAPI** est basé entièrement sur **Pydantic**.
diff --git a/docs/fr/docs/tutorial/body.md b/docs/fr/docs/tutorial/body.md
index 89720c973..ae952405c 100644
--- a/docs/fr/docs/tutorial/body.md
+++ b/docs/fr/docs/tutorial/body.md
@@ -6,7 +6,7 @@ Le corps d'une **requête** est de la donnée envoyée par le client à votre AP
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.
+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`.
diff --git a/docs/fr/docs/tutorial/path-params.md b/docs/fr/docs/tutorial/path-params.md
index 894d62dd4..523e2c8c2 100644
--- a/docs/fr/docs/tutorial/path-params.md
+++ b/docs/fr/docs/tutorial/path-params.md
@@ -28,7 +28,7 @@ Vous pouvez déclarer le type d'un paramètre de chemin dans la fonction, en uti
Ici, `item_id` est déclaré comme `int`.
-!!! hint "Astuce"
+!!! check "vérifier"
Ceci vous permettra d'obtenir des fonctionnalités de l'éditeur dans votre fonction, telles
que des vérifications d'erreur, de l'auto-complétion, etc.
@@ -40,7 +40,7 @@ Si vous exécutez cet exemple et allez sur http://127.0.0.1:8000/items/4.2.
-!!! hint "Astuce"
+!!! check "vérifier"
Donc, avec ces mêmes déclarations de type Python, **FastAPI** vous fournit de la validation de données.
Notez que l'erreur mentionne le point exact où la validation n'a pas réussi.
@@ -106,7 +106,7 @@ pour de nombreux langages.
## Pydantic
-Toute la validation de données est effectué en arrière-plan avec Pydantic,
+Toute la validation de données est effectué en arrière-plan avec Pydantic,
dont vous bénéficierez de tous les avantages. Vous savez donc que vous êtes entre de bonnes mains.
## L'ordre importe
diff --git a/docs/he/docs/index.md b/docs/he/docs/index.md
index 802dbe8b5..621126128 100644
--- a/docs/he/docs/index.md
+++ b/docs/he/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI היא תשתית רשת מודרנית ומהירה (ביצועים ג
תכונות המפתח הן:
-- **מהירה**: ביצועים גבוהים מאוד, בקנה אחד עם NodeJS ו - Go (תודות ל - Starlette ו - Pydantic). [אחת מתשתיות הפייתון המהירות ביותר](#performance).
+- **מהירה**: ביצועים גבוהים מאוד, בקנה אחד עם NodeJS ו - Go (תודות ל - Starlette ו - Pydantic). [אחת מתשתיות הפייתון המהירות ביותר](#_14).
- **מהירה לתכנות**: הגבירו את מהירות פיתוח התכונות החדשות בכ - %200 עד %300. \*
- **פחות שגיאות**: מנעו כ - %40 משגיאות אנוש (מפתחים). \*
@@ -115,7 +124,7 @@ FastAPI היא תשתית רשת מודרנית ומהירה (ביצועים ג
FastAPI עומדת על כתפי ענקיות:
- Starlette לחלקי הרשת.
-- Pydantic לחלקי המידע.
+- Pydantic לחלקי המידע.
## התקנה
@@ -446,15 +455,15 @@ item: Item
- httpx - דרוש אם ברצונכם להשתמש ב - `TestClient`.
- jinja2 - דרוש אם ברצונכם להשתמש בברירת המחדל של תצורת הטמפלייטים.
-- python-multipart - דרוש אם ברצונכם לתמוך ב "פרסור" טפסים, באצמעות request.form().
+- python-multipart - דרוש אם ברצונכם לתמוך ב "פרסור" טפסים, באצמעות request.form().
- itsdangerous - דרוש אם ברצונכם להשתמש ב - `SessionMiddleware`.
- pyyaml - דרוש אם ברצונכם להשתמש ב - `SchemaGenerator` של Starlette (כנראה שאתם לא צריכים את זה עם FastAPI).
-- ujson - דרוש אם ברצונכם להשתמש ב - `UJSONResponse`.
בשימוש FastAPI / Starlette:
- uvicorn - לשרת שטוען ומגיש את האפליקציה שלכם.
- orjson - דרוש אם ברצונכם להשתמש ב - `ORJSONResponse`.
+- ujson - דרוש אם ברצונכם להשתמש ב - `UJSONResponse`.
תוכלו להתקין את כל אלו באמצעות pip install "fastapi[all]".
diff --git a/docs/hu/docs/index.md b/docs/hu/docs/index.md
index 29c3c05ac..896db6d1f 100644
--- a/docs/hu/docs/index.md
+++ b/docs/hu/docs/index.md
@@ -120,7 +120,7 @@ Python 3.8+
A FastAPI óriások vállán áll:
* Starlette a webes részekhez.
-* Pydantic az adat részekhez.
+* Pydantic az adat részekhez.
## Telepítés
@@ -453,15 +453,15 @@ Starlette által használt:
* httpx - Követelmény ha a `TestClient`-et akarod használni.
* jinja2 - Követelmény ha az alap template konfigurációt akarod használni.
-* python-multipart - Követelmény ha "parsing"-ot akarsz támogatni, `request.form()`-al.
+* python-multipart - Követelmény ha "parsing"-ot akarsz támogatni, `request.form()`-al.
* itsdangerous - Követelmény `SessionMiddleware` támogatáshoz.
* pyyaml - Követelmény a Starlette `SchemaGenerator`-ának támogatásához (valószínűleg erre nincs szükség FastAPI használása esetén).
-* ujson - Követelmény ha `UJSONResponse`-t akarsz használni.
FastAPI / Starlette által használt
* uvicorn - Szerverekhez amíg betöltik és szolgáltatják az applikációdat.
* orjson - Követelmény ha `ORJSONResponse`-t akarsz használni.
+* ujson - Követelmény ha `UJSONResponse`-t akarsz használni.
Ezeket mind telepítheted a `pip install "fastapi[all]"` paranccsal.
diff --git a/docs/id/docs/tutorial/index.md b/docs/id/docs/tutorial/index.md
index b8ed96ae1..6b6de24f0 100644
--- a/docs/id/docs/tutorial/index.md
+++ b/docs/id/docs/tutorial/index.md
@@ -52,7 +52,7 @@ $ pip install "fastapi[all]"
...yang juga termasuk `uvicorn`, yang dapat kamu gunakan sebagai server yang menjalankan kodemu.
-!!! catatan
+!!! note "Catatan"
Kamu juga dapat meng-installnya bagian demi bagian.
Hal ini mungkin yang akan kamu lakukan ketika kamu hendak menyebarkan (men-deploy) aplikasimu ke tahap produksi:
diff --git a/docs/it/docs/index.md b/docs/it/docs/index.md
new file mode 100644
index 000000000..c06d3a174
--- /dev/null
+++ b/docs/it/docs/index.md
@@ -0,0 +1,463 @@
+
+{!../../../docs/missing-translation.md!}
+
+
+
++ FastAPI framework, alte prestazioni, facile da imparare, rapido da implementare, pronto per il rilascio in produzione +
+ + +--- + +**Documentazione**: https://fastapi.tiangolo.com + +**Codice Sorgente**: https://github.com/tiangolo/fastapi + +--- + +FastAPI è un web framework moderno e veloce (a prestazioni elevate) che serve a creare API con Python 3.6+ basato sulle annotazioni di tipo di Python. + +Le sue caratteristiche principali sono: + +* **Velocità**: Prestazioni molto elevate, alla pari di **NodeJS** e **Go** (grazie a Starlette e Pydantic). [Uno dei framework Python più veloci in circolazione](#performance). +* **Veloce da programmare**: Velocizza il lavoro consentendo il rilascio di nuove funzionalità tra il 200% e il 300% più rapidamente. * +* **Meno bug**: Riduce di circa il 40% gli errori che commettono gli sviluppatori durante la scrittura del codice. * +* **Intuitivo**: Grande supporto per gli editor di testo con autocompletamento in ogni dove. In questo modo si può dedicare meno tempo al debugging. +* **Facile**: Progettato per essere facile da usare e imparare. Si riduce il tempo da dedicare alla lettura della documentazione. +* **Sintentico**: Minimizza la duplicazione di codice. Molteplici funzionalità, ognuna con la propria dichiarazione dei parametri. Meno errori. +* **Robusto**: Crea codice pronto per la produzione con documentazione automatica interattiva. +* **Basato sugli standard**: Basato su (e completamente compatibile con) gli open standard per le API: OpenAPI (precedentemente Swagger) e JSON Schema. + +* Stima basata sull'esito di test eseguiti su codice sorgente di applicazioni rilasciate in produzione da un team interno di sviluppatori. + +## Sponsor + + + +{% if sponsors %} +{% for sponsor in sponsors.gold -%} +async def...uvicorn main:app --reload...email_validator - per la validazione di email.
+
+Usate da Starlette:
+
+* requests - Richiesto se vuoi usare il `TestClient`.
+* aiofiles - Richiesto se vuoi usare `FileResponse` o `StaticFiles`.
+* jinja2 - Richiesto se vuoi usare la configurazione template di default.
+* python-multipart - Richiesto se vuoi supportare il "parsing" con `request.form()`.
+* itsdangerous - Richiesto per usare `SessionMiddleware`.
+* pyyaml - Richiesto per il supporto dello `SchemaGenerator` di Starlette (probabilmente non ti serve con FastAPI).
+* graphene - Richiesto per il supporto di `GraphQLApp`.
+
+Usate da FastAPI / Starlette:
+
+* uvicorn - per il server che carica e serve la tua applicazione.
+* orjson - ichiesto se vuoi usare `ORJSONResponse`.
+* ujson - Richiesto se vuoi usare `UJSONResponse`.
+
+Puoi installarle tutte con `pip install fastapi[all]`.
+
+## Licenza
+
+Questo progetto è concesso in licenza in base ai termini della licenza MIT.
diff --git a/docs/it/mkdocs.yml b/docs/it/mkdocs.yml
new file mode 100644
index 000000000..de18856f4
--- /dev/null
+++ b/docs/it/mkdocs.yml
@@ -0,0 +1 @@
+INHERIT: ../en/mkdocs.yml
diff --git a/docs/ja/docs/advanced/index.md b/docs/ja/docs/advanced/index.md
index 0732fc405..2d60e7489 100644
--- a/docs/ja/docs/advanced/index.md
+++ b/docs/ja/docs/advanced/index.md
@@ -2,7 +2,7 @@
## さらなる機能
-[チュートリアル - ユーザーガイド](../tutorial/){.internal-link target=_blank}により、**FastAPI**の主要な機能は十分に理解できたことでしょう。
+[チュートリアル - ユーザーガイド](../tutorial/index.md){.internal-link target=_blank}により、**FastAPI**の主要な機能は十分に理解できたことでしょう。
以降のセクションでは、チュートリアルでは説明しきれなかったオプションや設定、および機能について説明します。
@@ -13,7 +13,7 @@
## 先にチュートリアルを読む
-[チュートリアル - ユーザーガイド](../tutorial/){.internal-link target=_blank}の知識があれば、**FastAPI**の主要な機能を利用することができます。
+[チュートリアル - ユーザーガイド](../tutorial/index.md){.internal-link target=_blank}の知識があれば、**FastAPI**の主要な機能を利用することができます。
以降のセクションは、すでにチュートリアルを読んで、その主要なアイデアを理解できていることを前提としています。
diff --git a/docs/ja/docs/advanced/nosql-databases.md b/docs/ja/docs/advanced/nosql-databases.md
deleted file mode 100644
index fbd76e96b..000000000
--- a/docs/ja/docs/advanced/nosql-databases.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# NoSQL (分散 / ビッグデータ) Databases
-
-**FastAPI** はあらゆる NoSQLと統合することもできます。
-
-ここではドキュメントベースのNoSQLデータベースである**Couchbase**を使用した例を見てみましょう。
-
-他にもこれらのNoSQLデータベースを利用することが出来ます:
-
-* **MongoDB**
-* **Cassandra**
-* **CouchDB**
-* **ArangoDB**
-* **ElasticSearch** など。
-
-!!! tip "豆知識"
- **FastAPI**と**Couchbase**を使った公式プロジェクト・ジェネレータがあります。すべて**Docker**ベースで、フロントエンドやその他のツールも含まれています: https://github.com/tiangolo/full-stack-fastapi-couchbase
-
-## Couchbase コンポーネントの Import
-
-まずはImportしましょう。今はその他のソースコードに注意を払う必要はありません。
-
-```Python hl_lines="3-5"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-## "document type" として利用する定数の定義
-
-documentで利用する固定の`type`フィールドを用意しておきます。
-
-これはCouchbaseで必須ではありませんが、後々の助けになるベストプラクティスです。
-
-```Python hl_lines="9"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-## `Bucket` を取得する関数の追加
-
-**Couchbase**では、bucketはdocumentのセットで、様々な種類のものがあります。
-
-Bucketは通常、同一のアプリケーション内で互いに関係を持っています。
-
-リレーショナルデータベースの世界でいう"database"(データベースサーバではなく特定のdatabase)と類似しています。
-
-**MongoDB** で例えると"collection"と似た概念です。
-
-次のコードでは主に `Bucket` を利用してCouchbaseを操作します。
-
-この関数では以下の処理を行います:
-
-* **Couchbase** クラスタ(1台の場合もあるでしょう)に接続
- * タイムアウトのデフォルト値を設定
-* クラスタで認証を取得
-* `Bucket` インスタンスを取得
- * タイムアウトのデフォルト値を設定
-* 作成した`Bucket`インスタンスを返却
-
-```Python hl_lines="12-21"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-## Pydantic モデルの作成
-
-**Couchbase**のdocumentは実際には単にJSONオブジェクトなのでPydanticを利用してモデルに出来ます。
-
-### `User` モデル
-
-まずは`User`モデルを作成してみましょう:
-
-```Python hl_lines="24-28"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-このモデルは*path operation*に使用するので`hashed_password`は含めません。
-
-### `UserInDB` モデル
-
-それでは`UserInDB`モデルを作成しましょう。
-
-こちらは実際にデータベースに保存されるデータを保持します。
-
-`User`モデルの持つ全ての属性に加えていくつかの属性を追加するのでPydanticの`BaseModel`を継承せずに`User`のサブクラスとして定義します:
-
-```Python hl_lines="31-33"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-!!! note "備考"
- データベースに保存される`hashed_password`と`type`フィールドを`UserInDB`モデルに保持させていることに注意してください。
-
- しかしこれらは(*path operation*で返却する)一般的な`User`モデルには含まれません
-
-## user の取得
-
-それでは次の関数を作成しましょう:
-
-* username を取得する
-* username を利用してdocumentのIDを生成する
-* 作成したIDでdocumentを取得する
-* documentの内容を`UserInDB`モデルに設定する
-
-*path operation関数*とは別に、`username`(またはその他のパラメータ)からuserを取得することだけに特化した関数を作成することで、より簡単に複数の部分で再利用したりユニットテストを追加することができます。
-
-```Python hl_lines="36-42"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-### f-strings
-
-`f"userprofile::{username}"` という記載に馴染みがありませんか?これは Python の"f-string"と呼ばれるものです。
-
-f-stringの`{}`の中に入れられた変数は、文字列の中に展開/注入されます。
-
-### `dict` アンパック
-
-`UserInDB(**result.value)`という記載に馴染みがありませんか?これは`dict`の"アンパック"と呼ばれるものです。
-
-これは`result.value`の`dict`からそのキーと値をそれぞれ取りキーワード引数として`UserInDB`に渡します。
-
-例えば`dict`が下記のようになっていた場合:
-
-```Python
-{
- "username": "johndoe",
- "hashed_password": "some_hash",
-}
-```
-
-`UserInDB`には次のように渡されます:
-
-```Python
-UserInDB(username="johndoe", hashed_password="some_hash")
-```
-
-## **FastAPI** コードの実装
-
-### `FastAPI` app の作成
-
-```Python hl_lines="46"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-### *path operation関数*の作成
-
-私たちのコードはCouchbaseを呼び出しており、実験的なPython awaitを使用していないので、私たちは`async def`ではなく通常の`def`で関数を宣言する必要があります。
-
-また、Couchbaseは単一の`Bucket`オブジェクトを複数のスレッドで使用しないことを推奨していますので、単に直接Bucketを取得して関数に渡すことが出来ます。
-
-```Python hl_lines="49-53"
-{!../../../docs_src/nosql_databases/tutorial001.py!}
-```
-
-## まとめ
-
-他のサードパーティ製のNoSQLデータベースを利用する場合でも、そのデータベースの標準ライブラリを利用するだけで利用できます。
-
-他の外部ツール、システム、APIについても同じことが言えます。
diff --git a/docs/ja/docs/alternatives.md b/docs/ja/docs/alternatives.md
index ca6b29a07..ce4b36408 100644
--- a/docs/ja/docs/alternatives.md
+++ b/docs/ja/docs/alternatives.md
@@ -342,7 +342,7 @@ OpenAPIやJSON Schemaのような標準に基づいたものではありませ
## **FastAPI**が利用しているもの
-### Pydantic
+### Pydantic
Pydanticは、Pythonの型ヒントを元にデータのバリデーション、シリアライゼーション、 (JSON Schemaを使用した) ドキュメントを定義するライブラリです。
diff --git a/docs/ja/docs/async.md b/docs/ja/docs/async.md
index 8fac2cb38..5e38d1cec 100644
--- a/docs/ja/docs/async.md
+++ b/docs/ja/docs/async.md
@@ -368,7 +368,7 @@ async def read_burgers():
上記の方法と違った方法の別の非同期フレームワークから来ており、小さなパフォーマンス向上 (約100ナノ秒) のために通常の `def` を使用して些細な演算のみ行う *path operation 関数* を定義するのに慣れている場合は、**FastAPI**ではまったく逆の効果になることに注意してください。このような場合、*path operation 関数* がブロッキングI/Oを実行しないのであれば、`async def` の使用をお勧めします。
-それでも、どちらの状況でも、**FastAPI**が過去のフレームワークよりも (またはそれに匹敵するほど) [高速になる](/#performance){.internal-link target=_blank}可能性があります。
+それでも、どちらの状況でも、**FastAPI**が過去のフレームワークよりも (またはそれに匹敵するほど) [高速になる](index.md#_10){.internal-link target=_blank}可能性があります。
### 依存関係
@@ -390,4 +390,4 @@ async def read_burgers():
繰り返しになりますが、これらは非常に技術的な詳細であり、検索して辿り着いた場合は役立つでしょう。
-それ以外の場合は、上記のセクションのガイドラインで問題ないはずです: 急いでいますか?。
+それ以外の場合は、上記のセクションのガイドラインで問題ないはずです: 急いでいますか?。
diff --git a/docs/ja/docs/deployment/concepts.md b/docs/ja/docs/deployment/concepts.md
index 38cbca219..abe4f2c66 100644
--- a/docs/ja/docs/deployment/concepts.md
+++ b/docs/ja/docs/deployment/concepts.md
@@ -30,7 +30,7 @@
## セキュリティ - HTTPS
-[前チャプターのHTTPSについて](./https.md){.internal-link target=_blank}では、HTTPSがどのようにAPIを暗号化するのかについて学びました。
+[前チャプターのHTTPSについて](https.md){.internal-link target=_blank}では、HTTPSがどのようにAPIを暗号化するのかについて学びました。
通常、アプリケーションサーバにとって**外部の**コンポーネントである**TLS Termination Proxy**によって提供されることが一般的です。このプロキシは通信の暗号化を担当します。
@@ -188,7 +188,7 @@ FastAPI アプリケーションでは、Uvicorn のようなサーバープロ
### ワーカー・プロセス と ポート
-[HTTPSについて](./https.md){.internal-link target=_blank}のドキュメントで、1つのサーバーで1つのポートとIPアドレスの組み合わせでリッスンできるのは1つのプロセスだけであることを覚えていますでしょうか?
+[HTTPSについて](https.md){.internal-link target=_blank}のドキュメントで、1つのサーバーで1つのポートとIPアドレスの組み合わせでリッスンできるのは1つのプロセスだけであることを覚えていますでしょうか?
これはいまだに同じです。
@@ -247,7 +247,7 @@ FastAPI アプリケーションでは、Uvicorn のようなサーバープロ
これらの**コンテナ**やDockerそしてKubernetesに関する項目が、まだあまり意味をなしていなくても心配しないでください。
- コンテナ・イメージ、Docker、Kubernetesなどについては、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}.
+ コンテナ・イメージ、Docker、Kubernetesなどについては、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}.
## 開始前の事前のステップ
@@ -282,7 +282,7 @@ FastAPI アプリケーションでは、Uvicorn のようなサーバープロ
!!! tip
- コンテナを使った具体的な例については、次の章で紹介します: [コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}.
+ コンテナを使った具体的な例については、次の章で紹介します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}.
## リソースの利用
diff --git a/docs/ja/docs/deployment/docker.md b/docs/ja/docs/deployment/docker.md
index ca9dedc3c..0c9df648d 100644
--- a/docs/ja/docs/deployment/docker.md
+++ b/docs/ja/docs/deployment/docker.md
@@ -117,7 +117,7 @@ FastAPI用の**Dockerイメージ**を、**公式Python**イメージに基づ
最も一般的な方法は、`requirements.txt` ファイルにパッケージ名とそのバージョンを 1 行ずつ書くことです。
-もちろん、[FastAPI バージョンについて](./versions.md){.internal-link target=_blank}で読んだのと同じアイデアを使用して、バージョンの範囲を設定します。
+もちろん、[FastAPI バージョンについて](versions.md){.internal-link target=_blank}で読んだのと同じアイデアを使用して、バージョンの範囲を設定します。
例えば、`requirements.txt` は次のようになります:
@@ -384,7 +384,7 @@ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
## デプロイメントのコンセプト
-コンテナという観点から、[デプロイのコンセプト](./concepts.md){.internal-link target=_blank}に共通するいくつかについて、もう一度説明しましょう。
+コンテナという観点から、[デプロイのコンセプト](concepts.md){.internal-link target=_blank}に共通するいくつかについて、もう一度説明しましょう。
コンテナは主に、アプリケーションの**ビルドとデプロイ**のプロセスを簡素化するためのツールですが、これらの**デプロイのコンセプト**を扱うための特定のアプローチを強制するものではないです。
@@ -461,7 +461,7 @@ Kubernetesのような分散コンテナ管理システムの1つは通常、入
もちろん、**特殊なケース**として、**Gunicornプロセスマネージャ**を持つ**コンテナ**内で複数の**Uvicornワーカープロセス**を起動させたい場合があります。
-このような場合、**公式のDockerイメージ**を使用することができます。このイメージには、複数の**Uvicornワーカープロセス**を実行するプロセスマネージャとして**Gunicorn**が含まれており、現在のCPUコアに基づいてワーカーの数を自動的に調整するためのデフォルト設定がいくつか含まれています。詳しくは後述の[Gunicornによる公式Dockerイメージ - Uvicorn](#gunicornによる公式dockerイメージ---Uvicorn)で説明します。
+このような場合、**公式のDockerイメージ**を使用することができます。このイメージには、複数の**Uvicornワーカープロセス**を実行するプロセスマネージャとして**Gunicorn**が含まれており、現在のCPUコアに基づいてワーカーの数を自動的に調整するためのデフォルト設定がいくつか含まれています。詳しくは後述の[Gunicornによる公式Dockerイメージ - Uvicorn](#gunicorndocker-uvicorn)で説明します。
以下は、それが理にかなっている場合の例です:
@@ -531,7 +531,7 @@ Docker Composeで**シングルサーバ**(クラスタではない)にデ
## Gunicornによる公式Dockerイメージ - Uvicorn
-前の章で詳しく説明したように、Uvicornワーカーで動作するGunicornを含む公式のDockerイメージがあります: [Server Workers - Gunicorn と Uvicorn](./server-workers.md){.internal-link target=_blank}で詳しく説明しています。
+前の章で詳しく説明したように、Uvicornワーカーで動作するGunicornを含む公式のDockerイメージがあります: [Server Workers - Gunicorn と Uvicorn](server-workers.md){.internal-link target=_blank}で詳しく説明しています。
このイメージは、主に上記で説明した状況で役に立つでしょう: [複数のプロセスと特殊なケースを持つコンテナ(Containers with Multiple Processes and Special Cases)](#containers-with-multiple-processes-and-special-cases)
diff --git a/docs/ja/docs/deployment/server-workers.md b/docs/ja/docs/deployment/server-workers.md
index e1ea165a2..51d0bc2d4 100644
--- a/docs/ja/docs/deployment/server-workers.md
+++ b/docs/ja/docs/deployment/server-workers.md
@@ -13,13 +13,13 @@
アプリケーションをデプロイする際には、**複数のコア**を利用し、そしてより多くのリクエストを処理できるようにするために、プロセスの**レプリケーション**を持つことを望むでしょう。
-前のチャプターである[デプロイメントのコンセプト](./concepts.md){.internal-link target=_blank}にて見てきたように、有効な戦略がいくつかあります。
+前のチャプターである[デプロイメントのコンセプト](concepts.md){.internal-link target=_blank}にて見てきたように、有効な戦略がいくつかあります。
ここでは**Gunicorn**が**Uvicornのワーカー・プロセス**を管理する場合の使い方について紹介していきます。
!!! info
- DockerやKubernetesなどのコンテナを使用している場合は、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}
+ DockerやKubernetesなどのコンテナを使用している場合は、次の章で詳しく説明します: [コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}
特に**Kubernetes**上で実行する場合は、おそらく**Gunicornを使用せず**、**コンテナごとに単一のUvicornプロセス**を実行することになりますが、それについてはこの章の後半で説明します。
@@ -167,7 +167,7 @@ $ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
## コンテナとDocker
-次章の[コンテナ内のFastAPI - Docker](./docker.md){.internal-link target=_blank}では、その他の**デプロイのコンセプト**を扱うために実施するであろう戦略をいくつか紹介します。
+次章の[コンテナ内のFastAPI - Docker](docker.md){.internal-link target=_blank}では、その他の**デプロイのコンセプト**を扱うために実施するであろう戦略をいくつか紹介します。
また、**GunicornとUvicornワーカー**を含む**公式Dockerイメージ**と、簡単なケースに役立ついくつかのデフォルト設定も紹介します。
diff --git a/docs/ja/docs/fastapi-people.md b/docs/ja/docs/fastapi-people.md
index 11dd656ea..d92a7bf46 100644
--- a/docs/ja/docs/fastapi-people.md
+++ b/docs/ja/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# FastAPI People
FastAPIには、様々なバックグラウンドの人々を歓迎する素晴らしいコミュニティがあります。
@@ -19,7 +24,7 @@ FastAPIには、様々なバックグラウンドの人々を歓迎する素晴
{% endif %}
-私は **FastAPI** の作成者および Maintainer です。詳しくは [FastAPIを応援 - ヘルプの入手 - 開発者とつながる](help-fastapi.md#開発者とつながる){.internal-link target=_blank} に記載しています。
+私は **FastAPI** の作成者および Maintainer です。詳しくは [FastAPIを応援 - ヘルプの入手 - 開発者とつながる](help-fastapi.md#_1){.internal-link target=_blank} に記載しています。
...ところで、ここではコミュニティを紹介したいと思います。
@@ -29,19 +34,19 @@ FastAPIには、様々なバックグラウンドの人々を歓迎する素晴
紹介するのは次のような人々です:
-* [GitHub issuesで他の人を助ける](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。
+* [GitHub issuesで他の人を助ける](help-fastapi.md#github-issues){.internal-link target=_blank}。
* [プルリクエストをする](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}。
-* プルリクエストのレビューをする ([特に翻訳に重要](contributing.md#translations){.internal-link target=_blank})。
+* プルリクエストのレビューをする ([特に翻訳に重要](contributing.md#_8){.internal-link target=_blank})。
彼らに大きな拍手を。👏 🙇
## 先月最もアクティブだったユーザー
-彼らは、先月の[GitHub issuesで最も多くの人を助けた](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}ユーザーです。☕
+彼らは、先月の[GitHub issuesで最も多くの人を助けた](help-fastapi.md#github-issues){.internal-link target=_blank}ユーザーです。☕
{% if people %}
httpx - `TestClient`を使用するために必要です。
- jinja2 - デフォルトのテンプレート設定を使用する場合は必要です。
-- python-multipart - "parsing"`request.form()`からの変換をサポートしたい場合は必要です。
+- python-multipart - "parsing"`request.form()`からの変換をサポートしたい場合は必要です。
- itsdangerous - `SessionMiddleware` サポートのためには必要です。
- pyyaml - Starlette の `SchemaGenerator` サポートのために必要です。 (FastAPI では必要ないでしょう。)
- graphene - `GraphQLApp` サポートのためには必要です。
-- ujson - `UJSONResponse`を使用する場合は必須です。
FastAPI / Starlette に使用されるもの:
- uvicorn - アプリケーションをロードしてサーブするサーバーのため。
- orjson - `ORJSONResponse`を使用したい場合は必要です。
+- ujson - `UJSONResponse`を使用する場合は必須です。
これらは全て `pip install fastapi[all]`でインストールできます。
diff --git a/docs/ja/docs/python-types.md b/docs/ja/docs/python-types.md
new file mode 100644
index 000000000..f8e02fdc3
--- /dev/null
+++ b/docs/ja/docs/python-types.md
@@ -0,0 +1,315 @@
+# Pythonの型の紹介
+
+**Python 3.6以降** では「型ヒント」オプションがサポートされています。
+
+これらの **"型ヒント"** は変数の型を宣言することができる新しい構文です。(Python 3.6以降)
+
+変数に型を宣言することでエディターやツールがより良いサポートを提供することができます。
+
+ここではPythonの型ヒントについての **クイックチュートリアル/リフレッシュ** で、**FastAPI**でそれらを使用するために必要な最低限のことだけをカバーしています。...実際には本当に少ないです。
+
+**FastAPI** はすべてこれらの型ヒントに基づいており、多くの強みと利点を与えてくれます。
+
+しかしたとえまったく **FastAPI** を使用しない場合でも、それらについて少し学ぶことで利点を得ることができるでしょう。
+
+!!! note "備考"
+ もしあなたがPythonの専門家で、すでに型ヒントについてすべて知っているのであれば、次の章まで読み飛ばしてください。
+
+## 動機
+
+簡単な例から始めてみましょう:
+
+```Python
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+このプログラムを実行すると以下が出力されます:
+
+```
+John Doe
+```
+
+この関数は以下のようなことを行います:
+
+* `first_name`と`last_name`を取得します。
+* `title()`を用いて、それぞれの最初の文字を大文字に変換します。
+* 真ん中にスペースを入れて連結します。
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+### 編集
+
+これはとても簡単なプログラムです。
+
+しかし、今、あなたがそれを一から書いていたと想像してみてください。
+
+パラメータの準備ができていたら、そのとき、関数の定義を始めていたことでしょう...
+
+しかし、そうすると「最初の文字を大文字に変換するあのメソッド」を呼び出す必要があります。
+
+それは`upper`でしたか?`uppercase`でしたか?それとも`first_uppercase`?または`capitalize`?
+
+そして、古くからプログラマーの友人であるエディタで自動補完を試してみます。
+
+関数の最初のパラメータ`first_name`を入力し、ドット(`.`)を入力してから、`Ctrl+Space`を押すと補完が実行されます。
+
+しかし、悲しいことに、これはなんの役にも立ちません:
+
+
+
+### 型の追加
+
+先ほどのコードから一行変更してみましょう。
+
+以下の関数のパラメータ部分を:
+
+```Python
+ first_name, last_name
+```
+
+以下へ変更します:
+
+```Python
+ first_name: str, last_name: str
+```
+
+これだけです。
+
+それが「型ヒント」です:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial002.py!}
+```
+
+これは、以下のようにデフォルト値を宣言するのと同じではありません:
+
+```Python
+ first_name="john", last_name="doe"
+```
+
+それとは別物です。
+
+イコール(`=`)ではなく、コロン(`:`)を使用します。
+
+そして、通常、型ヒントを追加しても、それらがない状態と起こることは何も変わりません。
+
+しかし今、あなたが再びその関数を作成している最中に、型ヒントを使っていると想像してみて下さい。
+
+同じタイミングで`Ctrl+Space`で自動補完を実行すると、以下のようになります:
+
+
+
+これであれば、あなたは「ベルを鳴らす」一つを見つけるまで、オプションを見て、スクロールすることができます:
+
+
+
+## より強い動機
+
+この関数を見てください。すでに型ヒントを持っています:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial003.py!}
+```
+
+エディタは変数の型を知っているので、補完だけでなく、エラーチェックをすることもできます。
+
+
+
+これで`age`を`str(age)`で文字列に変換して修正する必要があることがわかります:
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial004.py!}
+```
+
+## 型の宣言
+
+関数のパラメータとして、型ヒントを宣言している主な場所を確認しました。
+
+これは **FastAPI** で使用する主な場所でもあります。
+
+### 単純な型
+
+`str`だけでなく、Pythonの標準的な型すべてを宣言することができます。
+
+例えば、以下を使用可能です:
+
+* `int`
+* `float`
+* `bool`
+* `bytes`
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial005.py!}
+```
+
+### 型パラメータを持つジェネリック型
+
+データ構造の中には、`dict`、`list`、`set`、そして`tuple`のように他の値を含むことができるものがあります。また内部の値も独自の型を持つことができます。
+
+これらの型や内部の型を宣言するには、Pythonの標準モジュール`typing`を使用します。
+
+これらの型ヒントをサポートするために特別に存在しています。
+
+#### `List`
+
+例えば、`str`の`list`の変数を定義してみましょう。
+
+`typing`から`List`をインポートします(大文字の`L`を含む):
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial006.py!}
+```
+
+同じようにコロン(`:`)の構文で変数を宣言します。
+
+型として、`List`を入力します。
+
+リストはいくつかの内部の型を含む型なので、それらを角括弧で囲んでいます。
+
+```Python hl_lines="4"
+{!../../../docs_src/python_types/tutorial006.py!}
+```
+
+!!! tip "豆知識"
+ 角括弧内の内部の型は「型パラメータ」と呼ばれています。
+
+ この場合、`str`は`List`に渡される型パラメータです。
+
+つまり: 変数`items`は`list`であり、このリストの各項目は`str`です。
+
+そうすることで、エディタはリストの項目を処理している間にもサポートを提供できます。
+
+
+
+タイプがなければ、それはほぼ不可能です。
+
+変数`item`はリスト`items`の要素の一つであることに注意してください。
+
+それでも、エディタはそれが`str`であることを知っていて、そのためのサポートを提供しています。
+
+#### `Tuple` と `Set`
+
+`tuple`と`set`の宣言も同様です:
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial007.py!}
+```
+
+つまり:
+
+* 変数`items_t`は`int`、`int`、`str`の3つの項目を持つ`tuple`です
+
+* 変数`items_s`はそれぞれの項目が`bytes`型である`set`です。
+
+#### `Dict`
+
+`dict`を宣言するためには、カンマ区切りで2つの型パラメータを渡します。
+
+最初の型パラメータは`dict`のキーです。
+
+2番目の型パラメータは`dict`の値です。
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial008.py!}
+```
+
+つまり:
+
+* 変数`prices`は`dict`であり:
+ * この`dict`のキーは`str`型です。(つまり、各項目の名前)
+ * この`dict`の値は`float`型です。(つまり、各項目の価格)
+
+#### `Optional`
+
+また、`Optional`を使用して、変数が`str`のような型を持つことを宣言することもできますが、それは「オプション」であり、`None`にすることもできます。
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009.py!}
+```
+
+ただの`str`の代わりに`Optional[str]`を使用することで、エディタは値が常に`str`であると仮定している場合に実際には`None`である可能性があるエラーを検出するのに役立ちます。
+
+#### ジェネリック型
+
+以下のように角括弧で型パラメータを取る型を:
+
+* `List`
+* `Tuple`
+* `Set`
+* `Dict`
+* `Optional`
+* ...など
+
+**ジェネリック型** または **ジェネリクス** と呼びます。
+
+### 型としてのクラス
+
+変数の型としてクラスを宣言することもできます。
+
+例えば、`Person`クラスという名前のクラスがあるとしましょう:
+
+```Python hl_lines="1 2 3"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+変数の型を`Person`として宣言することができます:
+
+```Python hl_lines="6"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+そして、再び、すべてのエディタのサポートを得ることができます:
+
+
+
+## Pydanticのモデル
+
+Pydantic はデータ検証を行うためのPythonライブラリです。
+
+データの「形」を属性付きのクラスとして宣言します。
+
+そして、それぞれの属性は型を持ちます。
+
+さらに、いくつかの値を持つクラスのインスタンスを作成すると、その値を検証し、適切な型に変換して(もしそうであれば)全てのデータを持つオブジェクトを提供してくれます。
+
+また、その結果のオブジェクトですべてのエディタのサポートを受けることができます。
+
+Pydanticの公式ドキュメントから引用:
+
+```Python
+{!../../../docs_src/python_types/tutorial011.py!}
+```
+
+!!! info "情報"
+ Pydanticについてより学びたい方はドキュメントを参照してください.
+
+**FastAPI** はすべてPydanticをベースにしています。
+
+すべてのことは[チュートリアル - ユーザーガイド](tutorial/index.md){.internal-link target=_blank}で実際に見ることができます。
+
+## **FastAPI**での型ヒント
+
+**FastAPI** はこれらの型ヒントを利用していくつかのことを行います。
+
+**FastAPI** では型ヒントを使って型パラメータを宣言すると以下のものが得られます:
+
+* **エディタサポート**.
+* **型チェック**.
+
+...そして **FastAPI** は同じように宣言をすると、以下のことを行います:
+
+* **要件の定義**: リクエストパスパラメータ、クエリパラメータ、ヘッダー、ボディ、依存関係などから要件を定義します。
+* **データの変換**: リクエストのデータを必要な型に変換します。
+* **データの検証**: リクエストごとに:
+ * データが無効な場合にクライアントに返される **自動エラー** を生成します。
+* **ドキュメント** OpenAPIを使用したAPI:
+ * 自動的に対話型ドキュメントのユーザーインターフェイスで使用されます。
+
+すべてが抽象的に聞こえるかもしれません。心配しないでください。 この全ての動作は [チュートリアル - ユーザーガイド](tutorial/index.md){.internal-link target=_blank}で見ることができます。
+
+重要なのは、Pythonの標準的な型を使うことで、(クラスやデコレータなどを追加するのではなく)1つの場所で **FastAPI** が多くの作業を代わりにやってくれているということです。
+
+!!! info "情報"
+ すでにすべてのチュートリアルを終えて、型についての詳細を見るためにこのページに戻ってきた場合は、`mypy`のチートシートを参照してください
diff --git a/docs/ja/docs/tutorial/background-tasks.md b/docs/ja/docs/tutorial/background-tasks.md
new file mode 100644
index 000000000..6094c370f
--- /dev/null
+++ b/docs/ja/docs/tutorial/background-tasks.md
@@ -0,0 +1,94 @@
+# バックグラウンドタスク
+
+レスポンスを返した *後に* 実行されるバックグラウンドタスクを定義できます。
+
+これは、リクエスト後に処理を開始する必要があるが、クライアントがレスポンスを受け取る前に処理を終える必要のない操作に役立ちます。
+
+これには、たとえば次のものが含まれます。
+
+* 作業実行後のメール通知:
+ * メールサーバーへの接続とメールの送信は「遅い」(数秒) 傾向があるため、すぐにレスポンスを返し、バックグラウンドでメール通知ができます。
+* データ処理:
+ * たとえば、時間のかかる処理を必要とするファイル受信時には、「受信済み」(HTTP 202) のレスポンスを返し、バックグラウンドで処理できます。
+
+## `BackgroundTasks` の使用
+
+まず初めに、`BackgroundTasks` をインポートし、` BackgroundTasks` の型宣言と共に、*path operation 関数* のパラメーターを定義します:
+
+```Python hl_lines="1 13"
+{!../../../docs_src/background_tasks/tutorial001.py!}
+```
+
+**FastAPI** は、`BackgroundTasks` 型のオブジェクトを作成し、そのパラメーターに渡します。
+
+## タスク関数の作成
+
+バックグラウンドタスクとして実行される関数を作成します。
+
+これは、パラメーターを受け取ることができる単なる標準的な関数です。
+
+これは `async def` または通常の `def` 関数であり、**FastAPI** はこれを正しく処理します。
+
+ここで、タスク関数はファイル書き込みを実行します (メール送信のシミュレーション)。
+
+また、書き込み操作では `async` と `await` を使用しないため、通常の `def` で関数を定義します。
+
+```Python hl_lines="6-9"
+{!../../../docs_src/background_tasks/tutorial001.py!}
+```
+
+## バックグラウンドタスクの追加
+
+*path operations 関数* 内で、`.add_task()` メソッドを使用してタスク関数を *background tasks* オブジェクトに渡します。
+
+```Python hl_lines="14"
+{!../../../docs_src/background_tasks/tutorial001.py!}
+```
+
+`.add_task()` は以下の引数を受け取ります:
+
+* バックグラウンドで実行されるタスク関数 (`write_notification`)。
+* タスク関数に順番に渡す必要のある引数の列 (`email`)。
+* タスク関数に渡す必要のあるキーワード引数 (`message="some notification"`)。
+
+## 依存性注入
+
+`BackgroundTasks` の使用は依存性注入システムでも機能し、様々な階層 (*path operations 関数*、依存性 (依存可能性)、サブ依存性など) で `BackgroundTasks` 型のパラメーターを宣言できます。
+
+**FastAPI** は、それぞれの場合の処理方法と同じオブジェクトの再利用方法を知っているため、すべてのバックグラウンドタスクがマージされ、バックグラウンドで後で実行されます。
+
+```Python hl_lines="13 15 22 25"
+{!../../../docs_src/background_tasks/tutorial002.py!}
+```
+
+この例では、レスポンスが送信された *後* にメッセージが `log.txt` ファイルに書き込まれます。
+
+リクエストにクエリがあった場合、バックグラウンドタスクでログに書き込まれます。
+
+そして、*path operations 関数* で生成された別のバックグラウンドタスクは、`email` パスパラメータを使用してメッセージを書き込みます。
+
+## 技術的な詳細
+
+`BackgroundTasks` クラスは、`starlette.background`から直接取得されます。
+
+これは、FastAPI に直接インポート/インクルードされるため、`fastapi` からインポートできる上に、`starlette.background`から別の `BackgroundTask` (末尾に `s` がない) を誤ってインポートすることを回避できます。
+
+`BackgroundTasks`のみを使用することで (`BackgroundTask` ではなく)、`Request` オブジェクトを直接使用する場合と同様に、それを *path operations 関数* パラメーターとして使用し、**FastAPI** に残りの処理を任せることができます。
+
+それでも、FastAPI で `BackgroundTask` を単独で使用することは可能ですが、コード内でオブジェクトを作成し、それを含むStarlette `Response` を返す必要があります。
+
+詳細については、バックグラウンドタスクに関する Starlette の公式ドキュメントを参照して下さい。
+
+## 警告
+
+大量のバックグラウンド計算が必要であり、必ずしも同じプロセスで実行する必要がない場合 (たとえば、メモリや変数などを共有する必要がない場合)、Celery のようなより大きな他のツールを使用するとメリットがあるかもしれません。
+
+これらは、より複雑な構成、RabbitMQ や Redis などのメッセージ/ジョブキューマネージャーを必要とする傾向がありますが、複数のプロセス、特に複数のサーバーでバックグラウンドタスクを実行できます。
+
+例を確認するには、[Project Generators](../project-generation.md){.internal-link target=_blank} を参照してください。これらにはすべて、Celery が構築済みです。
+
+ただし、同じ **FastAPI** アプリから変数とオブジェクトにアクセスする必要がある場合、または小さなバックグラウンドタスク (電子メール通知の送信など) を実行する必要がある場合は、単に `BackgroundTasks` を使用できます。
+
+## まとめ
+
+`BackgroundTasks` をインポートして、*path operations 関数* や依存関係のパラメータに `BackgroundTasks`を使用し、バックグラウンドタスクを追加して下さい。
diff --git a/docs/ja/docs/tutorial/body-fields.md b/docs/ja/docs/tutorial/body-fields.md
new file mode 100644
index 000000000..8f01e8216
--- /dev/null
+++ b/docs/ja/docs/tutorial/body-fields.md
@@ -0,0 +1,48 @@
+# ボディ - フィールド
+
+`Query`や`Path`、`Body`を使って *path operation関数* のパラメータに追加のバリデーションやメタデータを宣言するのと同じように、Pydanticの`Field`を使ってPydanticモデルの内部でバリデーションやメタデータを宣言することができます。
+
+## `Field`のインポート
+
+まず、以下のようにインポートします:
+
+```Python hl_lines="4"
+{!../../../docs_src/body_fields/tutorial001.py!}
+```
+
+!!! warning "注意"
+ `Field`は他の全てのもの(`Query`、`Path`、`Body`など)とは違い、`fastapi`からではなく、`pydantic`から直接インポートされていることに注意してください。
+
+## モデルの属性の宣言
+
+以下のように`Field`をモデルの属性として使用することができます:
+
+```Python hl_lines="11 12 13 14"
+{!../../../docs_src/body_fields/tutorial001.py!}
+```
+
+`Field`は`Query`や`Path`、`Body`と同じように動作し、全く同様のパラメータなどを持ちます。
+
+!!! note "技術詳細"
+ 実際には次に見る`Query`や`Path`などは、共通の`Param`クラスのサブクラスのオブジェクトを作成しますが、それ自体はPydanticの`FieldInfo`クラスのサブクラスです。
+
+ また、Pydanticの`Field`は`FieldInfo`のインスタンスも返します。
+
+ `Body`は`FieldInfo`のサブクラスのオブジェクトを直接返すこともできます。そして、他にも`Body`クラスのサブクラスであるものがあります。
+
+ `fastapi`から`Query`や`Path`などをインポートする場合、これらは実際には特殊なクラスを返す関数であることに注意してください。
+
+!!! tip "豆知識"
+ 型、デフォルト値、`Field`を持つ各モデルの属性が、`Path`や`Query`、`Body`の代わりに`Field`を持つ、*path operation 関数の*パラメータと同じ構造になっていることに注目してください。
+
+## 追加情報の追加
+
+追加情報は`Field`や`Query`、`Body`などで宣言することができます。そしてそれは生成されたJSONスキーマに含まれます。
+
+後に例を用いて宣言を学ぶ際に、追加情報を句悪方法を学べます。
+
+## まとめ
+
+Pydanticの`Field`を使用して、モデルの属性に追加のバリデーションやメタデータを宣言することができます。
+
+追加のキーワード引数を使用して、追加のJSONスキーマのメタデータを渡すこともできます。
diff --git a/docs/ja/docs/tutorial/body-multiple-params.md b/docs/ja/docs/tutorial/body-multiple-params.md
new file mode 100644
index 000000000..2ba10c583
--- /dev/null
+++ b/docs/ja/docs/tutorial/body-multiple-params.md
@@ -0,0 +1,169 @@
+# ボディ - 複数のパラメータ
+
+これまで`Path`と`Query`をどう使うかを見てきましたが、リクエストボディの宣言のより高度な使い方を見てみましょう。
+
+## `Path`、`Query`とボディパラメータを混ぜる
+
+まず、もちろん、`Path`と`Query`とリクエストボディのパラメータの宣言は自由に混ぜることができ、 **FastAPI** は何をするべきかを知っています。
+
+また、デフォルトの`None`を設定することで、ボディパラメータをオプションとして宣言することもできます:
+
+```Python hl_lines="19 20 21"
+{!../../../docs_src/body_multiple_params/tutorial001.py!}
+```
+
+!!! note "備考"
+ この場合、ボディから取得する`item`はオプションであることに注意してください。デフォルト値は`None`です。
+
+## 複数のボディパラメータ
+
+上述の例では、*path operations*は`item`の属性を持つ以下のようなJSONボディを期待していました:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+}
+```
+
+しかし、`item`と`user`のように複数のボディパラメータを宣言することもできます:
+
+```Python hl_lines="22"
+{!../../../docs_src/body_multiple_params/tutorial002.py!}
+```
+
+この場合、**FastAPI**は関数内に複数のボディパラメータ(Pydanticモデルである2つのパラメータ)があることに気付きます。
+
+そのため、パラメータ名をボディのキー(フィールド名)として使用し、以下のようなボディを期待しています:
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ },
+ "user": {
+ "username": "dave",
+ "full_name": "Dave Grohl"
+ }
+}
+```
+
+!!! note "備考"
+ 以前と同じように`item`が宣言されていたにもかかわらず、`item`はキー`item`を持つボディの内部にあることが期待されていることに注意してください。
+
+**FastAPI** はリクエストから自動で変換を行い、パラメータ`item`が特定の内容を受け取り、`user`も同じように特定の内容を受け取ります。
+
+複合データの検証を行い、OpenAPIスキーマや自動ドキュメントのように文書化してくれます。
+
+## ボディ内の単数値
+
+クエリとパスパラメータの追加データを定義するための `Query` と `Path` があるのと同じように、 **FastAPI** は同等の `Body` を提供します。
+
+例えば、前のモデルを拡張して、同じボディに `item` と `user` の他にもう一つのキー `importance` を入れたいと決めることができます。
+
+単数値なのでそのまま宣言すると、**FastAPI** はそれがクエリパラメータであるとみなします。
+
+しかし、`Body`を使用して、**FastAPI** に別のボディキーとして扱うように指示することができます:
+
+
+```Python hl_lines="23"
+{!../../../docs_src/body_multiple_params/tutorial003.py!}
+```
+
+この場合、**FastAPI** は以下のようなボディを期待します:
+
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ },
+ "user": {
+ "username": "dave",
+ "full_name": "Dave Grohl"
+ },
+ "importance": 5
+}
+```
+
+繰り返しになりますが、データ型の変換、検証、文書化などを行います。
+
+## 複数のボディパラメータとクエリ
+
+もちろん、ボディパラメータに加えて、必要に応じて追加のクエリパラメータを宣言することもできます。
+
+デフォルトでは、単数値はクエリパラメータとして解釈されるので、明示的に `Query` を追加する必要はありません。
+
+```Python
+q: str = None
+```
+
+以下において:
+
+```Python hl_lines="27"
+{!../../../docs_src/body_multiple_params/tutorial004.py!}
+```
+
+!!! info "情報"
+ `Body`もまた、後述する `Query` や `Path` などと同様に、すべての検証パラメータとメタデータパラメータを持っています。
+
+
+## 単一のボディパラメータの埋め込み
+
+Pydanticモデル`Item`のボディパラメータ`item`を1つだけ持っているとしましょう。
+
+デフォルトでは、**FastAPI**はそのボディを直接期待します。
+
+しかし、追加のボディパラメータを宣言したときのように、キー `item` を持つ JSON とその中のモデルの内容を期待したい場合は、特別な `Body` パラメータ `embed` を使うことができます:
+
+```Python
+item: Item = Body(..., embed=True)
+```
+
+以下において:
+
+```Python hl_lines="17"
+{!../../../docs_src/body_multiple_params/tutorial005.py!}
+```
+
+この場合、**FastAPI** は以下のようなボディを期待します:
+
+```JSON hl_lines="2"
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ }
+}
+```
+
+以下の代わりに:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+}
+```
+
+## まとめ
+
+リクエストが単一のボディしか持てない場合でも、*path operation関数*に複数のボディパラメータを追加することができます。
+
+しかし、**FastAPI** はそれを処理し、関数内の正しいデータを与え、*path operation*内の正しいスキーマを検証し、文書化します。
+
+また、ボディの一部として受け取る単数値を宣言することもできます。
+
+また、単一のパラメータしか宣言されていない場合でも、ボディをキーに埋め込むように **FastAPI** に指示することができます。
diff --git a/docs/ja/docs/tutorial/body-nested-models.md b/docs/ja/docs/tutorial/body-nested-models.md
new file mode 100644
index 000000000..092e25798
--- /dev/null
+++ b/docs/ja/docs/tutorial/body-nested-models.md
@@ -0,0 +1,244 @@
+# ボディ - ネストされたモデル
+
+**FastAPI** を使用すると、深くネストされた任意のモデルを定義、検証、文書化、使用することができます(Pydanticのおかげです)。
+
+## リストのフィールド
+
+属性をサブタイプとして定義することができます。例えば、Pythonの`list`は以下のように定義できます:
+
+```Python hl_lines="12"
+{!../../../docs_src/body_nested_models/tutorial001.py!}
+```
+
+これにより、各項目の型は宣言されていませんが、`tags`はある項目のリストになります。
+
+## タイプパラメータを持つリストのフィールド
+
+しかし、Pythonには型や「タイプパラメータ」を使ってリストを宣言する方法があります:
+
+### typingの`List`をインポート
+
+まず、Pythonの標準の`typing`モジュールから`List`をインポートします:
+
+```Python hl_lines="1"
+{!../../../docs_src/body_nested_models/tutorial002.py!}
+```
+
+### タイプパラメータを持つ`List`の宣言
+
+`list`や`dict`、`tuple`のようなタイプパラメータ(内部の型)を持つ型を宣言するには:
+
+* `typing`モジュールからそれらをインストールします。
+* 角括弧(`[`と`]`)を使って「タイプパラメータ」として内部の型を渡します:
+
+```Python
+from typing import List
+
+my_list: List[str]
+```
+
+型宣言の標準的なPythonの構文はこれだけです。
+
+内部の型を持つモデルの属性にも同じ標準の構文を使用してください。
+
+そのため、以下の例では`tags`を具体的な「文字列のリスト」にすることができます:
+
+```Python hl_lines="14"
+{!../../../docs_src/body_nested_models/tutorial002.py!}
+```
+
+## セット型
+
+しかし、よく考えてみると、タグは繰り返すべきではなく、おそらくユニークな文字列になるのではないかと気付いたとします。
+
+そして、Pythonにはユニークな項目のセットのための特別なデータ型`set`があります。
+
+そのため、以下のように、`Set`をインポートして`str`の`set`として`tags`を宣言することができます:
+
+```Python hl_lines="1 14"
+{!../../../docs_src/body_nested_models/tutorial003.py!}
+```
+
+これを使えば、データが重複しているリクエストを受けた場合でも、ユニークな項目のセットに変換されます。
+
+そして、そのデータを出力すると、たとえソースに重複があったとしても、固有の項目のセットとして出力されます。
+
+また、それに応じて注釈をつけたり、文書化したりします。
+
+## ネストされたモデル
+
+Pydanticモデルの各属性には型があります。
+
+しかし、その型はそれ自体が別のPydanticモデルである可能性があります。
+
+そのため、特定の属性名、型、バリデーションを指定して、深くネストしたJSON`object`を宣言することができます。
+
+すべては、任意のネストにされています。
+
+### サブモデルの定義
+
+例えば、`Image`モデルを定義することができます:
+
+```Python hl_lines="9 10 11"
+{!../../../docs_src/body_nested_models/tutorial004.py!}
+```
+
+### サブモデルを型として使用
+
+そして、それを属性の型として使用することができます:
+
+```Python hl_lines="20"
+{!../../../docs_src/body_nested_models/tutorial004.py!}
+```
+
+これは **FastAPI** が以下のようなボディを期待することを意味します:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2,
+ "tags": ["rock", "metal", "bar"],
+ "image": {
+ "url": "http://example.com/baz.jpg",
+ "name": "The Foo live"
+ }
+}
+```
+
+繰り返しになりますが、**FastAPI** を使用して、その宣言を行うだけで以下のような恩恵を受けられます:
+
+* ネストされたモデルでも対応可能なエディタのサポート(補完など)
+* データ変換
+* データの検証
+* 自動文書化
+
+## 特殊な型とバリデーション
+
+`str`や`int`、`float`のような通常の単数型の他にも、`str`を継承したより複雑な単数型を使うこともできます。
+
+すべてのオプションをみるには、Pydanticのエキゾチック な型のドキュメントを確認してください。次の章でいくつかの例をみることができます。
+
+例えば、`Image`モデルのように`url`フィールドがある場合、`str`の代わりにPydanticの`HttpUrl`を指定することができます:
+
+```Python hl_lines="4 10"
+{!../../../docs_src/body_nested_models/tutorial005.py!}
+```
+
+文字列は有効なURLであることが確認され、そのようにJSONスキーマ・OpenAPIで文書化されます。
+
+## サブモデルのリストを持つ属性
+
+Pydanticモデルを`list`や`set`などのサブタイプとして使用することもできます:
+
+```Python hl_lines="20"
+{!../../../docs_src/body_nested_models/tutorial006.py!}
+```
+
+これは、次のようなJSONボディを期待します(変換、検証、ドキュメントなど):
+
+```JSON hl_lines="11"
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2,
+ "tags": [
+ "rock",
+ "metal",
+ "bar"
+ ],
+ "images": [
+ {
+ "url": "http://example.com/baz.jpg",
+ "name": "The Foo live"
+ },
+ {
+ "url": "http://example.com/dave.jpg",
+ "name": "The Baz"
+ }
+ ]
+}
+```
+
+!!! info "情報"
+ `images`キーが画像オブジェクトのリストを持つようになったことに注目してください。
+
+## 深くネストされたモデル
+
+深くネストされた任意のモデルを定義することができます:
+
+```Python hl_lines="9 14 20 23 27"
+{!../../../docs_src/body_nested_models/tutorial007.py!}
+```
+
+!!! info "情報"
+ `Offer`は`Item`のリストであり、オプションの`Image`のリストを持っていることに注目してください。
+
+## 純粋なリストのボディ
+
+期待するJSONボディのトップレベルの値がJSON`array`(Pythonの`list`)であれば、Pydanticモデルと同じように、関数のパラメータで型を宣言することができます:
+
+```Python
+images: List[Image]
+```
+
+以下のように:
+
+```Python hl_lines="15"
+{!../../../docs_src/body_nested_models/tutorial008.py!}
+```
+
+## あらゆる場所でのエディタサポート
+
+エディタのサポートもどこでも受けることができます。
+
+以下のようにリストの中の項目でも:
+
+
+
+Pydanticモデルではなく、`dict`を直接使用している場合はこのようなエディタのサポートは得られません。
+
+しかし、それらについて心配する必要はありません。入力された辞書は自動的に変換され、出力も自動的にJSONに変換されます。
+
+## 任意の`dict`のボディ
+
+また、ある型のキーと別の型の値を持つ`dict`としてボディを宣言することもできます。
+
+有効なフィールド・属性名を事前に知る必要がありません(Pydanticモデルの場合のように)。
+
+これは、まだ知らないキーを受け取りたいときに便利だと思います。
+
+---
+
+他にも、`int`のように他の型のキーを持ちたい場合などに便利です。
+
+それをここで見ていきましょう。
+
+この場合、`int`のキーと`float`の値を持つものであれば、どんな`dict`でも受け入れることができます:
+
+```Python hl_lines="15"
+{!../../../docs_src/body_nested_models/tutorial009.py!}
+```
+
+!!! tip "豆知識"
+ JSONはキーとして`str`しかサポートしていないことに注意してください。
+
+ しかしPydanticには自動データ変換機能があります。
+
+ これは、APIクライアントがキーとして文字列しか送信できなくても、それらの文字列に純粋な整数が含まれている限り、Pydanticが変換して検証することを意味します。
+
+ そして、`weights`として受け取る`dict`は、実際には`int`のキーと`float`の値を持つことになります。
+
+## まとめ
+
+**FastAPI** を使用すると、Pydanticモデルが提供する最大限の柔軟性を持ちながら、コードをシンプルに短く、エレガントに保つことができます。
+
+以下のような利点があります:
+
+* エディタのサポート(どこでも補完!)
+* データ変換(別名:構文解析・シリアライズ)
+* データの検証
+* スキーマ文書
+* 自動文書化
diff --git a/docs/ja/docs/tutorial/body-updates.md b/docs/ja/docs/tutorial/body-updates.md
index 7a56ef2b9..95d328ec5 100644
--- a/docs/ja/docs/tutorial/body-updates.md
+++ b/docs/ja/docs/tutorial/body-updates.md
@@ -34,7 +34,7 @@
つまり、更新したいデータだけを送信して、残りはそのままにしておくことができます。
-!!! Note "備考"
+!!! note "備考"
`PATCH`は`PUT`よりもあまり使われておらず、知られていません。
また、多くのチームは部分的な更新であっても`PUT`だけを使用しています。
diff --git a/docs/ja/docs/tutorial/body.md b/docs/ja/docs/tutorial/body.md
index d2559205b..ccce9484d 100644
--- a/docs/ja/docs/tutorial/body.md
+++ b/docs/ja/docs/tutorial/body.md
@@ -6,7 +6,7 @@
APIはほとんどの場合 **レスポンス** ボディを送らなければなりません。しかし、クライアントは必ずしも **リクエスト** ボディを送らなければいけないわけではありません。
-**リクエスト** ボディを宣言するために Pydantic モデルを使用します。そして、その全てのパワーとメリットを利用します。
+**リクエスト** ボディを宣言するために Pydantic モデルを使用します。そして、その全てのパワーとメリットを利用します。
!!! info "情報"
データを送るには、`POST` (もっともよく使われる)、`PUT`、`DELETE` または `PATCH` を使うべきです。
@@ -162,4 +162,4 @@ APIはほとんどの場合 **レスポンス** ボディを送らなければ
## Pydanticを使わない方法
-もしPydanticモデルを使用したくない場合は、**Body**パラメータが利用できます。[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}を確認してください。
+もしPydanticモデルを使用したくない場合は、**Body**パラメータが利用できます。[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#_2){.internal-link target=_blank}を確認してください。
diff --git a/docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md b/docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md
new file mode 100644
index 000000000..5c150d00c
--- /dev/null
+++ b/docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md
@@ -0,0 +1,191 @@
+# 依存関係としてのクラス
+
+**依存性注入** システムを深く掘り下げる前に、先ほどの例をアップグレードしてみましょう。
+
+## 前の例の`dict`
+
+前の例では、依存関係("dependable")から`dict`を返していました:
+
+```Python hl_lines="9"
+{!../../../docs_src/dependencies/tutorial001.py!}
+```
+
+しかし、*path operation関数*のパラメータ`commons`に`dict`が含まれています。
+
+また、エディタは`dict`のキーと値の型を知ることができないため、多くのサポート(補完のような)を提供することができません。
+
+もっとうまくやれるはずです...。
+
+## 依存関係を作るもの
+
+これまでは、依存関係が関数として宣言されているのを見てきました。
+
+しかし、依存関係を定義する方法はそれだけではありません(その方が一般的かもしれませんが)。
+
+重要なのは、依存関係が「呼び出し可能」なものであることです。
+
+Pythonにおける「**呼び出し可能**」とは、Pythonが関数のように「呼び出す」ことができるものを指します。
+
+そのため、`something`オブジェクト(関数ではないかもしれませんが)を持っていて、それを次のように「呼び出す」(実行する)ことができるとします:
+
+```Python
+something()
+```
+
+または
+
+```Python
+something(some_argument, some_keyword_argument="foo")
+```
+
+これを「呼び出し可能」なものと呼びます。
+
+## 依存関係としてのクラス
+
+Pythonのクラスのインスタンスを作成する際に、同じ構文を使用していることに気づくかもしれません。
+
+例えば:
+
+```Python
+class Cat:
+ def __init__(self, name: str):
+ self.name = name
+
+
+fluffy = Cat(name="Mr Fluffy")
+```
+
+この場合、`fluffy`は`Cat`クラスのインスタンスです。
+
+そして`fluffy`を作成するために、`Cat`を「呼び出している」ことになります。
+
+そのため、Pythonのクラスもまた「呼び出し可能」です。
+
+そして、**FastAPI** では、Pythonのクラスを依存関係として使用することができます。
+
+FastAPIが実際にチェックしているのは、それが「呼び出し可能」(関数、クラス、その他なんでも)であり、パラメータが定義されているかどうかということです。
+
+**FastAPI** の依存関係として「呼び出し可能なもの」を渡すと、その「呼び出し可能なもの」のパラメータを解析し、サブ依存関係も含めて、*path operation関数*のパラメータと同じように処理します。
+
+それは、パラメータが全くない呼び出し可能なものにも適用されます。パラメータのない*path operation関数*と同じように。
+
+そこで、上で紹介した依存関係の`common_parameters`を`CommonQueryParams`クラスに変更します:
+
+```Python hl_lines="11 12 13 14 15"
+{!../../../docs_src/dependencies/tutorial002.py!}
+```
+
+クラスのインスタンスを作成するために使用される`__init__`メソッドに注目してください:
+
+```Python hl_lines="12"
+{!../../../docs_src/dependencies/tutorial002.py!}
+```
+
+...以前の`common_parameters`と同じパラメータを持っています:
+
+```Python hl_lines="8"
+{!../../../docs_src/dependencies/tutorial001.py!}
+```
+
+これらのパラメータは **FastAPI** が依存関係を「解決」するために使用するものです。
+
+どちらの場合も以下を持っています:
+
+* オプショナルの`q`クエリパラメータ。
+* `skip`クエリパラメータ、デフォルトは`0`。
+* `limit`クエリパラメータ、デフォルトは`100`。
+
+どちらの場合も、データは変換され、検証され、OpenAPIスキーマなどで文書化されます。
+
+## 使用
+
+これで、このクラスを使用して依存関係を宣言することができます。
+
+```Python hl_lines="19"
+{!../../../docs_src/dependencies/tutorial002.py!}
+```
+
+**FastAPI** は`CommonQueryParams`クラスを呼び出します。これにより、そのクラスの「インスタンス」が作成され、インスタンスはパラメータ`commons`として関数に渡されます。
+
+## 型注釈と`Depends`
+
+上のコードでは`CommonQueryParams`を2回書いていることに注目してください:
+
+```Python
+commons: CommonQueryParams = Depends(CommonQueryParams)
+```
+
+以下にある最後の`CommonQueryParams`:
+
+```Python
+... = Depends(CommonQueryParams)
+```
+
+...は、**FastAPI** が依存関係を知るために実際に使用するものです。
+
+そこからFastAPIが宣言されたパラメータを抽出し、それが実際にFastAPIが呼び出すものです。
+
+---
+
+この場合、以下にある最初の`CommonQueryParams`:
+
+```Python
+commons: CommonQueryParams ...
+```
+
+...は **FastAPI** に対して特別な意味をもちません。FastAPIはデータ変換や検証などには使用しません(それらのためには`= Depends(CommonQueryParams)`を使用しています)。
+
+実際には以下のように書けばいいだけです:
+
+```Python
+commons = Depends(CommonQueryParams)
+```
+
+以下にあるように:
+
+```Python hl_lines="19"
+{!../../../docs_src/dependencies/tutorial003.py!}
+```
+
+しかし、型を宣言することは推奨されています。そうすれば、エディタは`commons`のパラメータとして何が渡されるかを知ることができ、コードの補完や型チェックなどを行うのに役立ちます:
+
+
+
+## ショートカット
+
+しかし、ここでは`CommonQueryParams`を2回書くというコードの繰り返しが発生していることがわかります:
+
+```Python
+commons: CommonQueryParams = Depends(CommonQueryParams)
+```
+
+依存関係が、クラス自体のインスタンスを作成するために**FastAPI**が「呼び出す」*特定の*クラスである場合、**FastAPI** はこれらのケースのショートカットを提供しています。
+
+それらの具体的なケースについては以下のようにします:
+
+以下のように書く代わりに:
+
+```Python
+commons: CommonQueryParams = Depends(CommonQueryParams)
+```
+
+...以下のように書きます:
+
+```Python
+commons: CommonQueryParams = Depends()
+```
+
+パラメータの型として依存関係を宣言し、`Depends()`の中でパラメータを指定せず、`Depends()`をその関数のパラメータの「デフォルト」値(`=`のあとの値)として使用することで、`Depends(CommonQueryParams)`の中でクラス全体を*もう一度*書かなくてもよくなります。
+
+同じ例では以下のようになります:
+
+```Python hl_lines="19"
+{!../../../docs_src/dependencies/tutorial004.py!}
+```
+
+...そして **FastAPI** は何をすべきか知っています。
+
+!!! tip "豆知識"
+ 役に立つというよりも、混乱するようであれば無視してください。それをする*必要*はありません。
+
+ それは単なるショートカットです。なぜなら **FastAPI** はコードの繰り返しを最小限に抑えることに気を使っているからです。
diff --git a/docs/ja/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md b/docs/ja/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
new file mode 100644
index 000000000..1684d9ca1
--- /dev/null
+++ b/docs/ja/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
@@ -0,0 +1,62 @@
+# path operationデコレータの依存関係
+
+場合によっては*path operation関数*の中で依存関係の戻り値を本当に必要としないこともあります。
+
+もしくは、依存関係が値を返さない場合もあります。
+
+しかし、それでも実行・解決する必要があります。
+
+このような場合、*path operation関数*のパラメータを`Depends`で宣言する代わりに、*path operation decorator*に`dependencies`の`list`を追加することができます。
+
+## *path operationデコレータ*への`dependencies`の追加
+
+*path operationデコレータ*はオプショナルの引数`dependencies`を受け取ります。
+
+それは`Depends()`の`list`であるべきです:
+
+```Python hl_lines="17"
+{!../../../docs_src/dependencies/tutorial006.py!}
+```
+
+これらの依存関係は、通常の依存関係と同様に実行・解決されます。しかし、それらの値(何かを返す場合)は*path operation関数*には渡されません。
+
+!!! tip "豆知識"
+ エディタによっては、未使用の関数パラメータをチェックしてエラーとして表示するものもあります。
+
+ `dependencies`を`path operationデコレータ`で使用することで、エディタやツールのエラーを回避しながら確実に実行することができます。
+
+ また、コードの未使用のパラメータがあるのを見て、それが不要だと思ってしまうような新しい開発者の混乱を避けるのにも役立つかもしれません。
+
+## 依存関係のエラーと戻り値
+
+通常使用している依存関係の*関数*と同じものを使用することができます。
+
+### 依存関係の要件
+
+これらはリクエストの要件(ヘッダのようなもの)やその他のサブ依存関係を宣言することができます:
+
+```Python hl_lines="6 11"
+{!../../../docs_src/dependencies/tutorial006.py!}
+```
+
+### 例外の発生
+
+これらの依存関係は通常の依存関係と同じように、例外を`raise`発生させることができます:
+
+```Python hl_lines="8 13"
+{!../../../docs_src/dependencies/tutorial006.py!}
+```
+
+### 戻り値
+
+そして、値を返すことも返さないこともできますが、値は使われません。
+
+つまり、すでにどこかで使っている通常の依存関係(値を返すもの)を再利用することができ、値は使われなくても依存関係は実行されます:
+
+```Python hl_lines="9 14"
+{!../../../docs_src/dependencies/tutorial006.py!}
+```
+
+## *path operations*のグループに対する依存関係
+
+後で、より大きなアプリケーションの構造([Bigger Applications - Multiple Files](../../tutorial/bigger-applications.md){.internal-link target=_blank})について読む時に、おそらく複数のファイルを使用して、*path operations*のグループに対して単一の`dependencies`パラメータを宣言する方法を学ぶでしょう。
diff --git a/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md
new file mode 100644
index 000000000..c0642efd4
--- /dev/null
+++ b/docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -0,0 +1,225 @@
+# yieldを持つ依存関係
+
+FastAPIは、いくつかの終了後の追加のステップを行う依存関係をサポートしています。
+
+これを行うには、`return`の代わりに`yield`を使い、その後に追加のステップを書きます。
+
+!!! tip "豆知識"
+ `yield`は必ず一度だけ使用するようにしてください。
+
+!!! info "情報"
+ これを動作させるには、**Python 3.7** 以上を使用するか、**Python 3.6** では"backports"をインストールする必要があります:
+
+ ```
+ pip install async-exit-stack async-generator
+ ```
+
+ これによりasync-exit-stackとasync-generatorがインストールされます。
+
+!!! note "技術詳細"
+ 以下と一緒に使用できる関数なら何でも有効です:
+
+ * `@contextlib.contextmanager`または
+ * `@contextlib.asynccontextmanager`
+
+ これらは **FastAPI** の依存関係として使用するのに有効です。
+
+ 実際、FastAPIは内部的にこれら2つのデコレータを使用しています。
+
+## `yield`を持つデータベースの依存関係
+
+例えば、これを使ってデータベースセッションを作成し、終了後にそれを閉じることができます。
+
+レスポンスを送信する前に`yield`文を含む前のコードのみが実行されます。
+
+```Python hl_lines="2 3 4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+生成された値は、*path operations*や他の依存関係に注入されるものです:
+
+```Python hl_lines="4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+`yield`文に続くコードは、レスポンスが送信された後に実行されます:
+
+```Python hl_lines="5 6"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+!!! tip "豆知識"
+ `async`や通常の関数を使用することができます。
+
+ **FastAPI** は、通常の依存関係と同じように、それぞれで正しいことを行います。
+
+## `yield`と`try`を持つ依存関係
+
+`yield`を持つ依存関係で`try`ブロックを使用した場合、その依存関係を使用した際に発生した例外を受け取ることになります。
+
+例えば、途中のどこかの時点で、別の依存関係や*path operation*の中で、データベーストランザクションを「ロールバック」したり、その他のエラーを作成したりするコードがあった場合、依存関係の中で例外を受け取ることになります。
+
+そのため、依存関係の中にある特定の例外を`except SomeException`で探すことができます。
+
+同様に、`finally`を用いて例外があったかどうかにかかわらず、終了ステップを確実に実行することができます。
+
+```Python hl_lines="3 5"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+## `yield`を持つサブ依存関係
+
+任意の大きさや形のサブ依存関係やサブ依存関係の「ツリー」を持つことができ、その中で`yield`を使用することができます。
+
+**FastAPI** は、`yield`を持つ各依存関係の「終了コード」が正しい順番で実行されていることを確認します。
+
+例えば、`dependency_c`は`dependency_b`と`dependency_b`に依存する`dependency_a`に、依存することができます:
+
+```Python hl_lines="4 12 20"
+{!../../../docs_src/dependencies/tutorial008.py!}
+```
+
+そして、それらはすべて`yield`を使用することができます。
+
+この場合、`dependency_c`は終了コードを実行するために、`dependency_b`(ここでは`dep_b`という名前)の値がまだ利用可能である必要があります。
+
+そして、`dependency_b`は`dependency_a`(ここでは`dep_a`という名前)の値を終了コードで利用できるようにする必要があります。
+
+```Python hl_lines="16 17 24 25"
+{!../../../docs_src/dependencies/tutorial008.py!}
+```
+
+同様に、`yield`と`return`が混在した依存関係を持つこともできます。
+
+また、単一の依存関係を持っていて、`yield`などの他の依存関係をいくつか必要とすることもできます。
+
+依存関係の組み合わせは自由です。
+
+**FastAPI** は、全てが正しい順序で実行されていることを確認します。
+
+!!! note "技術詳細"
+ これはPythonのContext Managersのおかげで動作します。
+
+ **FastAPI** はこれを実現するために内部的に使用しています。
+
+## `yield`と`HTTPException`を持つ依存関係
+
+`yield`と例外をキャッチする`try`ブロックを持つことができる依存関係を使用することができることがわかりました。
+
+`yield`の後の終了コードで`HTTPException`などを発生させたくなるかもしれません。しかし**それはうまくいきません**
+
+`yield`を持つ依存関係の終了コードは[例外ハンドラ](../handling-errors.md#_4){.internal-link target=_blank}の*後に*実行されます。依存関係によって投げられた例外を終了コード(`yield`の後)でキャッチするものはなにもありません。
+
+つまり、`yield`の後に`HTTPException`を発生させた場合、`HTTTPException`をキャッチしてHTTP 400のレスポンスを返すデフォルトの(あるいは任意のカスタムの)例外ハンドラは、その例外をキャッチすることができなくなります。
+
+これは、依存関係に設定されているもの(例えば、DBセッション)を、例えば、バックグラウンドタスクで使用できるようにするものです。
+
+バックグラウンドタスクはレスポンスが送信された*後*に実行されます。そのため、*すでに送信されている*レスポンスを変更する方法すらないので、`HTTPException`を発生させる方法はありません。
+
+しかし、バックグラウンドタスクがDBエラーを発生させた場合、少なくとも`yield`で依存関係のセッションをロールバックしたり、きれいに閉じたりすることができ、エラーをログに記録したり、リモートのトラッキングシステムに報告したりすることができます。
+
+例外が発生する可能性があるコードがある場合は、最も普通の「Python流」なことをして、コードのその部分に`try`ブロックを追加してください。
+
+レスポンスを返したり、レスポンスを変更したり、`HTTPException`を発生させたりする*前に*処理したいカスタム例外がある場合は、[カスタム例外ハンドラ](../handling-errors.md#_4){.internal-link target=_blank}を作成してください。
+
+!!! tip "豆知識"
+ `HTTPException`を含む例外は、`yield`の*前*でも発生させることができます。ただし、後ではできません。
+
+実行の順序は多かれ少なかれ以下の図のようになります。時間は上から下へと流れていきます。そして、各列はコードを相互作用させたり、実行したりしている部分の一つです。
+
+```mermaid
+sequenceDiagram
+
+participant client as Client
+participant handler as Exception handler
+participant dep as Dep with yield
+participant operation as Path Operation
+participant tasks as Background tasks
+
+ Note over client,tasks: Can raise exception for dependency, handled after response is sent
+ Note over client,operation: Can raise HTTPException and can change the response
+ client ->> dep: Start request
+ Note over dep: Run code up to yield
+ opt raise
+ dep -->> handler: Raise HTTPException
+ handler -->> client: HTTP error response
+ dep -->> dep: Raise other exception
+ end
+ dep ->> operation: Run dependency, e.g. DB session
+ opt raise
+ operation -->> handler: Raise HTTPException
+ handler -->> client: HTTP error response
+ operation -->> dep: Raise other exception
+ end
+ operation ->> client: Return response to client
+ Note over client,operation: Response is already sent, can't change it anymore
+ opt Tasks
+ operation -->> tasks: Send background tasks
+ end
+ opt Raise other exception
+ tasks -->> dep: Raise other exception
+ end
+ Note over dep: After yield
+ opt Handle other exception
+ dep -->> dep: Handle exception, can't change response. E.g. close DB session.
+ end
+```
+
+!!! info "情報"
+ **1つのレスポンス** だけがクライアントに送信されます。それはエラーレスポンスの一つかもしれませんし、*path operation*からのレスポンスかもしれません。
+
+ いずれかのレスポンスが送信された後、他のレスポンスを送信することはできません。
+
+!!! tip "豆知識"
+ この図は`HTTPException`を示していますが、[カスタム例外ハンドラ](../handling-errors.md#_4){.internal-link target=_blank}を作成することで、他の例外を発生させることもできます。そして、その例外は依存関係の終了コードではなく、そのカスタム例外ハンドラによって処理されます。
+
+ しかし例外ハンドラで処理されない例外を発生させた場合は、依存関係の終了コードで処理されます。
+
+## コンテキストマネージャ
+
+### 「コンテキストマネージャ」とは
+
+「コンテキストマネージャ」とは、`with`文の中で使用できるPythonオブジェクトのことです。
+
+例えば、ファイルを読み込むには`with`を使用することができます:
+
+```Python
+with open("./somefile.txt") as f:
+ contents = f.read()
+ print(contents)
+```
+
+その後の`open("./somefile.txt")`は「コンテキストマネージャ」と呼ばれるオブジェクトを作成します。
+
+`with`ブロックが終了すると、例外があったとしてもファイルを確かに閉じます。
+
+`yield`を依存関係を作成すると、**FastAPI** は内部的にそれをコンテキストマネージャに変換し、他の関連ツールと組み合わせます。
+
+### `yield`を持つ依存関係でのコンテキストマネージャの使用
+
+!!! warning "注意"
+ これは多かれ少なかれ、「高度な」発想です。
+
+ **FastAPI** を使い始めたばかりの方は、とりあえずスキップした方がよいかもしれません。
+
+Pythonでは、以下の2つのメソッドを持つクラスを作成する: `__enter__()`と`__exit__()`ことでコンテキストマネージャを作成することができます。
+
+また、依存関数の中で`with`や`async with`文を使用することによって`yield`を持つ **FastAPI** の依存関係の中でそれらを使用することができます:
+
+```Python hl_lines="1 2 3 4 5 6 7 8 9 13"
+{!../../../docs_src/dependencies/tutorial010.py!}
+```
+
+!!! tip "豆知識"
+ コンテキストマネージャを作成するもう一つの方法はwithです:
+
+ * `@contextlib.contextmanager` または
+ * `@contextlib.asynccontextmanager`
+
+ これらを使って、関数を単一の`yield`でデコレートすることができます。
+
+ これは **FastAPI** が内部的に`yield`を持つ依存関係のために使用しているものです。
+
+ しかし、FastAPIの依存関係にデコレータを使う必要はありません(そして使うべきではありません)。
+
+ FastAPIが内部的にやってくれます。
diff --git a/docs/ja/docs/tutorial/dependencies/index.md b/docs/ja/docs/tutorial/dependencies/index.md
new file mode 100644
index 000000000..ec563a16d
--- /dev/null
+++ b/docs/ja/docs/tutorial/dependencies/index.md
@@ -0,0 +1,209 @@
+# 依存関係 - 最初のステップ
+
+** FastAPI** は非常に強力でありながら直感的な **依存性注入** システムを持っています。
+
+それは非常にシンプルに使用できるように設計されており、開発者が他のコンポーネント **FastAPI** と統合するのが非常に簡単になるように設計されています。
+
+## 「依存性注入」とは
+
+**「依存性注入」** とは、プログラミングにおいて、コード(この場合は、*path operation関数*)が動作したり使用したりするために必要なもの(「依存関係」)を宣言する方法があることを意味します:
+
+そして、そのシステム(この場合は、**FastAPI**)は、必要な依存関係をコードに提供するために必要なことは何でも行います(依存関係を「注入」します)。
+
+これは以下のようなことが必要な時にとても便利です:
+
+* ロジックを共有している。(同じコードロジックを何度も繰り返している)。
+* データベース接続を共有する。
+* セキュリティ、認証、ロール要件などを強制する。
+* そのほかにも多くのこと...
+
+これらすべてを、コードの繰り返しを最小限に抑えながら行います。
+
+## 最初のステップ
+
+非常にシンプルな例を見てみましょう。あまりにもシンプルなので、今のところはあまり参考にならないでしょう。
+
+しかし、この方法では **依存性注入** システムがどのように機能するかに焦点を当てることができます。
+
+### 依存関係の作成
+
+まずは依存関係に注目してみましょう。
+
+以下のように、*path operation関数*と同じパラメータを全て取ることができる関数にすぎません:
+
+```Python hl_lines="8 9"
+{!../../../docs_src/dependencies/tutorial001.py!}
+```
+
+これだけです。
+
+**2行**。
+
+そして、それはすべての*path operation関数*が持っているのと同じ形と構造を持っています。
+
+「デコレータ」を含まない(`@app.get("/some-path")`を含まない)*path operation関数*と考えることもできます。
+
+そして何でも返すことができます。
+
+この場合、この依存関係は以下を期待しています:
+
+* オプショナルのクエリパラメータ`q`は`str`です。
+* オプショナルのクエリパラメータ`skip`は`int`で、デフォルトは`0`です。
+* オプショナルのクエリパラメータ`limit`は`int`で、デフォルトは`100`です。
+
+そして、これらの値を含む`dict`を返します。
+
+### `Depends`のインポート
+
+```Python hl_lines="3"
+{!../../../docs_src/dependencies/tutorial001.py!}
+```
+
+### "dependant"での依存関係の宣言
+
+*path operation関数*のパラメータに`Body`や`Query`などを使用するのと同じように、新しいパラメータに`Depends`を使用することができます:
+
+```Python hl_lines="13 18"
+{!../../../docs_src/dependencies/tutorial001.py!}
+```
+
+関数のパラメータに`Depends`を使用するのは`Body`や`Query`などと同じですが、`Depends`の動作は少し異なります。
+
+`Depends`は1つのパラメータしか与えられません。
+
+このパラメータは関数のようなものである必要があります。
+
+そして、その関数は、*path operation関数*が行うのと同じ方法でパラメータを取ります。
+
+!!! tip "豆知識"
+ 次の章では、関数以外の「もの」が依存関係として使用できるものを見ていきます。
+
+新しいリクエストが到着するたびに、**FastAPI** が以下のような処理を行います:
+
+* 依存関係("dependable")関数を正しいパラメータで呼び出します。
+* 関数の結果を取得します。
+* *path operation関数*のパラメータにその結果を代入してください。
+
+```mermaid
+graph TB
+
+common_parameters(["common_parameters"])
+read_items["/items/"]
+read_users["/users/"]
+
+common_parameters --> read_items
+common_parameters --> read_users
+```
+
+この方法では、共有されるコードを一度書き、**FastAPI** が*path operations*のための呼び出しを行います。
+
+!!! check "確認"
+ 特別なクラスを作成してどこかで **FastAPI** に渡して「登録」する必要はないことに注意してください。
+
+ `Depends`を渡すだけで、**FastAPI** が残りの処理をしてくれます。
+
+## `async`にするかどうか
+
+依存関係は **FastAPI**(*path operation関数*と同じ)からも呼び出されるため、関数を定義する際にも同じルールが適用されます。
+
+`async def`や通常の`def`を使用することができます。
+
+また、通常の`def`*path operation関数*の中に`async def`を入れて依存関係を宣言したり、`async def`*path operation関数*の中に`def`を入れて依存関係を宣言したりすることなどができます。
+
+それは重要ではありません。**FastAPI** は何をすべきかを知っています。
+
+!!! note "備考"
+ わからない場合は、ドキュメントの[Async: *"In a hurry?"*](../../async.md){.internal-link target=_blank}の中の`async`と`await`についてのセクションを確認してください。
+
+## OpenAPIとの統合
+
+依存関係(およびサブ依存関係)のすべてのリクエスト宣言、検証、および要件は、同じOpenAPIスキーマに統合されます。
+
+つまり、対話型ドキュメントにはこれらの依存関係から得られる全ての情報も含まれているということです:
+
+
+
+## 簡単な使い方
+
+見てみると、*path*と*operation*が一致した時に*path operation関数*が宣言されていて、**FastAPI** が正しいパラメータで関数を呼び出してリクエストからデータを抽出する処理をしています。
+
+実は、すべての(あるいはほとんどの)Webフレームワークは、このように動作します。
+
+これらの関数を直接呼び出すことはありません。これらの関数はフレームワーク(この場合は、**FastAPI**)によって呼び出されます。
+
+依存性注入システムでは、**FastAPI** に*path operation*もまた、*path operation関数*の前に実行されるべき他の何かに「依存」していることを伝えることができ、**FastAPI** がそれを実行し、結果を「注入」することを引き受けます。
+
+他にも、「依存性注入」と同じような考えの一般的な用語があります:
+
+* リソース
+* プロバイダ
+* サービス
+* インジェクタブル
+* コンポーネント
+
+## **FastAPI** プラグイン
+
+統合や「プラグイン」は **依存性注入** システムを使って構築することができます。しかし、実際には、**「プラグイン」を作成する必要はありません**。依存関係を使用することで、無限の数の統合やインタラクションを宣言することができ、それが**path operation関数*で利用可能になるからです。
+
+依存関係は非常にシンプルで直感的な方法で作成することができ、必要なPythonパッケージをインポートするだけで、*文字通り*数行のコードでAPI関数と統合することができます。
+
+次の章では、リレーショナルデータベースやNoSQLデータベース、セキュリティなどについて、その例を見ていきます。
+
+## **FastAPI** 互換性
+
+依存性注入システムがシンプルなので、**FastAPI** は以下のようなものと互換性があります:
+
+* すべてのリレーショナルデータベース
+* NoSQLデータベース
+* 外部パッケージ
+* 外部API
+* 認証・認可システム
+* API利用状況監視システム
+* レスポンスデータ注入システム
+* など。
+
+## シンプルでパワフル
+
+階層依存性注入システムは、定義や使用方法が非常にシンプルであるにもかかわらず、非常に強力なものとなっています。
+
+依存関係事態を定義する依存関係を定義することができます。
+
+最終的には、依存関係の階層ツリーが構築され、**依存性注入**システムが、これらの依存関係(およびそのサブ依存関係)をすべて解決し、各ステップで結果を提供(注入)します。
+
+例えば、4つのAPIエンドポイント(*path operations*)があるとします:
+
+* `/items/public/`
+* `/items/private/`
+* `/users/{user_id}/activate`
+* `/items/pro/`
+
+そして、依存関係とサブ依存関係だけで、それぞれに異なるパーミッション要件を追加することができます:
+
+```mermaid
+graph TB
+
+current_user(["current_user"])
+active_user(["active_user"])
+admin_user(["admin_user"])
+paying_user(["paying_user"])
+
+public["/items/public/"]
+private["/items/private/"]
+activate_user["/users/{user_id}/activate"]
+pro_items["/items/pro/"]
+
+current_user --> active_user
+active_user --> admin_user
+active_user --> paying_user
+
+current_user --> public
+active_user --> private
+admin_user --> activate_user
+paying_user --> pro_items
+```
+
+## **OpenAPI** との統合
+
+これら全ての依存関係は、要件を宣言すると同時に、*path operations*にパラメータやバリデーションを追加します。
+
+**FastAPI** はそれをすべてOpenAPIスキーマに追加して、対話型のドキュメントシステムに表示されるようにします。
diff --git a/docs/ja/docs/tutorial/dependencies/sub-dependencies.md b/docs/ja/docs/tutorial/dependencies/sub-dependencies.md
new file mode 100644
index 000000000..8848ac79e
--- /dev/null
+++ b/docs/ja/docs/tutorial/dependencies/sub-dependencies.md
@@ -0,0 +1,86 @@
+# サブ依存関係
+
+**サブ依存関係** を持つ依存関係を作成することができます。
+
+それらは必要なだけ **深く** することができます。
+
+**FastAPI** はそれらを解決してくれます。
+
+### 最初の依存関係「依存可能なもの」
+
+以下のような最初の依存関係(「依存可能なもの」)を作成することができます:
+
+```Python hl_lines="8 9"
+{!../../../docs_src/dependencies/tutorial005.py!}
+```
+
+これはオプショナルのクエリパラメータ`q`を`str`として宣言し、それを返すだけです。
+
+これは非常にシンプルです(あまり便利ではありません)が、サブ依存関係がどのように機能するかに焦点を当てるのに役立ちます。
+
+### 第二の依存関係 「依存可能なもの」と「依存」
+
+そして、別の依存関数(「依存可能なもの」)を作成して、同時にそれ自身の依存関係を宣言することができます(つまりそれ自身も「依存」です):
+
+```Python hl_lines="13"
+{!../../../docs_src/dependencies/tutorial005.py!}
+```
+
+宣言されたパラメータに注目してみましょう:
+
+* この関数は依存関係(「依存可能なもの」)そのものであるにもかかわらず、別の依存関係を宣言しています(何か他のものに「依存」しています)。
+ * これは`query_extractor`に依存しており、それが返す値をパラメータ`q`に代入します。
+* また、オプショナルの`last_query`クッキーを`str`として宣言します。
+ * ユーザーがクエリ`q`を提供しなかった場合、クッキーに保存していた最後に使用したクエリを使用します。
+
+### 依存関係の使用
+
+以下のように依存関係を使用することができます:
+
+```Python hl_lines="21"
+{!../../../docs_src/dependencies/tutorial005.py!}
+```
+
+!!! info "情報"
+ *path operation関数*の中で宣言している依存関係は`query_or_cookie_extractor`の1つだけであることに注意してください。
+
+ しかし、**FastAPI** は`query_extractor`を最初に解決し、その結果を`query_or_cookie_extractor`を呼び出す時に渡す必要があることを知っています。
+
+```mermaid
+graph TB
+
+query_extractor(["query_extractor"])
+query_or_cookie_extractor(["query_or_cookie_extractor"])
+
+read_query["/items/"]
+
+query_extractor --> query_or_cookie_extractor --> read_query
+```
+
+## 同じ依存関係の複数回の使用
+
+依存関係の1つが同じ*path operation*に対して複数回宣言されている場合、例えば、複数の依存関係が共通のサブ依存関係を持っている場合、**FastAPI** はリクエストごとに1回だけそのサブ依存関係を呼び出します。
+
+そして、返された値を「キャッシュ」に保存し、同じリクエストに対して依存関係を何度も呼び出す代わりに、特定のリクエストでそれを必要とする全ての「依存関係」に渡すことになります。
+
+高度なシナリオでは、「キャッシュされた」値を使うのではなく、同じリクエストの各ステップ(おそらく複数回)で依存関係を呼び出す必要があることがわかっている場合、`Depens`を使用する際に、`use_cache=False`というパラメータを設定することができます。
+
+```Python hl_lines="1"
+async def needy_dependency(fresh_value: str = Depends(get_value, use_cache=False)):
+ return {"fresh_value": fresh_value}
+```
+
+## まとめ
+
+ここで使われている派手な言葉は別にして、**依存性注入** システムは非常にシンプルです。
+
+*path operation関数*と同じように見えるただの関数です。
+
+しかし、それでも非常に強力で、任意の深くネストされた依存関係「グラフ」(ツリー)を宣言することができます。
+
+!!! tip "豆知識"
+ これらの単純な例では、全てが役に立つとは言えないかもしれません。
+
+ しかし、**security** についての章で、それがどれほど有用であるかがわかるでしょう。
+
+ そして、あなたを救うコードの量もみることになるでしょう。
diff --git a/docs/ja/docs/tutorial/encoder.md b/docs/ja/docs/tutorial/encoder.md
new file mode 100644
index 000000000..305867ab7
--- /dev/null
+++ b/docs/ja/docs/tutorial/encoder.md
@@ -0,0 +1,34 @@
+# JSON互換エンコーダ
+
+データ型(Pydanticモデルのような)をJSONと互換性のあるもの(`dict`や`list`など)に変更する必要がある場合があります。
+
+例えば、データベースに保存する必要がある場合です。
+
+そのために、**FastAPI** は`jsonable_encoder()`関数を提供しています。
+
+## `jsonable_encoder`の使用
+
+JSON互換のデータのみを受信するデータベース`fase_db`があるとしましょう。
+
+例えば、`datetime`オブジェクトはJSONと互換性がないので、このデーターベースには受け取られません。
+
+そのため、`datetime`オブジェクトはISO形式のデータを含む`str`に変換されなければなりません。
+
+同様に、このデータベースはPydanticモデル(属性を持つオブジェクト)を受け取らず、`dict`だけを受け取ります。
+
+そのために`jsonable_encoder`を使用することができます。
+
+Pydanticモデルのようなオブジェクトを受け取り、JSON互換版を返します:
+
+```Python hl_lines="5 22"
+{!../../../docs_src/encoder/tutorial001.py!}
+```
+
+この例では、Pydanticモデルを`dict`に、`datetime`を`str`に変換します。
+
+呼び出した結果は、Pythonの標準の`json.dumps()`でエンコードできるものです。
+
+これはJSON形式のデータを含む大きな`str`を(文字列として)返しません。JSONと互換性のある値とサブの値を持つPython標準のデータ構造(例:`dict`)を返します。
+
+!!! note "備考"
+ `jsonable_encoder`は実際には **FastAPI** が内部的にデータを変換するために使用します。しかしこれは他の多くのシナリオで有用です。
diff --git a/docs/ja/docs/tutorial/extra-data-types.md b/docs/ja/docs/tutorial/extra-data-types.md
new file mode 100644
index 000000000..c0fdbd58c
--- /dev/null
+++ b/docs/ja/docs/tutorial/extra-data-types.md
@@ -0,0 +1,66 @@
+# 追加データ型
+
+今までは、以下のような一般的なデータ型を使用してきました:
+
+* `int`
+* `float`
+* `str`
+* `bool`
+
+しかし、より複雑なデータ型を使用することもできます。
+
+そして、今まで見てきたのと同じ機能を持つことになります:
+
+* 素晴らしいエディタのサポート
+* 受信したリクエストからのデータ変換
+* レスポンスデータのデータ変換
+* データの検証
+* 自動注釈と文書化
+
+## 他のデータ型
+
+ここでは、使用できる追加のデータ型のいくつかを紹介します:
+
+* `UUID`:
+ * 多くのデータベースやシステムで共通のIDとして使用される、標準的な「ユニバーサルにユニークな識別子」です。
+ * リクエストとレスポンスでは`str`として表現されます。
+* `datetime.datetime`:
+ * Pythonの`datetime.datetime`です。
+ * リクエストとレスポンスはISO 8601形式の`str`で表現されます: `2008-09-15T15:53:00+05:00`
+* `datetime.date`:
+ * Pythonの`datetime.date`です。
+ * リクエストとレスポンスはISO 8601形式の`str`で表現されます: `2008-09-15`
+* `datetime.time`:
+ * Pythonの`datetime.time`.
+ * リクエストとレスポンスはISO 8601形式の`str`で表現されます: `14:23:55.003`
+* `datetime.timedelta`:
+ * Pythonの`datetime.timedelta`です。
+ * リクエストとレスポンスでは合計秒数の`float`で表現されます。
+ * Pydanticでは「ISO 8601 time diff encoding」として表現することも可能です。詳細はドキュメントを参照してください。
+* `frozenset`:
+ * リクエストとレスポンスでは`set`と同じように扱われます:
+ * リクエストでは、リストが読み込まれ、重複を排除して`set`に変換されます。
+ * レスポンスでは`set`が`list`に変換されます。
+ * 生成されたスキーマは`set`の値が一意であることを指定します(JSON Schemaの`uniqueItems`を使用します)。
+* `bytes`:
+ * Pythonの標準的な`bytes`です。
+ * リクエストとレスポンスでは`str`として扱われます。
+ * 生成されたスキーマは`str`で`binary`の「フォーマット」持つことを指定します。
+* `Decimal`:
+ * Pythonの標準的な`Decimal`です。
+ * リクエストやレスポンスでは`float`と同じように扱います。
+
+* Pydanticの全ての有効な型はこちらで確認できます: Pydantic data types。
+## 例
+
+ここでは、上記の型のいくつかを使用したパラメータを持つ*path operation*の例を示します。
+
+```Python hl_lines="1 2 12-16"
+{!../../../docs_src/extra_data_types/tutorial001.py!}
+```
+
+関数内のパラメータは自然なデータ型を持っていることに注意してください。そして、以下のように通常の日付操作を行うことができます:
+
+```Python hl_lines="18 19"
+{!../../../docs_src/extra_data_types/tutorial001.py!}
+```
diff --git a/docs/ja/docs/tutorial/extra-models.md b/docs/ja/docs/tutorial/extra-models.md
new file mode 100644
index 000000000..aa2e5ffdc
--- /dev/null
+++ b/docs/ja/docs/tutorial/extra-models.md
@@ -0,0 +1,195 @@
+# モデル - より詳しく
+
+先ほどの例に続き、複数の関連モデルを持つことが一般的です。
+
+これはユーザーモデルの場合は特にそうです。なぜなら:
+
+* **入力モデル** にはパスワードが必要です。
+* **出力モデル**はパスワードをもつべきではありません。
+* **データベースモデル**はおそらくハッシュ化されたパスワードが必要になるでしょう。
+
+!!! danger "危険"
+ ユーザーの平文のパスワードは絶対に保存しないでください。常に認証に利用可能な「安全なハッシュ」を保存してください。
+
+ 知らない方は、[セキュリティの章](security/simple-oauth2.md#password-hashing){.internal-link target=_blank}で「パスワードハッシュ」とは何かを学ぶことができます。
+
+## 複数のモデル
+
+ここでは、パスワードフィールドをもつモデルがどのように見えるのか、また、どこで使われるのか、大まかなイメージを紹介します:
+
+```Python hl_lines="9 11 16 22 24 29-30 33-35 40-41"
+{!../../../docs_src/extra_models/tutorial001.py!}
+```
+
+### `**user_in.dict()`について
+
+#### Pydanticの`.dict()`
+
+`user_in`は`UserIn`クラスのPydanticモデルです。
+
+Pydanticモデルには、モデルのデータを含む`dict`を返す`.dict()`メソッドがあります。
+
+そこで、以下のようなPydanticオブジェクト`user_in`を作成すると:
+
+```Python
+user_in = UserIn(username="john", password="secret", email="john.doe@example.com")
+```
+
+そして呼び出すと:
+
+```Python
+user_dict = user_in.dict()
+```
+
+これで変数`user_dict`のデータを持つ`dict`ができました。(これはPydanticモデルのオブジェクトの代わりに`dict`です)。
+
+そして呼び出すと:
+
+```Python
+print(user_dict)
+```
+
+以下のようなPythonの`dict`を得ることができます:
+
+```Python
+{
+ 'username': 'john',
+ 'password': 'secret',
+ 'email': 'john.doe@example.com',
+ 'full_name': None,
+}
+```
+
+#### `dict`の展開
+
+`user_dict`のような`dict`を受け取り、それを`**user_dict`を持つ関数(またはクラス)に渡すと、Pythonはそれを「展開」します。これは`user_dict`のキーと値を直接キー・バリューの引数として渡します。
+
+そこで上述の`user_dict`の続きを以下のように書くと:
+
+```Python
+UserInDB(**user_dict)
+```
+
+以下と同等の結果になります:
+
+```Python
+UserInDB(
+ username="john",
+ password="secret",
+ email="john.doe@example.com",
+ full_name=None,
+)
+```
+
+もっと正確に言えば、`user_dict`を将来的にどんな内容であっても直接使用することになります:
+
+```Python
+UserInDB(
+ username = user_dict["username"],
+ password = user_dict["password"],
+ email = user_dict["email"],
+ full_name = user_dict["full_name"],
+)
+```
+
+#### 別のモデルからつくるPydanticモデル
+
+上述の例では`user_in.dict()`から`user_dict`をこのコードのように取得していますが:
+
+```Python
+user_dict = user_in.dict()
+UserInDB(**user_dict)
+```
+
+これは以下と同等です:
+
+```Python
+UserInDB(**user_in.dict())
+```
+
+...なぜなら`user_in.dict()`は`dict`であり、`**`を付与して`UserInDB`を渡してPythonに「展開」させているからです。
+
+そこで、別のPydanticモデルのデータからPydanticモデルを取得します。
+
+#### `dict`の展開と追加引数
+
+そして、追加のキーワード引数`hashed_password=hashed_password`を以下のように追加すると:
+
+```Python
+UserInDB(**user_in.dict(), hashed_password=hashed_password)
+```
+
+...以下のようになります:
+
+```Python
+UserInDB(
+ username = user_dict["username"],
+ password = user_dict["password"],
+ email = user_dict["email"],
+ full_name = user_dict["full_name"],
+ hashed_password = hashed_password,
+)
+```
+
+!!! warning "注意"
+ サポートしている追加機能は、データの可能な流れをデモするだけであり、もちろん本当のセキュリティを提供しているわけではありません。
+
+## 重複の削減
+
+コードの重複を減らすことは、**FastAPI**の中核的なアイデアの1つです。
+
+コードの重複が増えると、バグやセキュリティの問題、コードの非同期化問題(ある場所では更新しても他の場所では更新されない場合)などが発生する可能性が高くなります。
+
+そして、これらのモデルは全てのデータを共有し、属性名や型を重複させています。
+
+もっと良い方法があります。
+
+他のモデルのベースとなる`UserBase`モデルを宣言することができます。そして、そのモデルの属性(型宣言、検証など)を継承するサブクラスを作ることができます。
+
+データの変換、検証、文書化などはすべて通常通りに動作します。
+
+このようにして、モデル間の違いだけを宣言することができます:
+
+```Python hl_lines="9 15 16 19 20 23 24"
+{!../../../docs_src/extra_models/tutorial002.py!}
+```
+
+## `Union`または`anyOf`
+
+レスポンスを2つの型の`Union`として宣言することができます。
+
+OpenAPIでは`anyOf`で定義されます。
+
+そのためには、標準的なPythonの型ヒント`typing.Union`を使用します:
+
+```Python hl_lines="1 14 15 18 19 20 33"
+{!../../../docs_src/extra_models/tutorial003.py!}
+```
+
+## モデルのリスト
+
+同じように、オブジェクトのリストのレスポンスを宣言することができます。
+
+そのためには、標準のPythonの`typing.List`を使用する:
+
+```Python hl_lines="1 20"
+{!../../../docs_src/extra_models/tutorial004.py!}
+```
+
+## 任意の`dict`を持つレスポンス
+
+また、Pydanticモデルを使用せずに、キーと値の型だけを定義した任意の`dict`を使ってレスポンスを宣言することもできます。
+
+これは、有効なフィールド・属性名(Pydanticモデルに必要なもの)を事前に知らない場合に便利です。
+
+この場合、`typing.Dict`を使用することができます:
+
+```Python hl_lines="1 8"
+{!../../../docs_src/extra_models/tutorial005.py!}
+```
+
+## まとめ
+
+複数のPydanticモデルを使用し、ケースごとに自由に継承します。
+
+エンティティが異なる「状態」を持たなければならない場合は、エンティティごとに単一のデータモデルを持つ必要はありません。`password` や `password_hash` やパスワードなしなどのいくつかの「状態」をもつユーザー「エンティティ」の場合の様にすれば良いです。
diff --git a/docs/ja/docs/tutorial/first-steps.md b/docs/ja/docs/tutorial/first-steps.md
index c696f7d48..f79ed94a4 100644
--- a/docs/ja/docs/tutorial/first-steps.md
+++ b/docs/ja/docs/tutorial/first-steps.md
@@ -308,7 +308,7 @@ APIを構築するときは、通常、これらの特定のHTTPメソッドを
```
!!! note "備考"
- 違いが分からない場合は、[Async: *"In a hurry?"*](../async.md#in-a-hurry){.internal-link target=_blank}を確認してください。
+ 違いが分からない場合は、[Async: *"急いでいますか?"*](../async.md#_1){.internal-link target=_blank}を確認してください。
### Step 5: コンテンツの返信
diff --git a/docs/ja/docs/tutorial/handling-errors.md b/docs/ja/docs/tutorial/handling-errors.md
new file mode 100644
index 000000000..0b95cae0f
--- /dev/null
+++ b/docs/ja/docs/tutorial/handling-errors.md
@@ -0,0 +1,265 @@
+# エラーハンドリング
+
+APIを使用しているクライアントにエラーを通知する必要がある状況はたくさんあります。
+
+このクライアントは、フロントエンドを持つブラウザ、誰かのコード、IoTデバイスなどが考えられます。
+
+クライアントに以下のようなことを伝える必要があるかもしれません:
+
+* クライアントにはその操作のための十分な権限がありません。
+* クライアントはそのリソースにアクセスできません。
+* クライアントがアクセスしようとしていた項目が存在しません。
+* など
+
+これらの場合、通常は **400**(400から499)の範囲内の **HTTPステータスコード** を返すことになります。
+
+これは200のHTTPステータスコード(200から299)に似ています。これらの「200」ステータスコードは、何らかの形でリクエスト「成功」であったことを意味します。
+
+400の範囲にあるステータスコードは、クライアントからのエラーがあったことを意味します。
+
+**"404 Not Found"** のエラー(およびジョーク)を覚えていますか?
+
+## `HTTPException`の使用
+
+HTTPレスポンスをエラーでクライアントに返すには、`HTTPException`を使用します。
+
+### `HTTPException`のインポート
+
+```Python hl_lines="1"
+{!../../../docs_src/handling_errors/tutorial001.py!}
+```
+
+### コード内での`HTTPException`の発生
+
+`HTTPException`は通常のPythonの例外であり、APIに関連するデータを追加したものです。
+
+Pythonの例外なので、`return`ではなく、`raise`です。
+
+これはまた、*path operation関数*の内部で呼び出しているユーティリティ関数の内部から`HTTPException`を発生させた場合、*path operation関数*の残りのコードは実行されず、そのリクエストを直ちに終了させ、`HTTPException`からのHTTPエラーをクライアントに送信することを意味します。
+
+値を返す`return`よりも例外を発生させることの利点は、「依存関係とセキュリティ」のセクションでより明確になります。
+
+この例では、クライアントが存在しないIDでアイテムを要求した場合、`404`のステータスコードを持つ例外を発生させます:
+
+```Python hl_lines="11"
+{!../../../docs_src/handling_errors/tutorial001.py!}
+```
+
+### レスポンス結果
+
+クライアントが`http://example.com/items/foo`(`item_id` `"foo"`)をリクエストすると、HTTPステータスコードが200で、以下のJSONレスポンスが返されます:
+
+```JSON
+{
+ "item": "The Foo Wrestlers"
+}
+```
+
+しかし、クライアントが`http://example.com/items/bar`(存在しない`item_id` `"bar"`)をリクエストした場合、HTTPステータスコード404("not found"エラー)と以下のJSONレスポンスが返されます:
+
+```JSON
+{
+ "detail": "Item not found"
+}
+```
+
+!!! tip "豆知識"
+ `HTTPException`を発生させる際には、`str`だけでなく、JSONに変換できる任意の値を`detail`パラメータとして渡すことができます。
+
+ `dist`や`list`などを渡すことができます。
+
+ これらは **FastAPI** によって自動的に処理され、JSONに変換されます。
+
+## カスタムヘッダーの追加
+
+例えば、いくつかのタイプのセキュリティのために、HTTPエラーにカスタムヘッダを追加できると便利な状況がいくつかあります。
+
+おそらくコードの中で直接使用する必要はないでしょう。
+
+しかし、高度なシナリオのために必要な場合には、カスタムヘッダーを追加することができます:
+
+```Python hl_lines="14"
+{!../../../docs_src/handling_errors/tutorial002.py!}
+```
+
+## カスタム例外ハンドラのインストール
+
+カスタム例外ハンドラはStarletteと同じ例外ユーティリティを使用して追加することができます。
+
+あなた(または使用しているライブラリ)が`raise`するかもしれないカスタム例外`UnicornException`があるとしましょう。
+
+そして、この例外をFastAPIでグローバルに処理したいと思います。
+
+カスタム例外ハンドラを`@app.exception_handler()`で追加することができます:
+
+```Python hl_lines="5 6 7 13 14 15 16 17 18 24"
+{!../../../docs_src/handling_errors/tutorial003.py!}
+```
+
+ここで、`/unicorns/yolo`をリクエストすると、*path operation*は`UnicornException`を`raise`します。
+
+しかし、これは`unicorn_exception_handler`で処理されます。
+
+そのため、HTTPステータスコードが`418`で、JSONの内容が以下のような明確なエラーを受け取ることになります:
+
+```JSON
+{"message": "Oops! yolo did something. There goes a rainbow..."}
+```
+
+!!! note "技術詳細"
+ また、`from starlette.requests import Request`と`from starlette.responses import JSONResponse`を使用することもできます。
+
+ **FastAPI** は開発者の利便性を考慮して、`fastapi.responses`と同じ`starlette.responses`を提供しています。しかし、利用可能なレスポンスのほとんどはStarletteから直接提供されます。これは`Request`と同じです。
+
+## デフォルトの例外ハンドラのオーバーライド
+
+**FastAPI** にはいくつかのデフォルトの例外ハンドラがあります。
+
+これらのハンドラは、`HTTPException`を`raise`させた場合や、リクエストに無効なデータが含まれている場合にデフォルトのJSONレスポンスを返す役割を担っています。
+
+これらの例外ハンドラを独自のものでオーバーライドすることができます。
+
+### リクエスト検証の例外のオーバーライド
+
+リクエストに無効なデータが含まれている場合、**FastAPI** は内部的に`RequestValidationError`を発生させます。
+
+また、そのためのデフォルトの例外ハンドラも含まれています。
+
+これをオーバーライドするには`RequestValidationError`をインポートして`@app.exception_handler(RequestValidationError)`と一緒に使用して例外ハンドラをデコレートします。
+
+この例外ハンドラは`Requset`と例外を受け取ります。
+
+```Python hl_lines="2 14 15 16"
+{!../../../docs_src/handling_errors/tutorial004.py!}
+```
+
+これで、`/items/foo`にアクセスすると、デフォルトのJSONエラーの代わりに以下が返されます:
+
+```JSON
+{
+ "detail": [
+ {
+ "loc": [
+ "path",
+ "item_id"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ]
+}
+```
+
+以下のようなテキスト版を取得します:
+
+```
+1 validation error
+path -> item_id
+ value is not a valid integer (type=type_error.integer)
+```
+
+#### `RequestValidationError`と`ValidationError`
+
+!!! warning "注意"
+ これらは今のあなたにとって重要でない場合は省略しても良い技術的な詳細です。
+
+`RequestValidationError`はPydanticの`ValidationError`のサブクラスです。
+
+**FastAPI** は`response_model`でPydanticモデルを使用していて、データにエラーがあった場合、ログにエラーが表示されるようにこれを使用しています。
+
+しかし、クライアントやユーザーはそれを見ることはありません。その代わりに、クライアントはHTTPステータスコード`500`の「Internal Server Error」を受け取ります。
+
+*レスポンス*やコードのどこか(クライアントの*リクエスト*ではなく)にPydanticの`ValidationError`がある場合、それは実際にはコードのバグなのでこのようにすべきです。
+
+また、あなたがそれを修正している間は、セキュリティの脆弱性が露呈する場合があるため、クライアントやユーザーがエラーに関する内部情報にアクセスできないようにしてください。
+
+### エラーハンドラ`HTTPException`のオーバーライド
+
+同様に、`HTTPException`ハンドラをオーバーライドすることもできます。
+
+例えば、これらのエラーに対しては、JSONではなくプレーンテキストを返すようにすることができます:
+
+```Python hl_lines="3 4 9 10 11 22"
+{!../../../docs_src/handling_errors/tutorial004.py!}
+```
+
+!!! note "技術詳細"
+ また、`from starlette.responses import PlainTextResponse`を使用することもできます。
+
+ **FastAPI** は開発者の利便性を考慮して、`fastapi.responses`と同じ`starlette.responses`を提供しています。しかし、利用可能なレスポンスのほとんどはStarletteから直接提供されます。
+
+### `RequestValidationError`のボディの使用
+
+`RequestValidationError`には無効なデータを含む`body`が含まれています。
+
+アプリ開発中に本体のログを取ってデバッグしたり、ユーザーに返したりなどに使用することができます。
+
+```Python hl_lines="14"
+{!../../../docs_src/handling_errors/tutorial005.py!}
+```
+
+ここで、以下のような無効な項目を送信してみてください:
+
+```JSON
+{
+ "title": "towel",
+ "size": "XL"
+}
+```
+
+受信したボディを含むデータが無効であることを示すレスポンスが表示されます:
+
+```JSON hl_lines="12 13 14 15"
+{
+ "detail": [
+ {
+ "loc": [
+ "body",
+ "size"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ],
+ "body": {
+ "title": "towel",
+ "size": "XL"
+ }
+}
+```
+
+#### FastAPIの`HTTPException`とStarletteの`HTTPException`
+
+**FastAPI**は独自の`HTTPException`を持っています。
+
+また、 **FastAPI**のエラークラス`HTTPException`はStarletteのエラークラス`HTTPException`を継承しています。
+
+唯一の違いは、**FastAPI** の`HTTPException`はレスポンスに含まれるヘッダを追加できることです。
+
+これはOAuth 2.0といくつかのセキュリティユーティリティのために内部的に必要とされ、使用されています。
+
+そのため、コード内では通常通り **FastAPI** の`HTTPException`を発生させ続けることができます。
+
+しかし、例外ハンドラを登録する際には、Starletteの`HTTPException`を登録しておく必要があります。
+
+これにより、Starletteの内部コードやStarletteの拡張機能やプラグインの一部が`HTTPException`を発生させた場合、ハンドラがそれをキャッチして処理することができるようになります。
+
+以下の例では、同じコード内で両方の`HTTPException`を使用できるようにするために、Starletteの例外の名前を`StarletteHTTPException`に変更しています:
+
+```Python
+from starlette.exceptions import HTTPException as StarletteHTTPException
+```
+
+### **FastAPI** の例外ハンドラの再利用
+
+また、何らかの方法で例外を使用することもできますが、**FastAPI** から同じデフォルトの例外ハンドラを使用することもできます。
+
+デフォルトの例外ハンドラを`fastapi.exception_handlers`からインポートして再利用することができます:
+
+```Python hl_lines="2 3 4 5 15 21"
+{!../../../docs_src/handling_errors/tutorial006.py!}
+```
+
+この例では、非常に表現力のあるメッセージでエラーを`print`しています。
+
+しかし、例外を使用して、デフォルトの例外ハンドラを再利用することができるということが理解できます。
diff --git a/docs/ja/docs/tutorial/metadata.md b/docs/ja/docs/tutorial/metadata.md
new file mode 100644
index 000000000..73d7f02b2
--- /dev/null
+++ b/docs/ja/docs/tutorial/metadata.md
@@ -0,0 +1,105 @@
+# メタデータとドキュメントのURL
+
+**FastAPI** アプリケーションのいくつかのメタデータの設定をカスタマイズできます。
+
+## タイトル、説明文、バージョン
+
+以下を設定できます:
+
+* **タイトル**: OpenAPIおよび自動APIドキュメントUIでAPIのタイトル/名前として使用される。
+* **説明文**: OpenAPIおよび自動APIドキュメントUIでのAPIの説明文。
+* **バージョン**: APIのバージョン。例: `v2` または `2.5.0`。
+ *たとえば、以前のバージョンのアプリケーションがあり、OpenAPIも使用している場合に便利です。
+
+これらを設定するには、パラメータ `title`、`description`、`version` を使用します:
+
+```Python hl_lines="4-6"
+{!../../../docs_src/metadata/tutorial001.py!}
+```
+
+この設定では、自動APIドキュメントは以下の様になります:
+
+
+
+## タグのためのメタデータ
+
+さらに、パラメータ `openapi_tags` を使うと、path operations をグループ分けするための複数のタグに関するメタデータを追加できます。
+
+それぞれのタグ毎にひとつの辞書を含むリストをとります。
+
+それぞれの辞書は以下をもつことができます:
+
+* `name` (**必須**): *path operations* および `APIRouter` の `tags` パラメーターで使用するのと同じタグ名である `str`。
+* `description`: タグの簡単な説明文である `str`。 Markdownで記述でき、ドキュメントUIに表示されます。
+* `externalDocs`: 外部ドキュメントを説明するための `dict`:
+ * `description`: 外部ドキュメントの簡単な説明文である `str`。
+ * `url` (**必須**): 外部ドキュメントのURLである `str`。
+
+### タグのためのメタデータの作成
+
+`users` と `items` のタグを使った例でメタデータの追加を試してみましょう。
+
+タグのためのメタデータを作成し、それを `openapi_tags` パラメータに渡します。
+
+```Python hl_lines="3-16 18"
+{!../../../docs_src/metadata/tutorial004.py!}
+```
+
+説明文 (description) の中で Markdown を使用できることに注意してください。たとえば、「login」は太字 (**login**) で表示され、「fancy」は斜体 (_fancy_) で表示されます。
+
+!!! tip "豆知識"
+ 使用するすべてのタグにメタデータを追加する必要はありません。
+
+### 自作タグの使用
+
+`tags` パラメーターを使用して、それぞれの *path operations* (および `APIRouter`) を異なるタグに割り当てます:
+
+```Python hl_lines="21 26"
+{!../../../docs_src/metadata/tutorial004.py!}
+```
+
+!!! info "情報"
+ タグのより詳しい説明を知りたい場合は [Path Operation Configuration](path-operation-configuration.md#tags){.internal-link target=_blank} を参照して下さい。
+
+### ドキュメントの確認
+
+ここで、ドキュメントを確認すると、追加したメタデータがすべて表示されます:
+
+
+
+### タグの順番
+
+タグのメタデータ辞書の順序は、ドキュメントUIに表示される順序の定義にもなります。
+
+たとえば、`users` はアルファベット順では `items` の後に続きます。しかし、リストの最初に `users` のメタデータ辞書を追加したため、ドキュメントUIでは `users` が先に表示されます。
+
+## OpenAPI URL
+
+デフォルトでは、OpenAPIスキーマは `/openapi.json` で提供されます。
+
+ただし、パラメータ `openapi_url` を使用して設定を変更できます。
+
+たとえば、`/api/v1/openapi.json` で提供されるように設定するには:
+
+```Python hl_lines="3"
+{!../../../docs_src/metadata/tutorial002.py!}
+```
+
+OpenAPIスキーマを完全に無効にする場合は、`openapi_url=None` を設定できます。これにより、それを使用するドキュメントUIも無効になります。
+
+## ドキュメントのURL
+
+以下の2つのドキュメントUIを構築できます:
+
+* **Swagger UI**: `/docs` で提供されます。
+ * URL はパラメータ `docs_url` で設定できます。
+ * `docs_url=None` を設定することで無効にできます。
+* ReDoc: `/redoc` で提供されます。
+ * URL はパラメータ `redoc_url` で設定できます。
+ * `redoc_url=None` を設定することで無効にできます。
+
+たとえば、`/documentation` でSwagger UIが提供されるように設定し、ReDocを無効にするには:
+
+```Python hl_lines="3"
+{!../../../docs_src/metadata/tutorial003.py!}
+```
diff --git a/docs/ja/docs/tutorial/path-operation-configuration.md b/docs/ja/docs/tutorial/path-operation-configuration.md
new file mode 100644
index 000000000..486c4b204
--- /dev/null
+++ b/docs/ja/docs/tutorial/path-operation-configuration.md
@@ -0,0 +1,97 @@
+# Path Operationの設定
+
+*path operationデコレータ*を設定するためのパラメータがいくつかあります。
+
+!!! warning "注意"
+ これらのパラメータは*path operation関数*ではなく、*path operationデコレータ*に直接渡されることに注意してください。
+
+## レスポンスステータスコード
+
+*path operation*のレスポンスで使用する(HTTP)`status_code`を定義することができます。
+
+`404`のように`int`のコードを直接渡すことができます。
+
+しかし、それぞれの番号コードが何のためのものか覚えていない場合は、`status`のショートカット定数を使用することができます:
+
+```Python hl_lines="3 17"
+{!../../../docs_src/path_operation_configuration/tutorial001.py!}
+```
+
+そのステータスコードはレスポンスで使用され、OpenAPIスキーマに追加されます。
+
+!!! note "技術詳細"
+ また、`from starlette import status`を使用することもできます。
+
+ **FastAPI** は開発者の利便性を考慮して、`fastapi.status`と同じ`starlette.status`を提供しています。しかし、これはStarletteから直接提供されています。
+
+## タグ
+
+`tags`パラメータを`str`の`list`(通常は1つの`str`)と一緒に渡すと、*path operation*にタグを追加できます:
+
+```Python hl_lines="17 22 27"
+{!../../../docs_src/path_operation_configuration/tutorial002.py!}
+```
+
+これらはOpenAPIスキーマに追加され、自動ドキュメントのインターフェースで使用されます:
+
+
+
+## 概要と説明
+
+`summary`と`description`を追加できます:
+
+```Python hl_lines="20-21"
+{!../../../docs_src/path_operation_configuration/tutorial003.py!}
+```
+
+## docstringを用いた説明
+
+説明文は長くて複数行におよぶ傾向があるので、関数docstring内に*path operation*の説明文を宣言できます。すると、**FastAPI** は説明文を読み込んでくれます。
+
+docstringにMarkdownを記述すれば、正しく解釈されて表示されます。(docstringのインデントを考慮して)
+
+```Python hl_lines="19-27"
+{!../../../docs_src/path_operation_configuration/tutorial004.py!}
+```
+
+これは対話的ドキュメントで使用されます:
+
+
+
+## レスポンスの説明
+
+`response_description`パラメータでレスポンスの説明をすることができます。
+
+```Python hl_lines="21"
+{!../../../docs_src/path_operation_configuration/tutorial005.py!}
+```
+
+!!! info "情報"
+ `respnse_description`は具体的にレスポンスを参照し、`description`は*path operation*全般を参照していることに注意してください。
+
+!!! check "確認"
+ OpenAPIは*path operation*ごとにレスポンスの説明を必要としています。
+
+ そのため、それを提供しない場合は、**FastAPI** が自動的に「成功のレスポンス」を生成します。
+
+
+
+## 非推奨の*path operation*
+
+*path operation*をdeprecatedとしてマークする必要があるが、それを削除しない場合は、`deprecated`パラメータを渡します:
+
+```Python hl_lines="16"
+{!../../../docs_src/path_operation_configuration/tutorial006.py!}
+```
+
+対話的ドキュメントでは非推奨と明記されます:
+
+
+
+*path operations*が非推奨である場合とそうでない場合でどのように見えるかを確認してください:
+
+
+
+## まとめ
+
+*path operationデコレータ*にパラメータを渡すことで、*path operations*のメタデータを簡単に設定・追加することができます。
diff --git a/docs/ja/docs/tutorial/path-params-numeric-validations.md b/docs/ja/docs/tutorial/path-params-numeric-validations.md
new file mode 100644
index 000000000..551aeabb3
--- /dev/null
+++ b/docs/ja/docs/tutorial/path-params-numeric-validations.md
@@ -0,0 +1,122 @@
+# パスパラメータと数値の検証
+
+クエリパラメータに対して`Query`でより多くのバリデーションとメタデータを宣言できるのと同じように、パスパラメータに対しても`Path`で同じ種類のバリデーションとメタデータを宣言することができます。
+
+## Pathのインポート
+
+まず初めに、`fastapi`から`Path`をインポートします:
+
+```Python hl_lines="1"
+{!../../../docs_src/path_params_numeric_validations/tutorial001.py!}
+```
+
+## メタデータの宣言
+
+パラメータは`Query`と同じものを宣言することができます。
+
+例えば、パスパラメータ`item_id`に対して`title`のメタデータを宣言するには以下のようにします:
+
+```Python hl_lines="8"
+{!../../../docs_src/path_params_numeric_validations/tutorial001.py!}
+```
+
+!!! note "備考"
+ パスの一部でなければならないので、パスパラメータは常に必須です。
+
+ そのため、`...`を使用して必須と示す必要があります。
+
+ それでも、`None`で宣言しても、デフォルト値を設定しても、何の影響もなく、常に必要とされていることに変わりはありません。
+
+## 必要に応じてパラメータを並び替える
+
+クエリパラメータ`q`を必須の`str`として宣言したいとしましょう。
+
+また、このパラメータには何も宣言する必要がないので、`Query`を使う必要はありません。
+
+しかし、パスパラメータ`item_id`のために`Path`を使用する必要があります。
+
+Pythonは「デフォルト」を持たない値の前に「デフォルト」を持つ値を置くことができません。
+
+しかし、それらを並び替えることができ、デフォルト値を持たない値(クエリパラメータ`q`)を最初に持つことができます。
+
+**FastAPI**では関係ありません。パラメータは名前、型、デフォルトの宣言(`Query`、`Path`など)で検出され、順番は気にしません。
+
+そのため、以下のように関数を宣言することができます:
+
+```Python hl_lines="8"
+{!../../../docs_src/path_params_numeric_validations/tutorial002.py!}
+```
+
+## 必要に応じてパラメータを並び替えるトリック
+
+クエリパラメータ`q`を`Query`やデフォルト値なしで宣言し、パスパラメータ`item_id`を`Path`を用いて宣言し、それらを別の順番に並びたい場合、Pythonには少し特殊な構文が用意されています。
+
+関数の最初のパラメータとして`*`を渡します。
+
+Pythonはその`*`で何かをすることはありませんが、それ以降のすべてのパラメータがキーワード引数(キーと値のペア)として呼ばれるべきものであると知っているでしょう。それはkwargsとしても知られています。たとえデフォルト値がなくても。
+
+```Python hl_lines="8"
+{!../../../docs_src/path_params_numeric_validations/tutorial003.py!}
+```
+
+## 数値の検証: 以上
+
+`Query`と`Path`(、そして後述する他のもの)を用いて、文字列の制約を宣言することができますが、数値の制約も同様に宣言できます。
+
+ここで、`ge=1`の場合、`item_id`は`1`「より大きい`g`か、同じ`e`」整数でなれけばなりません。
+
+```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`の値に対しても有効です。
+
+ここで重要になってくるのはgtだけでなくgeも宣言できることです。これと同様に、例えば、値が`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/ja/docs/tutorial/path-params.md b/docs/ja/docs/tutorial/path-params.md
index 66de05afb..b395dc41d 100644
--- a/docs/ja/docs/tutorial/path-params.md
+++ b/docs/ja/docs/tutorial/path-params.md
@@ -93,7 +93,7 @@ Pythonのformat文字列と同様のシンタックスで「パスパラメー
## Pydantic
-すべてのデータバリデーションは Pydantic によって内部で実行されるため、Pydanticの全てのメリットが得られます。そして、安心して利用することができます。
+すべてのデータバリデーションは Pydantic によって内部で実行されるため、Pydanticの全てのメリットが得られます。そして、安心して利用することができます。
`str`、 `float` 、 `bool` および他の多くの複雑なデータ型を型宣言に使用できます。
diff --git a/docs/ja/docs/tutorial/query-params.md b/docs/ja/docs/tutorial/query-params.md
index 5202009ef..5c4cfc5fc 100644
--- a/docs/ja/docs/tutorial/query-params.md
+++ b/docs/ja/docs/tutorial/query-params.md
@@ -73,11 +73,6 @@ http://127.0.0.1:8000/items/?skip=20
!!! check "確認"
パスパラメータ `item_id` はパスパラメータであり、`q` はそれとは違ってクエリパラメータであると判別できるほど**FastAPI** が賢いということにも注意してください。
-!!! note "備考"
- FastAPIは、`= None`があるおかげで、`q`がオプショナルだとわかります。
-
- `Optional[str]` の`Optional` はFastAPIでは使用されていません(FastAPIは`str`の部分のみ使用します)。しかし、`Optional[str]` はエディタがコードのエラーを見つけるのを助けてくれます。
-
## クエリパラメータの型変換
`bool` 型も宣言できます。これは以下の様に変換されます:
@@ -196,4 +191,4 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
!!! tip "豆知識"
- [パスパラメータ](path-params.md#predefined-values){.internal-link target=_blank}と同様に `Enum` を使用できます。
+ [パスパラメータ](path-params.md#_8){.internal-link target=_blank}と同様に `Enum` を使用できます。
diff --git a/docs/ja/docs/tutorial/request-forms-and-files.md b/docs/ja/docs/tutorial/request-forms-and-files.md
new file mode 100644
index 000000000..86913ccac
--- /dev/null
+++ b/docs/ja/docs/tutorial/request-forms-and-files.md
@@ -0,0 +1,35 @@
+# リクエストフォームとファイル
+
+`File`と`Form`を同時に使うことでファイルとフォームフィールドを定義することができます。
+
+!!! info "情報"
+ アップロードされたファイルやフォームデータを受信するには、まず`python-multipart`をインストールします。
+
+ 例えば、`pip install python-multipart`のように。
+
+## `File`と`Form`のインポート
+
+```Python hl_lines="1"
+{!../../../docs_src/request_forms_and_files/tutorial001.py!}
+```
+
+## `File`と`Form`のパラメータの定義
+
+ファイルやフォームのパラメータは`Body`や`Query`の場合と同じように作成します:
+
+```Python hl_lines="8"
+{!../../../docs_src/request_forms_and_files/tutorial001.py!}
+```
+
+ファイルとフォームフィールドがフォームデータとしてアップロードされ、ファイルとフォームフィールドを受け取ります。
+
+また、いくつかのファイルを`bytes`として、いくつかのファイルを`UploadFile`として宣言することができます。
+
+!!! warning "注意"
+ *path operation*で複数の`File`と`Form`パラメータを宣言することができますが、JSONとして受け取ることを期待している`Body`フィールドを宣言することはできません。なぜなら、リクエストのボディは`application/json`の代わりに`multipart/form-data`を使ってエンコードされているからです。
+
+ これは **FastAPI** の制限ではなく、HTTPプロトコルの一部です。
+
+## まとめ
+
+同じリクエストでデータやファイルを受け取る必要がある場合は、`File` と`Form`を一緒に使用します。
diff --git a/docs/ja/docs/tutorial/request-forms.md b/docs/ja/docs/tutorial/request-forms.md
index bce6e8d9a..f90c49746 100644
--- a/docs/ja/docs/tutorial/request-forms.md
+++ b/docs/ja/docs/tutorial/request-forms.md
@@ -3,7 +3,7 @@
JSONの代わりにフィールドを受け取る場合は、`Form`を使用します。
!!! info "情報"
- フォームを使うためには、まず`python-multipart`をインストールします。
+ フォームを使うためには、まず`python-multipart`をインストールします。
たとえば、`pip install python-multipart`のように。
diff --git a/docs/ja/docs/tutorial/response-model.md b/docs/ja/docs/tutorial/response-model.md
new file mode 100644
index 000000000..b8b6978d4
--- /dev/null
+++ b/docs/ja/docs/tutorial/response-model.md
@@ -0,0 +1,208 @@
+# レスポンスモデル
+
+*path operations* のいずれにおいても、`response_model`パラメータを使用して、レスポンスのモデルを宣言することができます:
+
+* `@app.get()`
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+* など。
+
+```Python hl_lines="17"
+{!../../../docs_src/response_model/tutorial001.py!}
+```
+
+!!! note "備考"
+ `response_model`は「デコレータ」メソッド(`get`、`post`など)のパラメータであることに注意してください。すべてのパラメータやボディのように、*path operation関数* のパラメータではありません。
+
+Pydanticモデルの属性に対して宣言するのと同じ型を受け取るので、Pydanticモデルになることもできますが、例えば、`List[Item]`のようなPydanticモデルの`list`になることもできます。
+
+FastAPIは`response_model`を使って以下のことをします:
+
+* 出力データを型宣言に変換します。
+* データを検証します。
+* OpenAPIの *path operation* で、レスポンス用のJSON Schemaを追加します。
+* 自動ドキュメントシステムで使用されます。
+
+しかし、最も重要なのは:
+
+* 出力データをモデルのデータに限定します。これがどのように重要なのか以下で見ていきましょう。
+
+!!! note "技術詳細"
+ レスポンスモデルは、関数の戻り値のアノテーションではなく、このパラメータで宣言されています。なぜなら、パス関数は実際にはそのレスポンスモデルを返すのではなく、`dict`やデータベースオブジェクト、あるいは他のモデルを返し、`response_model`を使用してフィールドの制限やシリアライズを行うからです。
+
+## 同じ入力データの返却
+
+ここでは`UserIn`モデルを宣言しています。それには平文のパスワードが含まれています:
+
+```Python hl_lines="9 11"
+{!../../../docs_src/response_model/tutorial002.py!}
+```
+
+そして、このモデルを使用して入力を宣言し、同じモデルを使って出力を宣言しています:
+
+```Python hl_lines="17 18"
+{!../../../docs_src/response_model/tutorial002.py!}
+```
+
+これで、ブラウザがパスワードを使ってユーザーを作成する際に、APIがレスポンスで同じパスワードを返すようになりました。
+
+この場合、ユーザー自身がパスワードを送信しているので問題ないかもしれません。
+
+しかし、同じモデルを別の*path operation*に使用すると、すべてのクライアントにユーザーのパスワードを送信してしまうことになります。
+
+!!! danger "危険"
+ ユーザーの平文のパスワードを保存したり、レスポンスで送信したりすることは絶対にしないでください。
+
+## 出力モデルの追加
+
+代わりに、平文のパスワードを持つ入力モデルと、パスワードを持たない出力モデルを作成することができます:
+
+```Python hl_lines="9 11 16"
+{!../../../docs_src/response_model/tutorial003.py!}
+```
+
+ここでは、*path operation関数*がパスワードを含む同じ入力ユーザーを返しているにもかかわらず:
+
+```Python hl_lines="24"
+{!../../../docs_src/response_model/tutorial003.py!}
+```
+
+...`response_model`を`UserOut`と宣言したことで、パスワードが含まれていません:
+
+```Python hl_lines="22"
+{!../../../docs_src/response_model/tutorial003.py!}
+```
+
+そのため、**FastAPI** は出力モデルで宣言されていない全てのデータをフィルタリングしてくれます(Pydanticを使用)。
+
+## ドキュメントを見る
+
+自動ドキュメントを見ると、入力モデルと出力モデルがそれぞれ独自のJSON Schemaを持っていることが確認できます。
+
+
+
+そして、両方のモデルは、対話型のAPIドキュメントに使用されます:
+
+
+
+## レスポンスモデルのエンコーディングパラメータ
+
+レスポンスモデルにはデフォルト値を設定することができます:
+
+```Python hl_lines="11 13 14"
+{!../../../docs_src/response_model/tutorial004.py!}
+```
+
+* `description: str = None`は`None`がデフォルト値です。
+* `tax: float = 10.5`は`10.5`がデフォルト値です。
+* `tags: List[str] = []` は空のリスト(`[]`)がデフォルト値です。
+
+しかし、実際に保存されていない場合には結果からそれらを省略した方が良いかもしれません。
+
+例えば、NoSQLデータベースに多くのオプション属性を持つモデルがあるが、デフォルト値でいっぱいの非常に長いJSONレスポンスを送信したくない場合です。
+
+### `response_model_exclude_unset`パラメータの使用
+
+*path operation デコレータ*に`response_model_exclude_unset=True`パラメータを設定することができます:
+
+```Python hl_lines="24"
+{!../../../docs_src/response_model/tutorial004.py!}
+```
+
+そして、これらのデフォルト値はレスポンスに含まれず、実際に設定された値のみが含まれます。
+
+そのため、*path operation*にID`foo`が設定されたitemのリクエストを送ると、レスポンスは以下のようになります(デフォルト値を含まない):
+
+```JSON
+{
+ "name": "Foo",
+ "price": 50.2
+}
+```
+
+!!! info "情報"
+ FastAPIはこれをするために、Pydanticモデルの`.dict()`をその`exclude_unset`パラメータで使用しています。
+
+!!! info "情報"
+ 以下も使用することができます:
+
+ * `response_model_exclude_defaults=True`
+ * `response_model_exclude_none=True`
+
+ `exclude_defaults`と`exclude_none`については、Pydanticのドキュメントで説明されている通りです。
+
+#### デフォルト値を持つフィールドの値を持つデータ
+
+しかし、ID`bar`のitemのように、デフォルト値が設定されているモデルのフィールドに値が設定されている場合:
+
+```Python hl_lines="3 5"
+{
+ "name": "Bar",
+ "description": "The bartenders",
+ "price": 62,
+ "tax": 20.2
+}
+```
+
+それらはレスポンスに含まれます。
+
+#### デフォルト値と同じ値を持つデータ
+
+ID`baz`のitemのようにデフォルト値と同じ値を持つデータの場合:
+
+```Python hl_lines="3 5 6"
+{
+ "name": "Baz",
+ "description": None,
+ "price": 50.2,
+ "tax": 10.5,
+ "tags": []
+}
+```
+
+FastAPIは十分に賢いので(実際には、Pydanticが十分に賢い)`description`や`tax`、`tags`はデフォルト値と同じ値を持っているにもかかわらず、明示的に設定されていることを理解しています。(デフォルトから取得するのではなく)
+
+そのため、それらはJSONレスポンスに含まれることになります。
+
+!!! tip "豆知識"
+ デフォルト値は`None`だけでなく、なんでも良いことに注意してください。
+ 例えば、リスト(`[]`)や`10.5`の`float`などです。
+
+### `response_model_include`と`response_model_exclude`
+
+*path operationデコレータ*として`response_model_include`と`response_model_exclude`も使用することができます。
+
+属性名を持つ`str`の`set`を受け取り、含める(残りを省略する)か、除外(残りを含む)します。
+
+これは、Pydanticモデルが1つしかなく、出力からいくつかのデータを削除したい場合のクイックショートカットとして使用することができます。
+
+!!! tip "豆知識"
+ それでも、これらのパラメータではなく、複数のクラスを使用して、上記のようなアイデアを使うことをおすすめします。
+
+ これは`response_model_include`や`response_mode_exclude`を使用していくつかの属性を省略しても、アプリケーションのOpenAPI(とドキュメント)で生成されたJSON Schemaが完全なモデルになるからです。
+
+ 同様に動作する`response_model_by_alias`にも当てはまります。
+
+```Python hl_lines="31 37"
+{!../../../docs_src/response_model/tutorial005.py!}
+```
+
+!!! tip "豆知識"
+ `{"name", "description"}`の構文はこれら2つの値をもつ`set`を作成します。
+
+ これは`set(["name", "description"])`と同等です。
+
+#### `set`の代わりに`list`を使用する
+
+もし`set`を使用することを忘れて、代わりに`list`や`tuple`を使用しても、FastAPIはそれを`set`に変換して正しく動作します:
+
+```Python hl_lines="31 37"
+{!../../../docs_src/response_model/tutorial006.py!}
+```
+
+## まとめ
+
+*path operationデコレータの*`response_model`パラメータを使用して、レスポンスモデルを定義し、特にプライベートデータがフィルタリングされていることを保証します。
+
+明示的に設定された値のみを返すには、`response_model_exclude_unset`を使用します。
diff --git a/docs/ja/docs/tutorial/response-status-code.md b/docs/ja/docs/tutorial/response-status-code.md
new file mode 100644
index 000000000..ead2addda
--- /dev/null
+++ b/docs/ja/docs/tutorial/response-status-code.md
@@ -0,0 +1,89 @@
+# レスポンスステータスコード
+
+レスポンスモデルを指定するのと同じ方法で、レスポンスに使用されるHTTPステータスコードを以下の*path operations*のいずれかの`status_code`パラメータで宣言することもできます。
+
+* `@app.get()`
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+* など。
+
+```Python hl_lines="6"
+{!../../../docs_src/response_status_code/tutorial001.py!}
+```
+
+!!! note "備考"
+ `status_code`は「デコレータ」メソッド(`get`、`post`など)のパラメータであることに注意してください。すべてのパラメータやボディのように、*path operation関数*のものではありません。
+
+`status_code`パラメータはHTTPステータスコードを含む数値を受け取ります。
+
+!!! info "情報"
+ `status_code`は代わりに、Pythonの`http.HTTPStatus`のように、`IntEnum`を受け取ることもできます。
+
+これは:
+
+* レスポンスでステータスコードを返します。
+* OpenAPIスキーマ(およびユーザーインターフェース)に以下のように文書化します:
+
+
+
+!!! note "備考"
+ いくつかのレスポンスコード(次のセクションを参照)は、レスポンスにボディがないことを示しています。
+
+ FastAPIはこれを知っていて、レスポンスボディがないというOpenAPIドキュメントを生成します。
+
+## HTTPステータスコードについて
+
+!!! note "備考"
+ すでにHTTPステータスコードが何であるかを知っている場合は、次のセクションにスキップしてください。
+
+HTTPでは、レスポンスの一部として3桁の数字のステータスコードを送信します。
+
+これらのステータスコードは、それらを認識するために関連付けられた名前を持っていますが、重要な部分は番号です。
+
+つまり:
+
+* `100`以上は「情報」のためのものです。。直接使うことはほとんどありません。これらのステータスコードを持つレスポンスはボディを持つことができません。
+* **`200`** 以上は「成功」のレスポンスのためのものです。これらは最も利用するであろうものです。
+ * `200`はデフォルトのステータスコードで、すべてが「OK」であったことを意味します。
+ * 別の例としては、`201`(Created)があります。これはデータベースに新しいレコードを作成した後によく使用されます。
+ * 特殊なケースとして、`204`(No Content)があります。このレスポンスはクライアントに返すコンテンツがない場合に使用されます。そしてこのレスポンスはボディを持つことはできません。
+* **`300`** 以上は「リダイレクト」のためのものです。これらのステータスコードを持つレスポンスは`304`(Not Modified)を除き、ボディを持つことも持たないこともできます。
+* **`400`** 以上は「クライアントエラー」のレスポンスのためのものです。これらは、おそらく最も多用するであろう2番目のタイプです。
+ * 例えば、`404`は「Not Found」レスポンスです。
+ * クライアントからの一般的なエラーについては、`400`を使用することができます。
+* `500`以上はサーバーエラーのためのものです。これらを直接使うことはほとんどありません。アプリケーションコードやサーバーのどこかで何か問題が発生した場合、これらのステータスコードのいずれかが自動的に返されます。
+
+!!! 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!}
+```
+
+それらは便利です。それらは同じ番号を保持しており、その方法ではエディタの自動補完を使用してそれらを見つけることができます。
+
+
+
+!!! note "技術詳細"
+ また、`from starlette import status`を使うこともできます。
+
+ **FastAPI** は、`開発者の利便性を考慮して、fastapi.status`と同じ`starlette.status`を提供しています。しかし、これはStarletteから直接提供されています。
+
+## デフォルトの変更
+
+後に、[高度なユーザーガイド](../advanced/response-change-status-code.md){.internal-link target=_blank}で、ここで宣言しているデフォルトとは異なるステータスコードを返す方法を見ていきます。
diff --git a/docs/ja/docs/tutorial/schema-extra-example.md b/docs/ja/docs/tutorial/schema-extra-example.md
new file mode 100644
index 000000000..d96163b82
--- /dev/null
+++ b/docs/ja/docs/tutorial/schema-extra-example.md
@@ -0,0 +1,58 @@
+# スキーマの追加 - 例
+
+JSON Schemaに追加する情報を定義することができます。
+
+一般的なユースケースはこのドキュメントで示されているように`example`を追加することです。
+
+JSON Schemaの追加情報を宣言する方法はいくつかあります。
+
+## Pydanticの`schema_extra`
+
+Pydanticのドキュメント: スキーマのカスタマイズで説明されているように、`Config`と`schema_extra`を使ってPydanticモデルの例を宣言することができます:
+
+```Python hl_lines="15 16 17 18 19 20 21 22 23"
+{!../../../docs_src/schema_extra_example/tutorial001.py!}
+```
+
+その追加情報はそのまま出力され、JSON Schemaに追加されます。
+
+## `Field`の追加引数
+
+後述する`Field`、`Path`、`Query`、`Body`などでは、任意の引数を関数に渡すことでJSON Schemaの追加情報を宣言することもできます:
+
+```Python hl_lines="4 10 11 12 13"
+{!../../../docs_src/schema_extra_example/tutorial002.py!}
+```
+
+!!! warning "注意"
+ これらの追加引数が渡されても、文書化のためのバリデーションは追加されず、注釈だけが追加されることを覚えておいてください。
+
+## `Body`の追加引数
+
+追加情報を`Field`に渡すのと同じように、`Path`、`Query`、`Body`などでも同じことができます。
+
+例えば、`Body`にボディリクエストの`example`を渡すことができます:
+
+```Python hl_lines="21 22 23 24 25 26"
+{!../../../docs_src/schema_extra_example/tutorial003.py!}
+```
+
+## ドキュメントのUIの例
+
+上記のいずれの方法でも、`/docs`の中では以下のようになります:
+
+
+
+## 技術詳細
+
+`example` と `examples`について...
+
+JSON Schemaの最新バージョンでは`examples`というフィールドを定義していますが、OpenAPIは`examples`を持たない古いバージョンのJSON Schemaをベースにしています。
+
+そのため、OpenAPIでは同じ目的のために`example`を独自に定義しており(`examples`ではなく`example`として)、それがdocs UI(Swagger UIを使用)で使用されています。
+
+つまり、`example`はJSON Schemaの一部ではありませんが、OpenAPIの一部であり、それがdocs UIで使用されることになります。
+
+## その他の情報
+
+同じように、フロントエンドのユーザーインターフェースなどをカスタマイズするために、各モデルのJSON Schemaに追加される独自の追加情報を追加することができます。
diff --git a/docs/ja/docs/tutorial/security/first-steps.md b/docs/ja/docs/tutorial/security/first-steps.md
index f83b59cfd..dc3267e62 100644
--- a/docs/ja/docs/tutorial/security/first-steps.md
+++ b/docs/ja/docs/tutorial/security/first-steps.md
@@ -27,7 +27,7 @@
## 実行
!!! info "情報"
- まず`python-multipart`をインストールします。
+ まず`python-multipart`をインストールします。
例えば、`pip install python-multipart`。
@@ -125,7 +125,7 @@ OAuth2は、バックエンドやAPIがユーザーを認証するサーバー
相対URLを使っているので、APIが`https://example.com/`にある場合、`https://example.com/token`を参照します。しかし、APIが`https://example.com/api/v1/`にある場合は`https://example.com/api/v1/token`を参照することになります。
- 相対 URL を使うことは、[プロキシと接続](./.../advanced/behind-a-proxy.md){.internal-link target=_blank}のような高度なユースケースでもアプリケーションを動作させ続けるために重要です。
+ 相対 URL を使うことは、[プロキシと接続](../../advanced/behind-a-proxy.md){.internal-link target=_blank}のような高度なユースケースでもアプリケーションを動作させ続けるために重要です。
このパラメーターはエンドポイント/ *path operation*を作成しません。しかし、URL`/token`はクライアントがトークンを取得するために使用するものであると宣言します。この情報は OpenAPI やインタラクティブな API ドキュメントシステムで使われます。
diff --git a/docs/ja/docs/tutorial/security/get-current-user.md b/docs/ja/docs/tutorial/security/get-current-user.md
new file mode 100644
index 000000000..7f8dcaad2
--- /dev/null
+++ b/docs/ja/docs/tutorial/security/get-current-user.md
@@ -0,0 +1,114 @@
+# 現在のユーザーの取得
+
+一つ前の章では、(依存性注入システムに基づいた)セキュリティシステムは、 *path operation関数* に `str` として `token` を与えていました:
+
+```Python hl_lines="10"
+{!../../../docs_src/security/tutorial001.py!}
+```
+
+しかし、それはまだそんなに有用ではありません。
+
+現在のユーザーを取得するようにしてみましょう。
+
+## ユーザーモデルの作成
+
+まずは、Pydanticのユーザーモデルを作成しましょう。
+
+ボディを宣言するのにPydanticを使用するのと同じやり方で、Pydanticを別のどんなところでも使うことができます:
+
+```Python hl_lines="5 12-16"
+{!../../../docs_src/security/tutorial002.py!}
+```
+
+## 依存関係 `get_current_user` を作成
+
+依存関係 `get_current_user` を作ってみましょう。
+
+依存関係はサブ依存関係を持つことができるのを覚えていますか?
+
+`get_current_user` は前に作成した `oauth2_scheme` と同じ依存関係を持ちます。
+
+以前直接 *path operation* の中でしていたのと同じように、新しい依存関係である `get_current_user` は `str` として `token` を受け取るようになります:
+
+```Python hl_lines="25"
+{!../../../docs_src/security/tutorial002.py!}
+```
+
+## ユーザーの取得
+
+`get_current_user` は作成した(偽物の)ユーティリティ関数を使って、 `str` としてトークンを受け取り、先ほどのPydanticの `User` モデルを返却します:
+
+```Python hl_lines="19-22 26-27"
+{!../../../docs_src/security/tutorial002.py!}
+```
+
+## 現在のユーザーの注入
+
+ですので、 `get_current_user` に対して同様に *path operation* の中で `Depends` を利用できます。
+
+```Python hl_lines="31"
+{!../../../docs_src/security/tutorial002.py!}
+```
+
+Pydanticモデルの `User` として、 `current_user` の型を宣言することに注意してください。
+
+その関数の中ですべての入力補完や型チェックを行う際に役に立ちます。
+
+!!! tip "豆知識"
+ リクエストボディはPydanticモデルでも宣言できることを覚えているかもしれません。
+
+ ここでは `Depends` を使っているおかげで、 **FastAPI** が混乱することはありません。
+
+
+!!! check "確認"
+ 依存関係システムがこのように設計されているおかげで、 `User` モデルを返却する別の依存関係(別の"dependables")を持つことができます。
+
+ 同じデータ型を返却する依存関係は一つだけしか持てない、という制約が入ることはないのです。
+
+
+## 別のモデル
+
+これで、*path operation関数* の中で現在のユーザーを直接取得し、`Depends` を使って、 **依存性注入** レベルでセキュリティメカニズムを処理できるようになりました。
+
+そして、セキュリティ要件のためにどんなモデルやデータでも利用することができます。(この場合は、 Pydanticモデルの `User`)
+
+しかし、特定のデータモデルやクラス、型に制限されることはありません。
+
+モデルを、 `id` と `email` は持つが、 `username` は全く持たないようにしたいですか? わかりました。同じ手段でこうしたこともできます。
+
+ある `str` だけを持ちたい? あるいはある `dict` だけですか? それとも、データベースクラスのモデルインスタンスを直接持ちたいですか? すべて同じやり方で機能します。
+
+実際には、あなたのアプリケーションにはログインするようなユーザーはおらず、単にアクセストークンを持つロボットやボット、別のシステムがありますか?ここでも、全く同じようにすべて機能します。
+
+あなたのアプリケーションに必要なのがどんな種類のモデル、どんな種類のクラス、どんな種類のデータベースであったとしても、 **FastAPI** は依存性注入システムでカバーしてくれます。
+
+
+## コードサイズ
+
+この例は冗長に見えるかもしれません。セキュリティとデータモデルユーティリティ関数および *path operations* が同じファイルに混在しているということを覚えておいてください。
+
+しかし、ここに重要なポイントがあります。
+
+セキュリティと依存性注入に関するものは、一度だけ書きます。
+
+そして、それは好きなだけ複雑にすることができます。それでも、一箇所に、一度だけ書くのです。すべての柔軟性を備えます。
+
+しかし、同じセキュリティシステムを使って何千ものエンドポイント(*path operations*)を持つことができます。
+
+そして、それらエンドポイントのすべて(必要な、どの部分でも)がこうした依存関係や、あなたが作成する別の依存関係を再利用する利点を享受できるのです。
+
+さらに、こうした何千もの *path operations* は、たった3行で表現できるのです:
+
+```Python hl_lines="30-32"
+{!../../../docs_src/security/tutorial002.py!}
+```
+
+## まとめ
+
+これで、 *path operation関数* の中で直接現在のユーザーを取得できるようになりました。
+
+既に半分のところまで来ています。
+
+あとは、 `username` と `password` を実際にそのユーザーやクライアントに送る、 *path operation* を追加する必要があるだけです。
+
+次はそれを説明します。
diff --git a/docs/ja/docs/tutorial/security/index.md b/docs/ja/docs/tutorial/security/index.md
new file mode 100644
index 000000000..390f21047
--- /dev/null
+++ b/docs/ja/docs/tutorial/security/index.md
@@ -0,0 +1,101 @@
+# セキュリティ入門
+
+セキュリティ、認証、認可を扱うには多くの方法があります。
+
+そして、通常、それは複雑で「難しい」トピックです。
+
+多くのフレームワークやシステムでは、セキュリティと認証を処理するだけで、膨大な労力とコードが必要になります(多くの場合、書かれた全コードの50%以上を占めることがあります)。
+
+**FastAPI** は、セキュリティの仕様をすべて勉強して学ぶことなく、標準的な方法で簡単に、迅速に**セキュリティ**を扱うためのツールをいくつか提供します。
+
+しかし、その前に、いくつかの小さな概念を確認しましょう。
+
+## お急ぎですか?
+
+もし、これらの用語に興味がなく、ユーザー名とパスワードに基づく認証でセキュリティを**今すぐ**確保する必要がある場合は、次の章に進んでください。
+
+## OAuth2
+
+OAuth2は、認証と認可を処理するためのいくつかの方法を定義した仕様です。
+
+かなり広範囲な仕様で、いくつかの複雑なユースケースをカバーしています。
+
+これには「サードパーティ」を使用して認証する方法が含まれています。
+
+これが、「Facebook、Google、Twitter、GitHubを使ってログイン」を使用したすべてのシステムの背後で使われている仕組みです。
+
+### OAuth 1
+
+OAuth 1というものもありましたが、これはOAuth2とは全く異なり、通信をどのように暗号化するかという仕様が直接的に含まれており、より複雑なものとなっています。
+
+現在ではあまり普及していませんし、使われてもいません。
+
+OAuth2は、通信を暗号化する方法を指定せず、アプリケーションがHTTPSで提供されることを想定しています。
+
+!!! tip "豆知識"
+ **デプロイ**のセクションでは、TraefikとLet's Encryptを使用して、無料でHTTPSを設定する方法が紹介されています。
+
+
+## OpenID Connect
+
+OpenID Connectは、**OAuth2**をベースにした別の仕様です。
+
+これはOAuth2を拡張したもので、OAuth2ではやや曖昧だった部分を明確にし、より相互運用性を高めようとしたものです。
+
+例として、GoogleのログインはOpenID Connectを使用しています(これはOAuth2がベースになっています)。
+
+しかし、FacebookのログインはOpenID Connectをサポートしていません。OAuth2を独自にアレンジしています。
+
+### OpenID (「OpenID Connect」ではない)
+
+また、「OpenID」という仕様もありました。それは、**OpenID Connect**と同じことを解決しようとしたものですが、OAuth2に基づいているわけではありませんでした。
+
+つまり、完全な追加システムだったのです。
+
+現在ではあまり普及していませんし、使われてもいません。
+
+## OpenAPI
+
+OpenAPI(以前はSwaggerとして知られていました)は、APIを構築するためのオープンな仕様です(現在はLinux Foundationの一部になっています)。
+
+**FastAPI**は、**OpenAPI**をベースにしています。
+
+それが、複数の自動対話型ドキュメント・インターフェースやコード生成などを可能にしているのです。
+
+OpenAPIには、複数のセキュリティ「スキーム」を定義する方法があります。
+
+それらを使用することで、これらの対話型ドキュメントシステムを含む、標準ベースのツールをすべて活用できます。
+
+OpenAPIでは、以下のセキュリティスキームを定義しています:
+
+* `apiKey`: アプリケーション固有のキーで、これらのものから取得できます。
+ * クエリパラメータ
+ * ヘッダー
+ * クッキー
+* `http`: 標準的なHTTP認証システムで、これらのものを含みます。
+ * `bearer`: ヘッダ `Authorization` の値が `Bearer ` で、トークンが含まれます。これはOAuth2から継承しています。
+ * HTTP Basic認証
+ * HTTP ダイジェスト認証など
+* `oauth2`: OAuth2のセキュリティ処理方法(「フロー」と呼ばれます)のすべて。
+ * これらのフローのいくつかは、OAuth 2.0認証プロバイダ(Google、Facebook、Twitter、GitHubなど)を構築するのに適しています。
+ * `implicit`
+ * `clientCredentials`
+ * `authorizationCode`
+ * しかし、同じアプリケーション内で認証を直接処理するために完全に機能する特定の「フロー」があります。
+ * `password`: 次のいくつかの章では、その例を紹介します。
+* `openIdConnect`: OAuth2認証データを自動的に発見する方法を定義できます。
+ * この自動検出メカニズムは、OpenID Connectの仕様で定義されているものです。
+
+
+!!! tip "豆知識"
+ Google、Facebook、Twitter、GitHubなど、他の認証/認可プロバイダを統合することも可能で、比較的簡単です。
+
+ 最も複雑な問題は、それらのような認証/認可プロバイダを構築することですが、**FastAPI**は、あなたのために重い仕事をこなしながら、それを簡単に行うためのツールを提供します。
+
+## **FastAPI** ユーティリティ
+
+FastAPIは `fastapi.security` モジュールの中で、これらのセキュリティスキームごとにいくつかのツールを提供し、これらのセキュリティメカニズムを簡単に使用できるようにします。
+
+次の章では、**FastAPI** が提供するこれらのツールを使って、あなたのAPIにセキュリティを追加する方法について見ていきます。
+
+また、それがどのようにインタラクティブなドキュメントシステムに自動的に統合されるかも見ていきます。
diff --git a/docs/ko/docs/about/index.md b/docs/ko/docs/about/index.md
new file mode 100644
index 000000000..ee7804d32
--- /dev/null
+++ b/docs/ko/docs/about/index.md
@@ -0,0 +1,3 @@
+# 소개
+
+FastAPI에 대한 디자인, 영감 등에 대해 🤓
diff --git a/docs/ko/docs/advanced/events.md b/docs/ko/docs/advanced/events.md
new file mode 100644
index 000000000..d3227497b
--- /dev/null
+++ b/docs/ko/docs/advanced/events.md
@@ -0,0 +1,45 @@
+# 이벤트: startup과 shutdown
+
+필요에 따라 응용 프로그램이 시작되기 전이나 종료될 때 실행되는 이벤트 핸들러(함수)를 정의할 수 있습니다.
+
+이 함수들은 `async def` 또는 평범하게 `def`으로 선언할 수 있습니다.
+
+!!! warning "경고"
+ 이벤트 핸들러는 주 응용 프로그램에서만 작동합니다. [하위 응용 프로그램 - 마운트](./sub-applications.md){.internal-link target=_blank}에서는 작동하지 않습니다.
+
+## `startup` 이벤트
+
+응용 프로그램을 시작하기 전에 실행하려는 함수를 "startup" 이벤트로 선언합니다:
+
+```Python hl_lines="8"
+{!../../../docs_src/events/tutorial001.py!}
+```
+
+이 경우 `startup` 이벤트 핸들러 함수는 단순히 몇 가지 값으로 구성된 `dict` 형식의 "데이터베이스"를 초기화합니다.
+
+하나 이상의 이벤트 핸들러 함수를 추가할 수도 있습니다.
+
+그리고 응용 프로그램은 모든 `startup` 이벤트 핸들러가 완료될 때까지 요청을 받지 않습니다.
+
+## `shutdown` 이벤트
+
+응용 프로그램이 종료될 때 실행하려는 함수를 추가하려면 `"shutdown"` 이벤트로 선언합니다:
+
+```Python hl_lines="6"
+{!../../../docs_src/events/tutorial002.py!}
+```
+
+이 예제에서 `shutdown` 이벤트 핸들러 함수는 `"Application shutdown"`이라는 텍스트가 적힌 `log.txt` 파일을 추가할 것입니다.
+
+!!! info "정보"
+ `open()` 함수에서 `mode="a"`는 "추가"를 의미합니다. 따라서 이미 존재하는 파일의 내용을 덮어쓰지 않고 새로운 줄을 추가합니다.
+
+!!! tip "팁"
+ 이 예제에서는 파일과 상호작용 하기 위해 파이썬 표준 함수인 `open()`을 사용하고 있습니다.
+
+ 따라서 디스크에 데이터를 쓰기 위해 "대기"가 필요한 I/O (입력/출력) 작업을 수행합니다.
+
+ 그러나 `open()`은 `async`와 `await`을 사용하지 않기 때문에 이벤트 핸들러 함수는 `async def`가 아닌 표준 `def`로 선언하고 있습니다.
+
+!!! info "정보"
+ 이벤트 핸들러에 관한 내용은 Starlette 이벤트 문서에서 추가로 확인할 수 있습니다.
diff --git a/docs/ko/docs/advanced/index.md b/docs/ko/docs/advanced/index.md
new file mode 100644
index 000000000..5fd1711a1
--- /dev/null
+++ b/docs/ko/docs/advanced/index.md
@@ -0,0 +1,24 @@
+# 심화 사용자 안내서 - 도입부
+
+## 추가 기능
+
+메인 [자습서 - 사용자 안내서](../tutorial/index.md){.internal-link target=_blank}는 여러분이 **FastAPI**의 모든 주요 기능을 둘러보시기에 충분할 것입니다.
+
+이어지는 장에서는 여러분이 다른 옵션, 구성 및 추가 기능을 보실 수 있습니다.
+
+!!! tip "팁"
+ 다음 장들이 **반드시 "심화"**인 것은 아닙니다.
+
+ 그리고 여러분의 사용 사례에 대한 해결책이 그중 하나에 있을 수 있습니다.
+
+## 자습서를 먼저 읽으십시오
+
+여러분은 메인 [자습서 - 사용자 안내서](../tutorial/index.md){.internal-link target=_blank}의 지식으로 **FastAPI**의 대부분의 기능을 사용하실 수 있습니다.
+
+이어지는 장들은 여러분이 메인 자습서 - 사용자 안내서를 이미 읽으셨으며 주요 아이디어를 알고 계신다고 가정합니다.
+
+## TestDriven.io 강좌
+
+여러분이 문서의 이 부분을 보완하시기 위해 심화-기초 강좌 수강을 희망하신다면 다음을 참고 하시기를 바랍니다: **TestDriven.io**의 FastAPI와 Docker를 사용한 테스트 주도 개발.
+
+그들은 현재 전체 수익의 10퍼센트를 **FastAPI** 개발에 기부하고 있습니다. 🎉 😄
diff --git a/docs/ko/docs/async.md b/docs/ko/docs/async.md
index 47dbaa1b0..65ee124ec 100644
--- a/docs/ko/docs/async.md
+++ b/docs/ko/docs/async.md
@@ -2,7 +2,7 @@
*경로 작동 함수*에서의 `async def` 문법에 대한 세부사항과 비동기 코드, 동시성 및 병렬성에 대한 배경
-## 바쁘신 경우
+## 바쁘신 경우
요약
@@ -263,7 +263,7 @@ CPU에 묶인 연산에 관한 흔한 예시는 복잡한 수학 처리를 필
파이썬이 **데이터 사이언스**, 머신러닝과 특히 딥러닝에 의 주된 언어라는 간단한 사실에 더해서, 이것은 FastAPI를 데이터 사이언스 / 머신러닝 웹 API와 응용프로그램에 (다른 것들보다) 좋은 선택지가 되게 합니다.
-배포시 병렬을 어떻게 가능하게 하는지 알고싶다면, [배포](/ko/deployment){.internal-link target=_blank}문서를 참고하십시오.
+배포시 병렬을 어떻게 가능하게 하는지 알고싶다면, [배포](deployment/index.md){.internal-link target=_blank}문서를 참고하십시오.
## `async`와 `await`
@@ -379,7 +379,7 @@ FastAPI를 사용하지 않더라도, 높은 호환성 및 I/O를 수행하는 코드를 사용하지 않는 한 `async def`를 사용하는 편이 더 낫습니다.
-하지만 두 경우 모두, FastAPI가 당신이 전에 사용하던 프레임워크보다 [더 빠를](/#performance){.internal-link target=_blank} (최소한 비견될) 확률이 높습니다.
+하지만 두 경우 모두, FastAPI가 당신이 전에 사용하던 프레임워크보다 [더 빠를](index.md#_11){.internal-link target=_blank} (최소한 비견될) 확률이 높습니다.
### 의존성
@@ -401,4 +401,4 @@ FastAPI를 사용하지 않더라도, 높은 호환성 및 Platform.sh
* Porter
-* Deta
diff --git a/docs/ko/docs/deployment/docker.md b/docs/ko/docs/deployment/docker.md
new file mode 100644
index 000000000..0e8f85cae
--- /dev/null
+++ b/docs/ko/docs/deployment/docker.md
@@ -0,0 +1,698 @@
+# 컨테이너의 FastAPI - 도커
+
+FastAPI 어플리케이션을 배포할 때 일반적인 접근 방법은 **리눅스 컨테이너 이미지**를 생성하는 것입니다. 이 방법은 주로 **도커**를 사용해 이루어집니다. 그런 다음 해당 컨테이너 이미지를 몇가지 방법으로 배포할 수 있습니다.
+
+리눅스 컨테이너를 사용하는 데에는 **보안**, **반복 가능성**, **단순함** 등의 장점이 있습니다.
+
+!!! tip "팁"
+ 시간에 쫓기고 있고 이미 이런것들을 알고 있다면 [`Dockerfile`👇](#build-a-docker-image-for-fastapi)로 점프할 수 있습니다.
+
+HTTPX - `TestClient`를 사용하려면 필요.
* jinja2 - 기본 템플릿 설정을 사용하려면 필요.
-* python-multipart - `request.form()`과 함께 "parsing"의 지원을 원하면 필요.
+* python-multipart - `request.form()`과 함께 "parsing"의 지원을 원하면 필요.
* itsdangerous - `SessionMiddleware` 지원을 위해 필요.
* pyyaml - Starlette의 `SchemaGenerator` 지원을 위해 필요 (FastAPI와 쓸때는 필요 없을 것입니다).
* graphene - `GraphQLApp` 지원을 위해 필요.
-* ujson - `UJSONResponse`를 사용하려면 필요.
FastAPI / Starlette이 사용하는:
* uvicorn - 애플리케이션을 로드하고 제공하는 서버.
* orjson - `ORJSONResponse`을 사용하려면 필요.
+* ujson - `UJSONResponse`를 사용하려면 필요.
`pip install fastapi[all]`를 통해 이 모두를 설치 할 수 있습니다.
diff --git a/docs/ko/docs/learn/index.md b/docs/ko/docs/learn/index.md
new file mode 100644
index 000000000..7ac3a99b6
--- /dev/null
+++ b/docs/ko/docs/learn/index.md
@@ -0,0 +1,5 @@
+# 배우기
+
+여기 **FastAPI**를 배우기 위한 입문 자료와 자습서가 있습니다.
+
+여러분은 FastAPI를 배우기 위해 **책**, **강의**, **공식 자료** 그리고 추천받은 방법을 고려할 수 있습니다. 😎
diff --git a/docs/ko/docs/python-types.md b/docs/ko/docs/python-types.md
new file mode 100644
index 000000000..267ce6c7e
--- /dev/null
+++ b/docs/ko/docs/python-types.md
@@ -0,0 +1,315 @@
+# 파이썬 타입 소개
+
+파이썬은 선택적으로 "타입 힌트(type hints)"를 지원합니다.
+
+이러한 **타입 힌트**들은 변수의 타입을 선언할 수 있게 해주는 특수한 구문입니다.
+
+변수의 타입을 지정하면 에디터와 툴이 더 많은 도움을 줄 수 있게 됩니다.
+
+이 문서는 파이썬 타입 힌트에 대한 **빠른 자습서 / 내용환기** 수준의 문서입니다. 여기서는 **FastAPI**를 쓰기 위한 최소한의 내용만을 다룹니다.
+
+**FastAPI**는 타입 힌트에 기반을 두고 있으며, 이는 많은 장점과 이익이 있습니다.
+
+비록 **FastAPI**를 쓰지 않는다고 하더라도, 조금이라도 알아두면 도움이 될 것입니다.
+
+!!! note "참고"
+ 파이썬에 능숙하셔서 타입 힌트에 대해 모두 아신다면, 다음 챕터로 건너뛰세요.
+
+## 동기 부여
+
+간단한 예제부터 시작해봅시다:
+
+```Python
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+이 프로그램을 실행한 결과값:
+
+```
+John Doe
+```
+
+함수는 아래와 같이 실행됩니다:
+
+* `first_name`과 `last_name`를 받습니다.
+* `title()`로 각 첫 문자를 대문자로 변환시킵니다.
+* 두 단어를 중간에 공백을 두고 연결합니다.
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial001.py!}
+```
+
+### 코드 수정
+
+이건 매우 간단한 프로그램입니다.
+
+그런데 처음부터 작성한다고 생각을 해봅시다.
+
+여러분은 매개변수를 준비했고, 함수를 정의하기 시작했을 겁니다.
+
+이때 "첫 글자를 대문자로 바꾸는 함수"를 호출해야 합니다.
+
+`upper`였나? 아니면 `uppercase`? `first_uppercase`? `capitalize`?
+
+그때 개발자들의 오랜 친구, 에디터 자동완성을 시도해봅니다.
+
+당신은 `first_name`를 입력한 뒤 점(`.`)을 입력하고 자동완성을 켜기 위해서 `Ctrl+Space`를 눌렀습니다.
+
+하지만 슬프게도 아무런 도움이 되지 않습니다:
+
+
+
+### 타입 추가하기
+
+이전 버전에서 한 줄만 수정해봅시다.
+
+저희는 이 함수의 매개변수 부분:
+
+```Python
+ first_name, last_name
+```
+
+을 아래와 같이 바꿀 겁니다:
+
+```Python
+ first_name: str, last_name: str
+```
+
+이게 다입니다.
+
+이게 "타입 힌트"입니다:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial002.py!}
+```
+
+타입힌트는 다음과 같이 기본 값을 선언하는 것과는 다릅니다:
+
+```Python
+ first_name="john", last_name="doe"
+```
+
+이는 다른 것입니다.
+
+등호(`=`) 대신 콜론(`:`)을 쓰고 있습니다.
+
+일반적으로 타입힌트를 추가한다고 해서 특별하게 어떤 일이 일어나지도 않습니다.
+
+그렇지만 이제, 다시 함수를 만드는 도중이라고 생각해봅시다. 다만 이번엔 타입 힌트가 있습니다.
+
+같은 상황에서 `Ctrl+Space`로 자동완성을 작동시키면,
+
+
+
+아래와 같이 "그렇지!"하는 옵션이 나올때까지 스크롤을 내려서 볼 수 있습니다:
+
+
+
+## 더 큰 동기부여
+
+아래 함수를 보면, 이미 타입 힌트가 적용되어 있는 걸 볼 수 있습니다:
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial003.py!}
+```
+
+편집기가 변수의 타입을 알고 있기 때문에, 자동완성 뿐 아니라 에러도 확인할 수 있습니다:
+
+
+
+이제 고쳐야하는 걸 알기 때문에, `age`를 `str(age)`과 같이 문자열로 바꾸게 됩니다:
+
+```Python hl_lines="2"
+{!../../../docs_src/python_types/tutorial004.py!}
+```
+
+## 타입 선언
+
+방금 함수의 매개변수로써 타입 힌트를 선언하는 주요 장소를 보았습니다.
+
+이 위치는 여러분이 **FastAPI**와 함께 이를 사용하는 주요 장소입니다.
+
+### Simple 타입
+
+`str`뿐 아니라 모든 파이썬 표준 타입을 선언할 수 있습니다.
+
+예를 들면:
+
+* `int`
+* `float`
+* `bool`
+* `bytes`
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial005.py!}
+```
+
+### 타입 매개변수를 활용한 Generic(제네릭) 타입
+
+`dict`, `list`, `set`, `tuple`과 같은 값을 저장할 수 있는 데이터 구조가 있고, 내부의 값은 각자의 타입을 가질 수도 있습니다.
+
+타입과 내부 타입을 선언하기 위해서는 파이썬 표준 모듈인 `typing`을 이용해야 합니다.
+
+구체적으로는 아래 타입 힌트를 지원합니다.
+
+#### `List`
+
+예를 들면, `str`의 `list`인 변수를 정의해봅시다.
+
+`typing`에서 `List`(대문자 `L`)를 import 합니다.
+
+```Python hl_lines="1"
+{!../../../docs_src/python_types/tutorial006.py!}
+```
+
+콜론(`:`) 문법을 이용하여 변수를 선언합니다.
+
+타입으로는 `List`를 넣어줍니다.
+
+이때 배열은 내부 타입을 포함하는 타입이기 때문에 대괄호 안에 넣어줍니다.
+
+```Python hl_lines="4"
+{!../../../docs_src/python_types/tutorial006.py!}
+```
+
+!!! tip "팁"
+ 대괄호 안의 내부 타입은 "타입 매개변수(type paramters)"라고 합니다.
+
+ 이번 예제에서는 `str`이 `List`에 들어간 타입 매개변수 입니다.
+
+이는 "`items`은 `list`인데, 배열에 들어있는 아이템 각각은 `str`이다"라는 뜻입니다.
+
+이렇게 함으로써, 에디터는 배열에 들어있는 아이템을 처리할때도 도움을 줄 수 있게 됩니다:
+
+
+
+타입이 없으면 이건 거의 불가능이나 다름 없습니다.
+
+변수 `item`은 `items`의 개별 요소라는 사실을 알아두세요.
+
+그리고 에디터는 계속 `str`라는 사실을 알고 도와줍니다.
+
+#### `Tuple`과 `Set`
+
+`tuple`과 `set`도 동일하게 선언할 수 있습니다.
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial007.py!}
+```
+
+이 뜻은 아래와 같습니다:
+
+* 변수 `items_t`는, 차례대로 `int`, `int`, `str`인 `tuple`이다.
+* 변수 `items_s`는, 각 아이템이 `bytes`인 `set`이다.
+
+#### `Dict`
+
+`dict`를 선언하려면 컴마로 구분된 2개의 파라미터가 필요합니다.
+
+첫 번째 매개변수는 `dict`의 키(key)이고,
+
+두 번째 매개변수는 `dict`의 값(value)입니다.
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial008.py!}
+```
+
+이 뜻은 아래와 같습니다:
+
+* 변수 `prices`는 `dict`이다:
+ * `dict`의 키(key)는 `str`타입이다. (각 아이템의 이름(name))
+ * `dict`의 값(value)는 `float`타입이다. (각 아이템의 가격(price))
+
+#### `Optional`
+
+`str`과 같이 타입을 선언할 때 `Optional`을 쓸 수도 있는데, "선택적(Optional)"이기때문에 `None`도 될 수 있습니다:
+
+```Python hl_lines="1 4"
+{!../../../docs_src/python_types/tutorial009.py!}
+```
+
+`Optional[str]`을 `str` 대신 쓰게 되면, 특정 값이 실제로는 `None`이 될 수도 있는데 항상 `str`이라고 가정하는 상황에서 에디터가 에러를 찾게 도와줄 수 있습니다.
+
+#### Generic(제네릭) 타입
+
+이 타입은 대괄호 안에 매개변수를 가지며, 종류는:
+
+* `List`
+* `Tuple`
+* `Set`
+* `Dict`
+* `Optional`
+* ...등등
+
+위와 같은 타입은 **Generic(제네릭) 타입** 혹은 **Generics(제네릭스)**라고 불립니다.
+
+### 타입으로서의 클래스
+
+변수의 타입으로 클래스를 선언할 수도 있습니다.
+
+이름(name)을 가진 `Person` 클래스가 있다고 해봅시다.
+
+```Python hl_lines="1-3"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+그렇게 하면 변수를 `Person`이라고 선언할 수 있게 됩니다.
+
+```Python hl_lines="6"
+{!../../../docs_src/python_types/tutorial010.py!}
+```
+
+그리고 역시나 모든 에디터 도움을 받게 되겠죠.
+
+
+
+## Pydantic 모델
+
+Pydantic은 데이터 검증(Validation)을 위한 파이썬 라이브러리입니다.
+
+당신은 속성들을 포함한 클래스 형태로 "모양(shape)"을 선언할 수 있습니다.
+
+그리고 각 속성은 타입을 가지고 있습니다.
+
+이 클래스를 활용하여서 값을 가지고 있는 인스턴스를 만들게 되면, 필요한 경우에는 적당한 타입으로 변환까지 시키기도 하여 데이터가 포함된 객체를 반환합니다.
+
+그리고 결과 객체에 대해서는 에디터의 도움을 받을 수 있게 됩니다.
+
+Pydantic 공식 문서 예시:
+
+```Python
+{!../../../docs_src/python_types/tutorial011.py!}
+```
+
+!!! info "정보"
+ Pydantic<에 대해 더 배우고 싶다면 공식 문서를 참고하세요.
+
+
+**FastAPI**는 모두 Pydantic을 기반으로 되어 있습니다.
+
+이 모든 것이 실제로 어떻게 사용되는지에 대해서는 [자습서 - 사용자 안내서](tutorial/index.md){.internal-link target=_blank} 에서 더 많이 확인하실 수 있습니다.
+
+## **FastAPI**에서의 타입 힌트
+
+**FastAPI**는 여러 부분에서 타입 힌트의 장점을 취하고 있습니다.
+
+**FastAPI**에서 타입 힌트와 함께 매개변수를 선언하면 장점은:
+
+* **에디터 도움**.
+* **타입 확인**.
+
+...그리고 **FastAPI**는 같은 정의를 아래에도 적용합니다:
+
+* **요구사항 정의**: 요청 경로 매개변수, 쿼리 매개변수, 헤더, 바디, 의존성 등.
+* **데이터 변환**: 요청에서 요구한 타입으로.
+* **데이터 검증**: 각 요청마다:
+ * 데이터가 유효하지 않은 경우에는 **자동으로 에러**를 발생합니다.
+* OpenAPI를 활용한 **API 문서화**:
+ * 자동으로 상호작용하는 유저 인터페이스에 쓰이게 됩니다.
+
+위 내용이 다소 추상적일 수도 있지만, 걱정마세요. [자습서 - 사용자 안내서](tutorial/index.md){.internal-link target=_blank}에서 전부 확인 가능합니다.
+
+가장 중요한 건, 표준 파이썬 타입을 한 곳에서(클래스를 더하거나, 데코레이터 사용하는 대신) 사용함으로써 **FastAPI**가 당신을 위해 많은 일을 해준다는 사실이죠.
+
+!!! info "정보"
+ 만약 모든 자습서를 다 보았음에도 타입에 대해서 더 보고자 방문한 경우에는 `mypy`에서 제공하는 "cheat sheet"이 좋은 자료가 될 겁니다.
diff --git a/docs/ko/docs/tutorial/background-tasks.md b/docs/ko/docs/tutorial/background-tasks.md
new file mode 100644
index 000000000..ee83d6570
--- /dev/null
+++ b/docs/ko/docs/tutorial/background-tasks.md
@@ -0,0 +1,102 @@
+# 백그라운드 작업
+
+FastAPI에서는 응답을 반환한 후에 실행할 백그라운드 작업을 정의할 수 있습니다.
+
+백그라운드 작업은 클라이언트가 응답을 받기 위해 작업이 완료될 때까지 기다릴 필요가 없기 때문에 요청 후에 발생해야하는 작업에 매우 유용합니다.
+
+이러한 작업에는 다음이 포함됩니다.
+
+* 작업을 수행한 후 전송되는 이메일 알림
+ * 이메일 서버에 연결하고 이메일을 전송하는 것은 (몇 초 정도) "느린" 경향이 있으므로, 응답은 즉시 반환하고 이메일 알림은 백그라운드에서 전송하는 게 가능합니다.
+* 데이터 처리:
+ * 예를 들어 처리에 오랜 시간이 걸리는 데이터를 받았을 때 "Accepted" (HTTP 202)을 반환하고, 백그라운드에서 데이터를 처리할 수 있습니다.
+
+## `백그라운드 작업` 사용
+
+먼저 아래와 같이 `BackgroundTasks`를 임포트하고, `BackgroundTasks`를 _경로 작동 함수_ 에서 매개변수로 가져오고 정의합니다.
+
+```Python hl_lines="1 13"
+{!../../../docs_src/background_tasks/tutorial001.py!}
+```
+
+**FastAPI** 는 `BackgroundTasks` 개체를 생성하고, 매개 변수로 전달합니다.
+
+## 작업 함수 생성
+
+백그라운드 작업으로 실행할 함수를 정의합니다.
+
+이것은 단순히 매개변수를 받을 수 있는 표준 함수일 뿐입니다.
+
+**FastAPI**는 이것이 `async def` 함수이든, 일반 `def` 함수이든 내부적으로 이를 올바르게 처리합니다.
+
+이 경우, 아래 작업은 파일에 쓰는 함수입니다. (이메일 보내기 시물레이션)
+
+그리고 이 작업은 `async`와 `await`를 사용하지 않으므로 일반 `def` 함수로 선언합니다.
+
+```Python hl_lines="6-9"
+{!../../../docs_src/background_tasks/tutorial001.py!}
+```
+
+## 백그라운드 작업 추가
+
+_경로 작동 함수_ 내에서 작업 함수를 `.add_task()` 함수 통해 _백그라운드 작업_ 개체에 전달합니다.
+
+```Python hl_lines="14"
+{!../../../docs_src/background_tasks/tutorial001.py!}
+```
+
+`.add_task()` 함수는 다음과 같은 인자를 받습니다 :
+
+- 백그라운드에서 실행되는 작업 함수 (`write_notification`).
+- 작업 함수에 순서대로 전달되어야 하는 일련의 인자 (`email`).
+- 작업 함수에 전달되어야하는 모든 키워드 인자 (`message="some notification"`).
+
+## 의존성 주입
+
+`BackgroundTasks`를 의존성 주입 시스템과 함께 사용하면 _경로 작동 함수_, 종속성, 하위 종속성 등 여러 수준에서 BackgroundTasks 유형의 매개변수를 선언할 수 있습니다.
+
+**FastAPI**는 각 경우에 수행할 작업과 동일한 개체를 내부적으로 재사용하기에, 모든 백그라운드 작업이 함께 병합되고 나중에 백그라운드에서 실행됩니다.
+
+=== "Python 3.6 and above"
+
+ ```Python hl_lines="13 15 22 25"
+ {!> ../../../docs_src/background_tasks/tutorial002.py!}
+ ```
+
+=== "Python 3.10 and above"
+
+ ```Python hl_lines="11 13 20 23"
+ {!> ../../../docs_src/background_tasks/tutorial002_py310.py!}
+ ```
+
+이 예제에서는 응답이 반환된 후에 `log.txt` 파일에 메시지가 기록됩니다.
+
+요청에 쿼리가 있는 경우 백그라운드 작업의 로그에 기록됩니다.
+
+그리고 _경로 작동 함수_ 에서 생성된 또 다른 백그라운드 작업은 경로 매개 변수를 활용하여 사용하여 메시지를 작성합니다.
+
+## 기술적 세부사항
+
+`BackgroundTasks` 클래스는 `starlette.background`에서 직접 가져옵니다.
+
+`BackgroundTasks` 클래스는 FastAPI에서 직접 임포트하거나 포함하기 때문에 실수로 `BackgroundTask` (끝에 `s`가 없음)을 임포트하더라도 starlette.background에서 `BackgroundTask`를 가져오는 것을 방지할 수 있습니다.
+
+(`BackgroundTask`가 아닌) `BackgroundTasks`를 사용하면, _경로 작동 함수_ 매개변수로 사용할 수 있게 되고 나머지는 **FastAPI**가 대신 처리하도록 할 수 있습니다. 이것은 `Request` 객체를 직접 사용하는 것과 같은 방식입니다.
+
+FastAPI에서 `BackgroundTask`를 단독으로 사용하는 것은 여전히 가능합니다. 하지만 객체를 코드에서 생성하고, 이 객체를 포함하는 Starlette `Response`를 반환해야 합니다.
+
+`Starlette의 공식 문서`에서 백그라운드 작업에 대한 자세한 내용을 확인할 수 있습니다.
+
+## 경고
+
+만약 무거운 백그라운드 작업을 수행해야하고 동일한 프로세스에서 실행할 필요가 없는 경우 (예: 메모리, 변수 등을 공유할 필요가 없음) `Celery`와 같은 큰 도구를 사용하면 도움이 될 수 있습니다.
+
+RabbitMQ 또는 Redis와 같은 메시지/작업 큐 시스템 보다 복잡한 구성이 필요한 경향이 있지만, 여러 작업 프로세스를 특히 여러 서버의 백그라운드에서 실행할 수 있습니다.
+
+예제를 보시려면 [프로젝트 생성기](../project-generation.md){.internal-link target=\_blank} 를 참고하세요. 해당 예제에는 이미 구성된 `Celery`가 포함되어 있습니다.
+
+그러나 동일한 FastAPI 앱에서 변수 및 개체에 접근해야햐는 작은 백그라운드 수행이 필요한 경우 (예 : 알림 이메일 보내기) 간단하게 `BackgroundTasks`를 사용해보세요.
+
+## 요약
+
+백그라운드 작업을 추가하기 위해 _경로 작동 함수_ 에 매개변수로 `BackgroundTasks`를 가져오고 사용합니다.
diff --git a/docs/ko/docs/tutorial/body-fields.md b/docs/ko/docs/tutorial/body-fields.md
new file mode 100644
index 000000000..c91d6130b
--- /dev/null
+++ b/docs/ko/docs/tutorial/body-fields.md
@@ -0,0 +1,116 @@
+# 본문 - 필드
+
+`Query`, `Path`와 `Body`를 사용해 *경로 작동 함수* 매개변수 내에서 추가적인 검증이나 메타데이터를 선언한 것처럼 Pydantic의 `Field`를 사용하여 모델 내에서 검증과 메타데이터를 선언할 수 있습니다.
+
+## `Field` 임포트
+
+먼저 이를 임포트해야 합니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="2"
+ {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001.py!}
+ ```
+
+!!! warning "경고"
+ `Field`는 다른 것들처럼 (`Query`, `Path`, `Body` 등) `fastapi`에서가 아닌 `pydantic`에서 바로 임포트 되는 점에 주의하세요.
+
+## 모델 어트리뷰트 선언
+
+그 다음 모델 어트리뷰트와 함께 `Field`를 사용할 수 있습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12-15"
+ {!> ../../../docs_src/body_fields/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="9-12"
+ {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001.py!}
+ ```
+
+`Field`는 `Query`, `Path`와 `Body`와 같은 방식으로 동작하며, 모두 같은 매개변수들 등을 가집니다.
+
+!!! note "기술적 세부사항"
+ 실제로 `Query`, `Path`등, 여러분이 앞으로 볼 다른 것들은 공통 클래스인 `Param` 클래스의 서브클래스 객체를 만드는데, 그 자체로 Pydantic의 `FieldInfo` 클래스의 서브클래스입니다.
+
+ 그리고 Pydantic의 `Field` 또한 `FieldInfo`의 인스턴스를 반환합니다.
+
+ `Body` 또한 `FieldInfo`의 서브클래스 객체를 직접적으로 반환합니다. 그리고 `Body` 클래스의 서브클래스인 것들도 여러분이 나중에 보게될 것입니다.
+
+ `Query`, `Path`와 그 외 것들을 `fastapi`에서 임포트할 때, 이는 실제로 특별한 클래스를 반환하는 함수인 것을 기억해 주세요.
+
+!!! tip "팁"
+ 주목할 점은 타입, 기본 값 및 `Field`로 이루어진 각 모델 어트리뷰트가 `Path`, `Query`와 `Body`대신 `Field`를 사용하는 *경로 작동 함수*의 매개변수와 같은 구조를 가진다는 점 입니다.
+
+## 별도 정보 추가
+
+`Field`, `Query`, `Body`, 그 외 안에 별도 정보를 선언할 수 있습니다. 이는 생성된 JSON 스키마에 포함됩니다.
+
+여러분이 예제를 선언할 때 나중에 이 공식 문서에서 별도 정보를 추가하는 방법을 배울 것입니다.
+
+!!! warning "경고"
+ 별도 키가 전달된 `Field` 또한 여러분의 어플리케이션의 OpenAPI 스키마에 나타날 것입니다.
+ 이런 키가 OpenAPI 명세서, [the OpenAPI validator](https://validator.swagger.io/)같은 몇몇 OpenAPI 도구들에 포함되지 못할 수 있으며, 여러분이 생성한 스키마와 호환되지 않을 수 있습니다.
+
+## 요약
+
+모델 어트리뷰트를 위한 추가 검증과 메타데이터 선언하기 위해 Pydantic의 `Field` 를 사용할 수 있습니다.
+
+또한 추가적인 JSON 스키마 메타데이터를 전달하기 위한 별도의 키워드 인자를 사용할 수 있습니다.
diff --git a/docs/ko/docs/tutorial/body-multiple-params.md b/docs/ko/docs/tutorial/body-multiple-params.md
new file mode 100644
index 000000000..2cf5df7f3
--- /dev/null
+++ b/docs/ko/docs/tutorial/body-multiple-params.md
@@ -0,0 +1,170 @@
+# 본문 - 다중 매개변수
+
+지금부터 `Path`와 `Query`를 어떻게 사용하는지 확인하겠습니다.
+
+요청 본문 선언에 대한 심화 사용법을 알아보겠습니다.
+
+## `Path`, `Query` 및 본문 매개변수 혼합
+
+당연하게 `Path`, `Query` 및 요청 본문 매개변수 선언을 자유롭게 혼합해서 사용할 수 있고, **FastAPI**는 어떤 동작을 할지 압니다.
+
+또한, 기본 값을 `None`으로 설정해 본문 매개변수를 선택사항으로 선언할 수 있습니다.
+
+```Python hl_lines="19-21"
+{!../../../docs_src/body_multiple_params/tutorial001.py!}
+```
+
+!!! note "참고"
+ 이 경우에는 본문으로 부터 가져온 ` item`은 기본값이 `None`이기 때문에, 선택사항이라는 점을 유의해야 합니다.
+
+## 다중 본문 매개변수
+
+이전 예제에서 보듯이, *경로 작동*은 아래와 같이 `Item` 속성을 가진 JSON 본문을 예상합니다:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+}
+```
+
+하지만, 다중 본문 매개변수 역시 선언할 수 있습니다. 예. `item`과 `user`:
+
+```Python hl_lines="22"
+{!../../../docs_src/body_multiple_params/tutorial002.py!}
+```
+
+이 경우에, **FastAPI**는 이 함수 안에 한 개 이상의 본문 매개변수(Pydantic 모델인 두 매개변수)가 있다고 알 것입니다.
+
+그래서, 본문의 매개변수 이름을 키(필드 명)로 사용할 수 있고, 다음과 같은 본문을 예측합니다:
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ },
+ "user": {
+ "username": "dave",
+ "full_name": "Dave Grohl"
+ }
+}
+```
+
+!!! note "참고"
+ 이전과 같이 `item`이 선언 되었더라도, 본문 내의 `item` 키가 있을 것이라고 예측합니다.
+
+FastAPI는 요청을 자동으로 변환해, 매개변수의 `item`과 `user`를 특별한 내용으로 받도록 할 것입니다.
+
+복합 데이터의 검증을 수행하고 OpenAPI 스키마 및 자동 문서를 문서화합니다.
+
+## 본문 내의 단일 값
+
+쿼리 및 경로 매개변수에 대한 추가 데이터를 정의하는 `Query`와 `Path`와 같이, **FastAPI**는 동등한 `Body`를 제공합니다.
+
+예를 들어 이전의 모델을 확장하면, `item`과 `user`와 동일한 본문에 또 다른 `importance`라는 키를 갖도록 할 수있습니다.
+
+단일 값을 그대로 선언한다면, **FastAPI**는 쿼리 매개변수로 가정할 것입니다.
+
+하지만, **FastAPI**의 `Body`를 사용해 다른 본문 키로 처리하도록 제어할 수 있습니다:
+
+
+```Python hl_lines="23"
+{!../../../docs_src/body_multiple_params/tutorial003.py!}
+```
+
+이 경우에는 **FastAPI**는 본문을 이와 같이 예측할 것입니다:
+
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ },
+ "user": {
+ "username": "dave",
+ "full_name": "Dave Grohl"
+ },
+ "importance": 5
+}
+```
+
+다시 말해, 데이터 타입, 검증, 문서 등을 변환합니다.
+
+## 다중 본문 매개변수와 쿼리
+
+당연히, 필요할 때마다 추가적인 쿼리 매개변수를 선언할 수 있고, 이는 본문 매개변수에 추가됩니다.
+
+기본적으로 단일 값은 쿼리 매개변수로 해석되므로, 명시적으로 `Query`를 추가할 필요가 없고, 아래처럼 할 수 있습니다:
+
+```Python hl_lines="27"
+{!../../../docs_src/body_multiple_params/tutorial004.py!}
+```
+
+이렇게:
+
+```Python
+q: Optional[str] = None
+```
+
+!!! info "정보"
+ `Body` 또한 `Query`, `Path` 그리고 이후에 볼 다른 것들처럼 동일한 추가 검증과 메타데이터 매개변수를 갖고 있습니다.
+
+## 단일 본문 매개변수 삽입하기
+
+Pydantic 모델 `Item`의 `item`을 본문 매개변수로 오직 한개만 갖고있다고 하겠습니다.
+
+기본적으로 **FastAPI**는 직접 본문으로 예측할 것입니다.
+
+하지만, 만약 모델 내용에 `item `키를 가진 JSON으로 예측하길 원한다면, 추가적인 본문 매개변수를 선언한 것처럼 `Body`의 특별한 매개변수인 `embed`를 사용할 수 있습니다:
+
+```Python hl_lines="17"
+{!../../../docs_src/body_multiple_params/tutorial005.py!}
+```
+
+아래 처럼:
+
+```Python
+item: Item = Body(..., embed=True)
+```
+
+이 경우에 **FastAPI**는 본문을 아래 대신에:
+
+```JSON hl_lines="2"
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+}
+```
+
+아래 처럼 예측할 것 입니다:
+
+```JSON
+{
+ "item": {
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2
+ }
+}
+```
+
+## 정리
+
+요청이 단 한개의 본문을 가지고 있더라도, *경로 작동 함수*로 다중 본문 매개변수를 추가할 수 있습니다.
+
+하지만, **FastAPI**는 이를 처리하고, 함수에 올바른 데이터를 제공하며, *경로 작동*으로 올바른 스키마를 검증하고 문서화 합니다.
+
+또한, 단일 값을 본문의 일부로 받도록 선언할 수 있습니다.
+
+그리고 **FastAPI**는 단 한개의 매개변수가 선언 되더라도, 본문 내의 키로 삽입 시킬 수 있습니다.
diff --git a/docs/ko/docs/tutorial/body-nested-models.md b/docs/ko/docs/tutorial/body-nested-models.md
new file mode 100644
index 000000000..edf1a5f77
--- /dev/null
+++ b/docs/ko/docs/tutorial/body-nested-models.md
@@ -0,0 +1,243 @@
+# 본문 - 중첩 모델
+
+**FastAPI**를 이용하면 (Pydantic 덕분에) 단독으로 깊이 중첩된 모델을 정의, 검증, 문서화하며 사용할 수 있습니다.
+## 리스트 필드
+
+어트리뷰트를 서브타입으로 정의할 수 있습니다. 예를 들어 파이썬 `list`는:
+
+```Python hl_lines="14"
+{!../../../docs_src/body_nested_models/tutorial001.py!}
+```
+
+이는 `tags`를 항목 리스트로 만듭니다. 각 항목의 타입을 선언하지 않더라도요.
+
+## 타입 매개변수가 있는 리스트 필드
+
+하지만 파이썬은 내부의 타입이나 "타입 매개변수"를 선언할 수 있는 특정 방법이 있습니다:
+
+### typing의 `List` 임포트
+
+먼저, 파이썬 표준 `typing` 모듈에서 `List`를 임포트합니다:
+
+```Python hl_lines="1"
+{!../../../docs_src/body_nested_models/tutorial002.py!}
+```
+
+### 타입 매개변수로 `List` 선언
+
+`list`, `dict`, `tuple`과 같은 타입 매개변수(내부 타입)를 갖는 타입을 선언하려면:
+
+* `typing` 모듈에서 임포트
+* 대괄호를 사용하여 "타입 매개변수"로 내부 타입 전달: `[` 및 `]`
+
+```Python
+from typing import List
+
+my_list: List[str]
+```
+
+이 모든 것은 타입 선언을 위한 표준 파이썬 문법입니다.
+
+내부 타입을 갖는 모델 어트리뷰트에 대해 동일한 표준 문법을 사용하세요.
+
+마찬가지로 예제에서 `tags`를 구체적으로 "문자열의 리스트"로 만들 수 있습니다:
+
+```Python hl_lines="14"
+{!../../../docs_src/body_nested_models/tutorial002.py!}
+```
+
+## 집합 타입
+
+그런데 생각해보니 태그는 반복되면 안 돼고, 고유한(Unique) 문자열이어야 할 것 같습니다.
+
+그리고 파이썬은 집합을 위한 특별한 데이터 타입 `set`이 있습니다.
+
+그렇다면 `Set`을 임포트 하고 `tags`를 `str`의 `set`으로 선언할 수 있습니다:
+
+```Python hl_lines="1 14"
+{!../../../docs_src/body_nested_models/tutorial003.py!}
+```
+
+덕분에 중복 데이터가 있는 요청을 수신하더라도 고유한 항목들의 집합으로 변환됩니다.
+
+그리고 해당 데이터를 출력 할 때마다 소스에 중복이 있더라도 고유한 항목들의 집합으로 출력됩니다.
+
+또한 그에 따라 주석이 생기고 문서화됩니다.
+
+## 중첩 모델
+
+Pydantic 모델의 각 어트리뷰트는 타입을 갖습니다.
+
+그런데 해당 타입 자체로 또다른 Pydantic 모델의 타입이 될 수 있습니다.
+
+그러므로 특정한 어트리뷰트의 이름, 타입, 검증을 사용하여 깊게 중첩된 JSON "객체"를 선언할 수 있습니다.
+
+모든 것이 단독으로 중첩됩니다.
+
+### 서브모델 정의
+
+예를 들어, `Image` 모델을 선언할 수 있습니다:
+
+```Python hl_lines="9-11"
+{!../../../docs_src/body_nested_models/tutorial004.py!}
+```
+
+### 서브모듈을 타입으로 사용
+
+그리고 어트리뷰트의 타입으로 사용할 수 있습니다:
+
+```Python hl_lines="20"
+{!../../../docs_src/body_nested_models/tutorial004.py!}
+```
+
+이는 **FastAPI**가 다음과 유사한 본문을 기대한다는 것을 의미합니다:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2,
+ "tags": ["rock", "metal", "bar"],
+ "image": {
+ "url": "http://example.com/baz.jpg",
+ "name": "The Foo live"
+ }
+}
+```
+
+다시 한번, **FastAPI**를 사용하여 해당 선언을 함으로써 얻는 것은:
+
+* 중첩 모델도 편집기 지원(자동완성 등)
+* 데이터 변환
+* 데이터 검증
+* 자동 문서화
+
+## 특별한 타입과 검증
+
+`str`, `int`, `float` 등과 같은 단일 타입과는 별개로, `str`을 상속하는 더 복잡한 단일 타입을 사용할 수 있습니다.
+
+모든 옵션을 보려면, Pydantic's exotic types 문서를 확인하세요. 다음 장에서 몇가지 예제를 볼 수 있습니다.
+
+예를 들어 `Image` 모델 안에 `url` 필드를 `str` 대신 Pydantic의 `HttpUrl`로 선언할 수 있습니다:
+
+```Python hl_lines="4 10"
+{!../../../docs_src/body_nested_models/tutorial005.py!}
+```
+
+이 문자열이 유효한 URL인지 검사하고 JSON 스키마/OpenAPI로 문서화 됩니다.
+
+## 서브모델 리스트를 갖는 어트리뷰트
+
+`list`, `set` 등의 서브타입으로 Pydantic 모델을 사용할 수도 있습니다:
+
+```Python hl_lines="20"
+{!../../../docs_src/body_nested_models/tutorial006.py!}
+```
+
+아래와 같은 JSON 본문으로 예상(변환, 검증, 문서화 등을)합니다:
+
+```JSON hl_lines="11"
+{
+ "name": "Foo",
+ "description": "The pretender",
+ "price": 42.0,
+ "tax": 3.2,
+ "tags": [
+ "rock",
+ "metal",
+ "bar"
+ ],
+ "images": [
+ {
+ "url": "http://example.com/baz.jpg",
+ "name": "The Foo live"
+ },
+ {
+ "url": "http://example.com/dave.jpg",
+ "name": "The Baz"
+ }
+ ]
+}
+```
+
+!!! info "정보"
+ `images` 키가 어떻게 이미지 객체 리스트를 갖는지 주목하세요.
+
+## 깊게 중첩된 모델
+
+단독으로 깊게 중첩된 모델을 정의할 수 있습니다:
+
+```Python hl_lines="9 14 20 23 27"
+{!../../../docs_src/body_nested_models/tutorial007.py!}
+```
+
+!!! info "정보"
+ `Offer`가 선택사항 `Image` 리스트를 차례로 갖는 `Item` 리스트를 어떻게 가지고 있는지 주목하세요
+
+## 순수 리스트의 본문
+
+예상되는 JSON 본문의 최상위 값이 JSON `array`(파이썬 `list`)면, Pydantic 모델에서와 마찬가지로 함수의 매개변수에서 타입을 선언할 수 있습니다:
+
+```Python
+images: List[Image]
+```
+
+이를 아래처럼:
+
+```Python hl_lines="15"
+{!../../../docs_src/body_nested_models/tutorial008.py!}
+```
+
+## 어디서나 편집기 지원
+
+그리고 어디서나 편집기 지원을 받을수 있습니다.
+
+리스트 내부 항목의 경우에도:
+
+
+
+Pydantic 모델 대신에 `dict`를 직접 사용하여 작업할 경우, 이러한 편집기 지원을 받을수 없습니다.
+
+하지만 수신한 딕셔너리가 자동으로 변환되고 출력도 자동으로 JSON으로 변환되므로 걱정할 필요는 없습니다.
+
+## 단독 `dict`의 본문
+
+일부 타입의 키와 다른 타입의 값을 사용하여 `dict`로 본문을 선언할 수 있습니다.
+
+(Pydantic을 사용한 경우처럼) 유효한 필드/어트리뷰트 이름이 무엇인지 알 필요가 없습니다.
+
+아직 모르는 키를 받으려는 경우 유용합니다.
+
+---
+
+다른 유용한 경우는 다른 타입의 키를 가질 때입니다. 예. `int`.
+
+여기서 그 경우를 볼 것입니다.
+
+이 경우, `float` 값을 가진 `int` 키가 있는 모든 `dict`를 받아들입니다:
+
+```Python hl_lines="15"
+{!../../../docs_src/body_nested_models/tutorial009.py!}
+```
+
+!!! tip "팁"
+ JSON은 오직 `str`형 키만 지원한다는 것을 염두에 두세요.
+
+ 하지만 Pydantic은 자동 데이터 변환이 있습니다.
+
+ 즉, API 클라이언트가 문자열을 키로 보내더라도 해당 문자열이 순수한 정수를 포함하는한 Pydantic은 이를 변환하고 검증합니다.
+
+ 그러므로 `weights`로 받은 `dict`는 실제로 `int` 키와 `float` 값을 가집니다.
+
+## 요약
+
+**FastAPI**를 사용하면 Pydantic 모델이 제공하는 최대 유연성을 확보하면서 코드를 간단하고 짧게, 그리고 우아하게 유지할 수 있습니다.
+
+물론 아래의 이점도 있습니다:
+
+* 편집기 지원 (자동완성이 어디서나!)
+* 데이터 변환 (일명 파싱/직렬화)
+* 데이터 검증
+* 스키마 문서화
+* 자동 문서
diff --git a/docs/ko/docs/tutorial/body.md b/docs/ko/docs/tutorial/body.md
new file mode 100644
index 000000000..0ab8b7162
--- /dev/null
+++ b/docs/ko/docs/tutorial/body.md
@@ -0,0 +1,213 @@
+# 요청 본문
+
+클라이언트(브라우저라고 해봅시다)로부터 여러분의 API로 데이터를 보내야 할 때, **요청 본문**으로 보냅니다.
+
+**요청** 본문은 클라이언트에서 API로 보내지는 데이터입니다. **응답** 본문은 API가 클라이언트로 보내는 데이터입니다.
+
+여러분의 API는 대부분의 경우 **응답** 본문을 보내야 합니다. 하지만 클라이언트는 **요청** 본문을 매 번 보낼 필요가 없습니다.
+
+**요청** 본문을 선언하기 위해서 모든 강력함과 이점을 갖춘 Pydantic 모델을 사용합니다.
+
+!!! info "정보"
+ 데이터를 보내기 위해, (좀 더 보편적인) `POST`, `PUT`, `DELETE` 혹은 `PATCH` 중에 하나를 사용하는 것이 좋습니다.
+
+ `GET` 요청에 본문을 담아 보내는 것은 명세서에 정의되지 않은 행동입니다. 그럼에도 불구하고, 이 방식은 아주 복잡한/극한의 사용 상황에서만 FastAPI에 의해 지원됩니다.
+
+ `GET` 요청에 본문을 담는 것은 권장되지 않기에, Swagger UI같은 대화형 문서에서는 `GET` 사용시 담기는 본문에 대한 문서를 표시하지 않으며, 중간에 있는 프록시는 이를 지원하지 않을 수도 있습니다.
+
+## Pydantic의 `BaseModel` 임포트
+
+먼저 `pydantic`에서 `BaseModel`를 임포트해야 합니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="2"
+ {!> ../../../docs_src/body/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body/tutorial001.py!}
+ ```
+
+## 여러분의 데이터 모델 만들기
+
+`BaseModel`를 상속받은 클래스로 여러분의 데이터 모델을 선언합니다.
+
+모든 어트리뷰트에 대해 표준 파이썬 타입을 사용합니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="5-9"
+ {!> ../../../docs_src/body/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7-11"
+ {!> ../../../docs_src/body/tutorial001.py!}
+ ```
+
+쿼리 매개변수를 선언할 때와 같이, 모델 어트리뷰트가 기본 값을 가지고 있어도 이는 필수가 아닙니다. 그외에는 필수입니다. 그저 `None`을 사용하여 선택적으로 만들 수 있습니다.
+
+예를 들면, 위의 이 모델은 JSON "`object`" (혹은 파이썬 `dict`)을 다음과 같이 선언합니다:
+
+```JSON
+{
+ "name": "Foo",
+ "description": "선택적인 설명란",
+ "price": 45.2,
+ "tax": 3.5
+}
+```
+
+...`description`과 `tax`는 (기본 값이 `None`으로 되어 있어) 선택적이기 때문에, 이 JSON "`object`"는 다음과 같은 상황에서도 유효합니다:
+
+```JSON
+{
+ "name": "Foo",
+ "price": 45.2
+}
+```
+
+## 매개변수로서 선언하기
+
+여러분의 *경로 작동*에 추가하기 위해, 경로 매개변수 그리고 쿼리 매개변수에서 선언했던 것과 같은 방식으로 선언하면 됩니다.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/body/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body/tutorial001.py!}
+ ```
+
+...그리고 만들어낸 모델인 `Item`으로 타입을 선언합니다.
+
+## 결과
+
+위에서의 단순한 파이썬 타입 선언으로, **FastAPI**는 다음과 같이 동작합니다:
+
+* 요청의 본문을 JSON으로 읽어 들입니다.
+* (필요하다면) 대응되는 타입으로 변환합니다.
+* 데이터를 검증합니다.
+ * 만약 데이터가 유효하지 않다면, 정확히 어떤 것이 그리고 어디에서 데이터가 잘 못 되었는지 지시하는 친절하고 명료한 에러를 반환할 것입니다.
+* 매개변수 `item`에 포함된 수신 데이터를 제공합니다.
+ * 함수 내에서 매개변수를 `Item` 타입으로 선언했기 때문에, 모든 어트리뷰트와 그에 대한 타입에 대한 편집기 지원(완성 등)을 또한 받을 수 있습니다.
+* 여러분의 모델을 위한 JSON 스키마 정의를 생성합니다. 여러분의 프로젝트에 적합하다면 여러분이 사용하고 싶은 곳 어디에서나 사용할 수 있습니다.
+* 이러한 스키마는, 생성된 OpenAPI 스키마 일부가 될 것이며, 자동 문서화 UI에 사용됩니다.
+
+## 자동 문서화
+
+모델의 JSON 스키마는 생성된 OpenAPI 스키마에 포함되며 대화형 API 문서에 표시됩니다:
+
+
+
+이를 필요로 하는 각각의 *경로 작동*내부의 API 문서에도 사용됩니다:
+
+
+
+## 편집기 지원
+
+편집기에서, 함수 내에서 타입 힌트와 완성을 어디서나 (만약 Pydantic model 대신에 `dict`을 받을 경우 나타나지 않을 수 있습니다) 받을 수 있습니다:
+
+
+
+잘못된 타입 연산에 대한 에러 확인도 받을 수 있습니다:
+
+
+
+단순한 우연이 아닙니다. 프레임워크 전체가 이러한 디자인을 중심으로 설계되었습니다.
+
+그 어떤 실행 전에, 모든 편집기에서 작동할 수 있도록 보장하기 위해 설계 단계에서 혹독하게 테스트되었습니다.
+
+이를 지원하기 위해 Pydantic 자체에서 몇몇 변경점이 있었습니다.
+
+이전 스크린샷은 Visual Studio Code를 찍은 것입니다.
+
+하지만 똑같은 편집기 지원을 PyCharm에서 받을 수 있거나, 대부분의 다른 편집기에서도 받을 수 있습니다:
+
+
+
+!!! tip "팁"
+ 만약 PyCharm를 편집기로 사용한다면, Pydantic PyCharm Plugin을 사용할 수 있습니다.
+
+ 다음 사항을 포함해 Pydantic 모델에 대한 편집기 지원을 향상시킵니다:
+
+ * 자동 완성
+ * 타입 확인
+ * 리팩토링
+ * 검색
+ * 점검
+
+## 모델 사용하기
+
+함수 안에서 모델 객체의 모든 어트리뷰트에 직접 접근 가능합니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/body/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="21"
+ {!> ../../../docs_src/body/tutorial002.py!}
+ ```
+
+## 요청 본문 + 경로 매개변수
+
+경로 매개변수와 요청 본문을 동시에 선언할 수 있습니다.
+
+**FastAPI**는 경로 매개변수와 일치하는 함수 매개변수가 **경로에서 가져와야 한다**는 것을 인지하며, Pydantic 모델로 선언된 그 함수 매개변수는 **요청 본문에서 가져와야 한다**는 것을 인지할 것입니다.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="15-16"
+ {!> ../../../docs_src/body/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17-18"
+ {!> ../../../docs_src/body/tutorial003.py!}
+ ```
+
+## 요청 본문 + 경로 + 쿼리 매개변수
+
+**본문**, **경로** 그리고 **쿼리** 매개변수 모두 동시에 선언할 수도 있습니다.
+
+**FastAPI**는 각각을 인지하고 데이터를 옳바른 위치에 가져올 것입니다.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/body/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/body/tutorial004.py!}
+ ```
+
+함수 매개변수는 다음을 따라서 인지하게 됩니다:
+
+* 만약 매개변수가 **경로**에도 선언되어 있다면, 이는 경로 매개변수로 사용될 것입니다.
+* 만약 매개변수가 (`int`, `float`, `str`, `bool` 등과 같은) **유일한 타입**으로 되어있으면, **쿼리** 매개변수로 해석될 것입니다.
+* 만약 매개변수가 **Pydantic 모델** 타입으로 선언되어 있으면, 요청 **본문**으로 해석될 것입니다.
+
+!!! note "참고"
+ FastAPI는 `q`의 값이 필요없음을 알게 될 것입니다. 기본 값이 `= None`이기 때문입니다.
+
+ `Union[str, None]`에 있는 `Union`은 FastAPI에 의해 사용된 것이 아니지만, 편집기로 하여금 더 나은 지원과 에러 탐지를 지원할 것입니다.
+
+## Pydantic없이
+
+만약 Pydantic 모델을 사용하고 싶지 않다면, **Body** 매개변수를 사용할 수도 있습니다. [Body - 다중 매개변수: 본문에 있는 유일한 값](body-multiple-params.md#_2){.internal-link target=_blank} 문서를 확인하세요.
diff --git a/docs/ko/docs/tutorial/cookie-params.md b/docs/ko/docs/tutorial/cookie-params.md
new file mode 100644
index 000000000..d4f3d57a3
--- /dev/null
+++ b/docs/ko/docs/tutorial/cookie-params.md
@@ -0,0 +1,97 @@
+# 쿠키 매개변수
+
+쿠키 매개변수를 `Query`와 `Path` 매개변수들과 같은 방식으로 정의할 수 있습니다.
+
+## `Cookie` 임포트
+
+먼저 `Cookie`를 임포트합니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+## `Cookie` 매개변수 선언
+
+그런 다음, `Path`와 `Query`처럼 동일한 구조를 사용하는 쿠키 매개변수를 선언합니다.
+
+첫 번째 값은 기본값이며, 추가 검증이나 어노테이션 매개변수 모두 전달할 수 있습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/cookie_params/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/cookie_params/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/cookie_params/tutorial001.py!}
+ ```
+
+!!! note "기술 세부사항"
+ `Cookie`는 `Path` 및 `Query`의 "자매"클래스입니다. 이 역시 동일한 공통 `Param` 클래스를 상속합니다.
+
+ `Query`, `Path`, `Cookie` 그리고 다른 것들은 `fastapi`에서 임포트 할 때, 실제로는 특별한 클래스를 반환하는 함수임을 기억하세요.
+
+!!! info "정보"
+ 쿠키를 선언하기 위해서는 `Cookie`를 사용해야 합니다. 그렇지 않으면 해당 매개변수를 쿼리 매개변수로 해석하기 때문입니다.
+
+## 요약
+
+`Cookie`는 `Query`, `Path`와 동일한 패턴을 사용하여 선언합니다.
diff --git a/docs/ko/docs/tutorial/debugging.md b/docs/ko/docs/tutorial/debugging.md
new file mode 100644
index 000000000..c3e588537
--- /dev/null
+++ b/docs/ko/docs/tutorial/debugging.md
@@ -0,0 +1,112 @@
+# 디버깅
+
+예를 들면 Visual Studio Code 또는 PyCharm을 사용하여 편집기에서 디버거를 연결할 수 있습니다.
+
+## `uvicorn` 호출
+
+FastAPI 애플리케이션에서 `uvicorn`을 직접 임포트하여 실행합니다
+
+```Python hl_lines="1 15"
+{!../../../docs_src/debugging/tutorial001.py!}
+```
+
+### `__name__ == "__main__"` 에 대하여
+
+`__name__ == "__main__"`의 주요 목적은 다음과 같이 파일이 호출될 때 실행되는 일부 코드를 갖는 것입니다.
+
+
+
+---
+
+Pycharm을 사용하는 경우 다음을 수행할 수 있습니다
+
+* "Run" 메뉴를 엽니다
+* "Debug..." 옵션을 선택합니다.
+* 그러면 상황에 맞는 메뉴가 나타납니다.
+* 디버그할 파일을 선택합니다(이 경우 `main.py`).
+
+그런 다음 **FastAPI** 코드로 서버를 시작하고 중단점 등에서 중지합니다.
+
+다음과 같이 표시됩니다.
+
+
diff --git a/docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md b/docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
index bbf3a8283..38cdc2e1a 100644
--- a/docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
+++ b/docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
@@ -71,9 +71,9 @@ fluffy = Cat(name="Mr Fluffy")
FastAPI가 실질적으로 확인하는 것은 "호출 가능성"(함수, 클래스 또는 다른 모든 것)과 정의된 매개변수들입니다.
-"호출 가능"한 것을 의존성으로서 **FastAPI**에 전달하면, 그 "호출 가능"한 것의 매개변수들을 분석한 후 이를 *경로 동작 함수*를 위한 매개변수와 동일한 방식으로 처리합니다. 하위-의존성 또한 같은 방식으로 처리합니다.
+"호출 가능"한 것을 의존성으로서 **FastAPI**에 전달하면, 그 "호출 가능"한 것의 매개변수들을 분석한 후 이를 *경로 작동 함수*를 위한 매개변수와 동일한 방식으로 처리합니다. 하위-의존성 또한 같은 방식으로 처리합니다.
-매개변수가 없는 "호출 가능"한 것 역시 매개변수가 없는 *경로 동작 함수*와 동일한 방식으로 적용됩니다.
+매개변수가 없는 "호출 가능"한 것 역시 매개변수가 없는 *경로 작동 함수*와 동일한 방식으로 적용됩니다.
그래서, 우리는 위 예제에서의 `common_paramenters` 의존성을 클래스 `CommonQueryParams`로 바꿀 수 있습니다.
diff --git a/docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md b/docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
new file mode 100644
index 000000000..92b2c7d1c
--- /dev/null
+++ b/docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
@@ -0,0 +1,139 @@
+# 경로 작동 데코레이터에서의 의존성
+
+몇몇 경우에는, *경로 작동 함수* 안에서 의존성의 반환 값이 필요하지 않습니다.
+
+또는 의존성이 값을 반환하지 않습니다.
+
+그러나 여전히 실행/해결될 필요가 있습니다.
+
+그런 경우에, `Depends`를 사용하여 *경로 작동 함수*의 매개변수로 선언하는 것보다 *경로 작동 데코레이터*에 `dependencies`의 `list`를 추가할 수 있습니다.
+
+## *경로 작동 데코레이터*에 `dependencies` 추가하기
+
+*경로 작동 데코레이터*는 `dependencies`라는 선택적인 인자를 받습니다.
+
+`Depends()`로 된 `list`이어야합니다:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+이러한 의존성들은 기존 의존성들과 같은 방식으로 실행/해결됩니다. 그러나 값은 (무엇이든 반환한다면) *경로 작동 함수*에 제공되지 않습니다.
+
+!!! tip "팁"
+ 일부 편집기에서는 사용되지 않는 함수 매개변수를 검사하고 오류로 표시합니다.
+
+ *경로 작동 데코레이터*에서 `dependencies`를 사용하면 편집기/도구 오류를 피하며 실행되도록 할 수 있습니다.
+
+ 또한 코드에서 사용되지 않는 매개변수를 보고 불필요하다고 생각할 수 있는 새로운 개발자의 혼란을 방지하는데 도움이 될 수 있습니다.
+
+!!! info "정보"
+ 이 예시에서 `X-Key`와 `X-Token`이라는 커스텀 헤더를 만들어 사용했습니다.
+
+ 그러나 실제로 보안을 구현할 때는 통합된 [보안 유틸리티 (다음 챕터)](../security/index.md){.internal-link target=_blank}를 사용하는 것이 더 많은 이점을 얻을 수 있습니다.
+
+## 의존성 오류와 값 반환하기
+
+평소에 사용하던대로 같은 의존성 *함수*를 사용할 수 있습니다.
+
+### 의존성 요구사항
+
+(헤더같은) 요청 요구사항이나 하위-의존성을 선언할 수 있습니다:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7 12"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="6 11"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+### 오류 발생시키기
+
+다음 의존성은 기존 의존성과 동일하게 예외를 `raise`를 일으킬 수 있습니다:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 14"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+### 값 반환하기
+
+값을 반환하거나, 그러지 않을 수 있으며 값은 사용되지 않습니다.
+
+그래서 이미 다른 곳에서 사용된 (값을 반환하는) 일반적인 의존성을 재사용할 수 있고, 비록 값은 사용되지 않지만 의존성은 실행될 것입니다:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="9 14"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+## *경로 작동* 모음에 대한 의존성
+
+나중에 여러 파일을 가지고 있을 수 있는 더 큰 애플리케이션을 구조화하는 법([더 큰 애플리케이션 - 여러 파일들](../../tutorial/bigger-applications.md){.internal-link target=_blank})을 읽을 때, *경로 작동* 모음에 대한 단일 `dependencies` 매개변수를 선언하는 법에 대해서 배우게 될 것입니다.
+
+## 전역 의존성
+
+다음으로 각 *경로 작동*에 적용되도록 `FastAPI` 애플리케이션 전체에 의존성을 추가하는 법을 볼 것입니다.
diff --git a/docs/ko/docs/tutorial/dependencies/global-dependencies.md b/docs/ko/docs/tutorial/dependencies/global-dependencies.md
new file mode 100644
index 000000000..930f6e678
--- /dev/null
+++ b/docs/ko/docs/tutorial/dependencies/global-dependencies.md
@@ -0,0 +1,34 @@
+# 전역 의존성
+
+몇몇 애플리케이션에서는 애플리케이션 전체에 의존성을 추가하고 싶을 수 있습니다.
+
+[*경로 작동 데코레이터*에 `dependencies` 추가하기](dependencies-in-path-operation-decorators.md){.internal-link target=_blank}와 유사한 방법으로 `FastAPI` 애플리케이션에 그것들을 추가할 수 있습니다.
+
+그런 경우에, 애플리케이션의 모든 *경로 작동*에 적용될 것입니다:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/dependencies/tutorial012_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="16"
+ {!> ../../../docs_src/dependencies/tutorial012_an.py!}
+ ```
+
+=== "Python 3.8 Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="15"
+ {!> ../../../docs_src/dependencies/tutorial012.py!}
+ ```
+
+그리고 [*경로 작동 데코레이터*에 `dependencies` 추가하기](dependencies-in-path-operation-decorators.md){.internal-link target=_blank}에 대한 아이디어는 여전히 적용되지만 여기에서는 앱에 있는 모든 *경로 작동*에 적용됩니다.
+
+## *경로 작동* 모음에 대한 의존성
+
+이후에 여러 파일들을 가지는 더 큰 애플리케이션을 구조화하는 법([더 큰 애플리케이션 - 여러 파일들](../../tutorial/bigger-applications.md){.internal-link target=_blank})을 읽을 때, *경로 작동* 모음에 대한 단일 `dependencies` 매개변수를 선언하는 법에 대해서 배우게 될 것입니다.
diff --git a/docs/ko/docs/tutorial/dependencies/index.md b/docs/ko/docs/tutorial/dependencies/index.md
new file mode 100644
index 000000000..d06864ab8
--- /dev/null
+++ b/docs/ko/docs/tutorial/dependencies/index.md
@@ -0,0 +1,353 @@
+# 의존성
+
+**FastAPI**는 아주 강력하지만 직관적인 **의존성 주입** 시스템을 가지고 있습니다.
+
+이는 사용하기 아주 쉽게 설계했으며, 어느 개발자나 다른 컴포넌트와 **FastAPI**를 쉽게 통합할 수 있도록 만들었습니다.
+
+## "의존성 주입"은 무엇입니까?
+
+**"의존성 주입"**은 프로그래밍에서 여러분의 코드(이 경우, 경로 작동 함수)가 작동하고 사용하는 데 필요로 하는 것, 즉 "의존성"을 선언할 수 있는 방법을 의미합니다.
+
+그 후에, 시스템(이 경우 FastAPI)은 여러분의 코드가 요구하는 의존성을 제공하기 위해 필요한 모든 작업을 처리합니다.(의존성을 "주입"합니다)
+
+이는 여러분이 다음과 같은 사항을 필요로 할 때 매우 유용합니다:
+
+* 공용된 로직을 가졌을 경우 (같은 코드 로직이 계속 반복되는 경우).
+* 데이터베이스 연결을 공유하는 경우.
+* 보안, 인증, 역할 요구 사항 등을 강제하는 경우.
+* 그리고 많은 다른 사항...
+
+이 모든 사항을 할 때 코드 반복을 최소화합니다.
+
+## 첫번째 단계
+
+아주 간단한 예제를 봅시다. 너무 간단할 것이기에 지금 당장은 유용하지 않을 수 있습니다.
+
+하지만 이를 통해 **의존성 주입** 시스템이 어떻게 작동하는지에 중점을 둘 것입니다.
+
+### 의존성 혹은 "디펜더블" 만들기
+
+의존성에 집중해 봅시다.
+
+*경로 작동 함수*가 가질 수 있는 모든 매개변수를 갖는 단순한 함수입니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8-9"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8-11"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-12"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="6-7"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="8-11"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+이게 다입니다.
+
+**단 두 줄입니다**.
+
+그리고, 이 함수는 여러분의 모든 *경로 작동 함수*가 가지고 있는 것과 같은 형태와 구조를 가지고 있습니다.
+
+여러분은 이를 "데코레이터"가 없는 (`@app.get("/some-path")`가 없는) *경로 작동 함수*라고 생각할 수 있습니다.
+
+그리고 여러분이 원하는 무엇이든 반환할 수 있습니다.
+
+이 경우, 이 의존성은 다음과 같은 경우를 기대합니다:
+
+* 선택적인 쿼리 매개변수 `q`, `str`을 자료형으로 가집니다.
+* 선택적인 쿼리 매개변수 `skip`, `int`를 자료형으로 가지며 기본 값은 `0`입니다.
+* 선택적인 쿼리 매개변수 `limit`,`int`를 자료형으로 가지며 기본 값은 `100`입니다.
+
+그 후 위의 값을 포함한 `dict` 자료형으로 반환할 뿐입니다.
+
+!!! info "정보"
+ FastAPI는 0.95.0 버전부터 `Annotated`에 대한 지원을 (그리고 이를 사용하기 권장합니다) 추가했습니다.
+
+ 옛날 버전을 가지고 있는 경우, `Annotated`를 사용하려 하면 에러를 맞이하게 될 것입니다.
+
+ `Annotated`를 사용하기 전에 최소 0.95.1로 [FastAPI 버전 업그레이드](../../deployment/versions.md#fastapi_2){.internal-link target=_blank}를 확실하게 하세요.
+
+### `Depends` 불러오기
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+### "의존자"에 의존성 명시하기
+
+*경로 작동 함수*의 매개변수로 `Body`, `Query` 등을 사용하는 방식과 같이 새로운 매개변수로 `Depends`를 사용합니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="13 18"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="15 20"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="16 21"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="15 20"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+비록 `Body`, `Query` 등을 사용하는 것과 같은 방식으로 여러분의 함수의 매개변수에 있는 `Depends`를 사용하지만, `Depends`는 약간 다르게 작동합니다.
+
+`Depends`에 단일 매개변수만 전달했습니다.
+
+이 매개변수는 함수같은 것이어야 합니다.
+
+여러분은 직접 **호출하지 않았습니다** (끝에 괄호를 치지 않았습니다), 단지 `Depends()`에 매개변수로 넘겨 줬을 뿐입니다.
+
+그리고 그 함수는 *경로 작동 함수*가 작동하는 것과 같은 방식으로 매개변수를 받습니다.
+
+!!! tip "팁"
+ 여러분은 다음 장에서 함수를 제외하고서, "다른 것들"이 어떻게 의존성으로 사용되는지 알게 될 것입니다.
+
+새로운 요청이 도착할 때마다, **FastAPI**는 다음을 처리합니다:
+
+* 올바른 매개변수를 가진 의존성("디펜더블") 함수를 호출합니다.
+* 함수에서 결과를 받아옵니다.
+* *경로 작동 함수*에 있는 매개변수에 그 결과를 할당합니다
+
+```mermaid
+graph TB
+
+common_parameters(["common_parameters"])
+read_items["/items/"]
+read_users["/users/"]
+
+common_parameters --> read_items
+common_parameters --> read_users
+```
+
+이렇게 하면 공용 코드를 한번만 적어도 되며, **FastAPI**는 *경로 작동*을 위해 이에 대한 호출을 처리합니다.
+
+!!! check "확인"
+ 특별한 클래스를 만들지 않아도 되며, 이러한 것 혹은 비슷한 종류를 **FastAPI**에 "등록"하기 위해 어떤 곳에 넘겨주지 않아도 됩니다.
+
+ 단순히 `Depends`에 넘겨주기만 하면 되며, **FastAPI**는 나머지를 어찌할지 알고 있습니다.
+
+## `Annotated`인 의존성 공유하기
+
+위의 예제에서 몇몇 작은 **코드 중복**이 있다는 것을 보았을 겁니다.
+
+`common_parameters()`의존을 사용해야 한다면, 타입 명시와 `Depends()`와 함께 전체 매개변수를 적어야 합니다:
+
+```Python
+commons: Annotated[dict, Depends(common_parameters)]
+```
+
+하지만 `Annotated`를 사용하고 있기에, `Annotated` 값을 변수에 저장하고 여러 장소에서 사용할 수 있습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12 16 21"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14 18 23"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="15 19 24"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an.py!}
+ ```
+
+!!! tip "팁"
+ 이는 그저 표준 파이썬이고 "type alias"라고 부르며 사실 **FastAPI**에 국한되는 것은 아닙니다.
+
+ 하지만, `Annotated`를 포함하여, **FastAPI**가 파이썬 표준을 기반으로 하고 있기에, 이를 여러분의 코드 트릭으로 사용할 수 있습니다. 😎
+
+이 의존성은 계속해서 예상한대로 작동할 것이며, **제일 좋은 부분**은 **타입 정보가 보존된다는 것입니다**. 즉 여러분의 편집기가 **자동 완성**, **인라인 에러** 등을 계속해서 제공할 수 있다는 것입니다. `mypy`같은 다른 도구도 마찬가지입니다.
+
+이는 특히 **많은 *경로 작동***에서 **같은 의존성**을 계속해서 사용하는 **거대 코드 기반**안에서 사용하면 유용할 것입니다.
+
+## `async`하게, 혹은 `async`하지 않게
+
+의존성이 (*경로 작동 함수*에서 처럼 똑같이) **FastAPI**에 의해 호출될 수 있으며, 함수를 정의할 때 동일한 규칙이 적용됩니다.
+
+`async def`을 사용하거나 혹은 일반적인 `def`를 사용할 수 있습니다.
+
+그리고 일반적인 `def` *경로 작동 함수* 안에 `async def`로 의존성을 선언할 수 있으며, `async def` *경로 작동 함수* 안에 `def`로 의존성을 선언하는 등의 방법이 있습니다.
+
+아무 문제 없습니다. **FastAPI**는 무엇을 할지 알고 있습니다.
+
+!!! note "참고"
+ 잘 모르시겠다면, [Async: *"In a hurry?"*](../../async.md){.internal-link target=_blank} 문서에서 `async`와 `await`에 대해 확인할 수 있습니다.
+
+## OpenAPI와 통합
+
+모든 요청 선언, 검증과 의존성(및 하위 의존성)에 대한 요구 사항은 동일한 OpenAPI 스키마에 통합됩니다.
+
+따라서 대화형 문서에 이러한 의존성에 대한 모든 정보 역시 포함하고 있습니다:
+
+
+
+## 간단한 사용법
+
+이를 보면, *경로 작동 함수*는 *경로*와 *작동*이 매칭되면 언제든지 사용되도록 정의되었으며, **FastAPI**는 올바른 매개변수를 가진 함수를 호출하고 해당 요청에서 데이터를 추출합니다.
+
+사실, 모든 (혹은 대부분의) 웹 프레임워크는 이와 같은 방식으로 작동합니다.
+
+여러분은 이러한 함수들을 절대 직접 호출하지 않습니다. 프레임워크(이 경우 **FastAPI**)에 의해 호출됩니다.
+
+의존성 주입 시스템과 함께라면 **FastAPI**에게 여러분의 *경로 작동 함수*가 실행되기 전에 실행되어야 하는 무언가에 여러분의 *경로 작동 함수* 또한 "의존"하고 있음을 알릴 수 있으며, **FastAPI**는 이를 실행하고 결과를 "주입"할 것입니다.
+
+"의존성 주입"이라는 동일한 아이디어에 대한 다른 일반적인 용어는 다음과 같습니다:
+
+* 리소스
+* 제공자
+* 서비스
+* 인젝터블
+* 컴포넌트
+
+## **FastAPI** 플러그인
+
+통합과 "플러그인"은 **의존성 주입** 시스템을 사용하여 구축할 수 있습니다. 하지만 실제로 **"플러그인"을 만들 필요는 없습니다**, 왜냐하면 의존성을 사용함으로써 여러분의 *경로 작동 함수*에 통합과 상호 작용을 무한대로 선언할 수 있기 때문입니다.
+
+그리고 "말 그대로", 그저 필요로 하는 파이썬 패키지를 임포트하고 단 몇 줄의 코드로 여러분의 API 함수와 통합함으로써, 의존성을 아주 간단하고 직관적인 방법으로 만들 수 있습니다.
+
+관계형 및 NoSQL 데이터베이스, 보안 등, 이에 대한 예시를 다음 장에서 볼 수 있습니다.
+
+## **FastAPI** 호환성
+
+의존성 주입 시스템의 단순함은 **FastAPI**를 다음과 같은 요소들과 호환할 수 있게 합니다:
+
+* 모든 관계형 데이터베이스
+* NoSQL 데이터베이스
+* 외부 패키지
+* 외부 API
+* 인증 및 권한 부여 시스템
+* API 사용 모니터링 시스템
+* 응답 데이터 주입 시스템
+* 기타 등등.
+
+## 간편하고 강력하다
+
+계층적인 의존성 주입 시스템은 정의하고 사용하기 쉽지만, 여전히 매우 강력합니다.
+
+여러분은 스스로를 의존하는 의존성을 정의할 수 있습니다.
+
+끝에는, 계층적인 나무로 된 의존성이 만들어지며, 그리고 **의존성 주입** 시스템은 (하위 의존성도 마찬가지로) 이러한 의존성들을 처리하고 각 단계마다 결과를 제공합니다(주입합니다).
+
+예를 들면, 여러분이 4개의 API 엔드포인트(*경로 작동*)를 가지고 있다고 해봅시다:
+
+* `/items/public/`
+* `/items/private/`
+* `/users/{user_id}/activate`
+* `/items/pro/`
+
+그 다음 각각에 대해 그저 의존성과 하위 의존성을 사용하여 다른 권한 요구 사항을 추가할 수 있을 겁니다:
+
+```mermaid
+graph TB
+
+current_user(["current_user"])
+active_user(["active_user"])
+admin_user(["admin_user"])
+paying_user(["paying_user"])
+
+public["/items/public/"]
+private["/items/private/"]
+activate_user["/users/{user_id}/activate"]
+pro_items["/items/pro/"]
+
+current_user --> active_user
+active_user --> admin_user
+active_user --> paying_user
+
+current_user --> public
+active_user --> private
+admin_user --> activate_user
+paying_user --> pro_items
+```
+
+## **OpenAPI**와의 통합
+
+이 모든 의존성은 각각의 요구사항을 선언하는 동시에, *경로 작동*에 매개변수, 검증 등을 추가합니다.
+
+**FastAPI**는 이 모든 것을 OpenAPI 스키마에 추가할 것이며, 이를 통해 대화형 문서 시스템에 나타날 것입니다.
diff --git a/docs/ko/docs/tutorial/first-steps.md b/docs/ko/docs/tutorial/first-steps.md
index a669cb2ba..bdec3a377 100644
--- a/docs/ko/docs/tutorial/first-steps.md
+++ b/docs/ko/docs/tutorial/first-steps.md
@@ -1,12 +1,12 @@
# 첫걸음
-가장 단순한 FastAPI 파일은 다음과 같이 보일 겁니다:
+가장 단순한 FastAPI 파일은 다음과 같이 보일 것입니다:
```Python
{!../../../docs_src/first_steps/tutorial001.py!}
```
-위를 `main.py`에 복사합니다.
+위 코드를 `main.py`에 복사합니다.
라이브 서버를 실행합니다:
@@ -29,9 +29,9 @@ $ uvicorn main:app --reload
* `main`: 파일 `main.py` (파이썬 "모듈").
* `app`: `main.py` 내부의 `app = FastAPI()` 줄에서 생성한 오브젝트.
- * `--reload`: 코드 변경 후 서버 재시작. 개발에만 사용.
+ * `--reload`: 코드 변경 시 자동으로 서버 재시작. 개발 시에만 사용.
-출력에 아래와 같은 줄이 있습니다:
+출력되는 줄들 중에는 아래와 같은 내용이 있습니다:
```hl_lines="4"
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
@@ -75,7 +75,7 @@ INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
#### API "스키마"
-이 경우, OpenAPI는 API의 스키마를 어떻게 정의하는지 지시하는 규격입니다.
+OpenAPI는 API의 스키마를 어떻게 정의하는지 지시하는 규격입니다.
이 스키마 정의는 API 경로, 가능한 매개변수 등을 포함합니다.
@@ -87,13 +87,13 @@ INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
#### OpenAPI와 JSON 스키마
-OpenAPI는 API에 대한 API 스키마를 정의합니다. 또한 이 스키마에는 JSON 데이터 스키마의 표준인 **JSON 스키마**를 사용하여 API에서 보내고 받은 데이터의 정의(또는 "스키마")를 포함합니다.
+OpenAPI는 당신의 API에 대한 API 스키마를 정의합니다. 또한 이 스키마는 JSON 데이터 스키마의 표준인 **JSON 스키마**를 사용하여 당신의 API가 보내고 받는 데이터의 정의(또는 "스키마")를 포함합니다.
#### `openapi.json` 확인
-가공되지 않은 OpenAPI 스키마가 어떻게 생겼는지 궁금하다면, FastAPI는 자동으로 API의 설명과 함께 JSON (스키마)를 생성합니다.
+FastAPI는 자동으로 API의 설명과 함께 JSON (스키마)를 생성합니다.
-여기에서 직접 볼 수 있습니다: http://127.0.0.1:8000/openapi.json.
+가공되지 않은 OpenAPI 스키마가 어떻게 생겼는지 궁금하다면, 여기에서 직접 볼 수 있습니다: http://127.0.0.1:8000/openapi.json.
다음과 같이 시작하는 JSON을 확인할 수 있습니다:
@@ -124,7 +124,7 @@ OpenAPI 스키마는 포함된 두 개의 대화형 문서 시스템을 제공
그리고 OpenAPI의 모든 것을 기반으로 하는 수십 가지 대안이 있습니다. **FastAPI**로 빌드한 애플리케이션에 이러한 대안을 쉽게 추가 할 수 있습니다.
-API와 통신하는 클라이언트를 위해 코드를 자동으로 생성하는 데도 사용할 수 있습니다. 예로 프론트엔드, 모바일, IoT 애플리케이션이 있습니다.
+API와 통신하는 클라이언트(프론트엔드, 모바일, IoT 애플리케이션 등)를 위해 코드를 자동으로 생성하는 데도 사용할 수 있습니다.
## 단계별 요약
@@ -134,7 +134,7 @@ API와 통신하는 클라이언트를 위해 코드를 자동으로 생성하
{!../../../docs_src/first_steps/tutorial001.py!}
```
-`FastAPI`는 API에 대한 모든 기능을 제공하는 파이썬 클래스입니다.
+`FastAPI`는 당신의 API를 위한 모든 기능을 제공하는 파이썬 클래스입니다.
!!! note "기술 세부사항"
`FastAPI`는 `Starlette`를 직접 상속하는 클래스입니다.
@@ -147,11 +147,11 @@ API와 통신하는 클라이언트를 위해 코드를 자동으로 생성하
{!../../../docs_src/first_steps/tutorial001.py!}
```
-여기 있는 `app` 변수는 `FastAPI` 클래스의 "인스턴스"가 됩니다.
+여기에서 `app` 변수는 `FastAPI` 클래스의 "인스턴스"가 됩니다.
-이것은 모든 API를 생성하기 위한 상호작용의 주요 지점이 될 것입니다.
+이것은 당신의 모든 API를 생성하기 위한 상호작용의 주요 지점이 될 것입니다.
-이 `app`은 다음 명령에서 `uvicorn`이 참조하고 것과 동일합니다:
+이 `app`은 다음 명령에서 `uvicorn`이 참조하고 있는 것과 동일합니다:
get 동작 사용
+* get 작동 사용
!!! info "`@decorator` 정보"
이 `@something` 문법은 파이썬에서 "데코레이터"라 부릅니다.
- 함수 맨 위에 놓습니다. 마치 예쁜 장식용(Decorative) 모자처럼(개인적으로 이 용어가 여기서 유래한거 같습니다).
+ 마치 예쁜 장식용(Decorative) 모자처럼(개인적으로 이 용어가 여기서 유래한 것 같습니다) 함수 맨 위에 놓습니다.
- "데코레이터" 아래 있는 함수를 받고 그걸 이용해 무언가 합니다.
+ "데코레이터"는 아래 있는 함수를 받아 그것으로 무언가를 합니다.
- 우리의 경우, 이 데코레이터는 **FastAPI**에게 아래 함수가 **경로** `/`에 해당하는 `get` **동작**하라고 알려줍니다.
+ 우리의 경우, 이 데코레이터는 **FastAPI**에게 아래 함수가 **경로** `/`의 `get` **작동**에 해당한다고 알려줍니다.
- 이것이 "**경로 동작 데코레이터**"입니다.
+ 이것이 "**경로 작동 데코레이터**"입니다.
-다른 동작도 쓸 수 있습니다:
+다른 작동도 사용할 수 있습니다:
* `@app.post()`
* `@app.put()`
* `@app.delete()`
-이국적인 것들도 있습니다:
+흔히 사용되지 않는 것들도 있습니다:
* `@app.options()`
* `@app.head()`
@@ -275,20 +275,20 @@ API를 빌드하는 동안 일반적으로 특정 행동을 수행하기 위해
* `@app.trace()`
!!! tip "팁"
- 각 동작(HTTP 메소드)을 원하는 대로 사용해도 됩니다.
+ 각 작동(HTTP 메소드)을 원하는 대로 사용해도 됩니다.
**FastAPI**는 특정 의미를 강제하지 않습니다.
- 여기서 정보는 지침서일뿐 요구사항이 아닙니다.
+ 여기서 정보는 지침서일뿐 강제사항이 아닙니다.
- 예를 들어 GraphQL을 사용할때 일반적으로 `POST` 동작만 사용하여 모든 행동을 수행합니다.
+ 예를 들어 GraphQL을 사용하는 경우, 일반적으로 `POST` 작동만 사용하여 모든 행동을 수행합니다.
-### 4 단계: **경로 동작 함수** 정의
+### 4 단계: **경로 작동 함수** 정의
-다음은 우리의 "**경로 동작 함수**"입니다:
+다음은 우리의 "**경로 작동 함수**"입니다:
* **경로**: 는 `/`입니다.
-* **동작**: 은 `get`입니다.
+* **작동**: 은 `get`입니다.
* **함수**: 는 "데코레이터" 아래에 있는 함수입니다 (`@app.get("/")` 아래).
```Python hl_lines="7"
@@ -297,20 +297,20 @@ API를 빌드하는 동안 일반적으로 특정 행동을 수행하기 위해
이것은 파이썬 함수입니다.
-`GET` 동작을 사용하여 URL "`/`"에 대한 요청을 받을 때마다 **FastAPI**에 의해 호출됩니다.
+URL "`/`"에 대한 `GET` 작동을 사용하는 요청을 받을 때마다 **FastAPI**에 의해 호출됩니다.
-위의 경우 `async` 함수입니다.
+위의 예시에서 이 함수는 `async`(비동기) 함수입니다.
---
-`async def` 대신 일반 함수로 정의할 수 있습니다:
+`async def`을 이용하는 대신 일반 함수로 정의할 수 있습니다:
```Python hl_lines="7"
{!../../../docs_src/first_steps/tutorial003.py!}
```
-!!! note 참고
- 차이점을 모르겠다면 [Async: *"In a hurry?"*](../async.md#in-a-hurry){.internal-link target=_blank}을 확인하세요.
+!!! note "참고"
+ 차이점을 모르겠다면 [Async: *"바쁘신 경우"*](../async.md#_1){.internal-link target=_blank}을 확인하세요.
### 5 단계: 콘텐츠 반환
@@ -322,12 +322,12 @@ API를 빌드하는 동안 일반적으로 특정 행동을 수행하기 위해
Pydantic 모델을 반환할 수도 있습니다(나중에 더 자세히 살펴봅니다).
-JSON으로 자동 변환되는 객체들과 모델들이 많이 있습니다(ORM 등을 포함해서요). 가장 마음에 드는 것을 사용하세요, 이미 지원되고 있을 겁니다.
+JSON으로 자동 변환되는 객체들과 모델들(ORM 등을 포함해서)이 많이 있습니다. 가장 마음에 드는 것을 사용하십시오, 이미 지원되고 있을 것입니다.
## 요약
* `FastAPI` 임포트.
* `app` 인스턴스 생성.
-* (`@app.get("/")`처럼) **경로 동작 데코레이터** 작성.
-* (위에 있는 `def root(): ...`처럼) **경로 동작 함수** 작성.
+* (`@app.get("/")`처럼) **경로 작동 데코레이터** 작성.
+* (위에 있는 `def root(): ...`처럼) **경로 작동 함수** 작성.
* (`uvicorn main:app --reload`처럼) 개발 서버 실행.
diff --git a/docs/ko/docs/tutorial/index.md b/docs/ko/docs/tutorial/index.md
index deb5ca8f2..94d6dfb92 100644
--- a/docs/ko/docs/tutorial/index.md
+++ b/docs/ko/docs/tutorial/index.md
@@ -1,16 +1,16 @@
# 자습서 - 사용자 안내서
-이 자습서는 **FastAPI**의 대부분의 기능을 단계별로 사용하는 방법을 보여줍니다.
+이 자습서는 단계별로 **FastAPI**의 대부분의 기능에 대해 설명합니다.
-각 섹션은 이전 섹션을 기반해서 점진적으로 만들어 졌지만, 주제에 따라 다르게 구성되었기 때문에 특정 API 요구사항을 해결하기 위해서라면 어느 특정 항목으로던지 직접 이동할 수 있습니다.
+각 섹션은 이전 섹션에 기반하는 순차적인 구조로 작성되었지만, 각 주제로 구분되어 있기 때문에 필요에 따라 특정 섹션으로 바로 이동하여 필요한 내용을 바로 확인할 수 있습니다.
-또한 향후 참조가 될 수 있도록 만들어졌습니다.
+또한 향후에도 참조 자료로 쓰일 수 있도록 작성되었습니다.
-그러므로 다시 돌아와서 정확히 필요한 것을 확인할 수 있습니다.
+그러므로 필요할 때에 다시 돌아와서 원하는 것을 정확히 찾을 수 있습니다.
## 코드 실행하기
-모든 코드 블록은 복사하고 직접 사용할 수 있습니다(실제로 테스트한 파이썬 파일입니다).
+모든 코드 블록은 복사하여 바로 사용할 수 있습니다(실제로 테스트된 파이썬 파일입니다).
예제를 실행하려면 코드를 `main.py` 파일에 복사하고 다음을 사용하여 `uvicorn`을 시작합니다:
@@ -28,17 +28,18 @@ $ uvicorn main:app --reload
+
+## 요약과 기술
+
+`summary`와 `description`을 추가할 수 있습니다:
+
+```Python hl_lines="20-21"
+{!../../../docs_src/path_operation_configuration/tutorial003.py!}
+```
+
+## 독스트링으로 만든 기술
+
+설명은 보통 길어지고 여러 줄에 걸쳐있기 때문에, *경로 작동* 기술을 함수 독스트링 에 선언할 수 있습니다, 이를 **FastAPI**가 독스트링으로부터 읽습니다.
+
+마크다운 문법으로 독스트링을 작성할 수 있습니다, 작성된 마크다운 형식의 독스트링은 (마크다운의 들여쓰기를 고려하여) 올바르게 화면에 출력됩니다.
+
+```Python hl_lines="19-27"
+{!../../../docs_src/path_operation_configuration/tutorial004.py!}
+```
+
+이는 대화형 문서에서 사용됩니다:
+
+
+
+## 응답 기술
+
+`response_description` 매개변수로 응답에 관한 설명을 명시할 수 있습니다:
+
+```Python hl_lines="21"
+{!../../../docs_src/path_operation_configuration/tutorial005.py!}
+```
+
+!!! info "정보"
+ `response_description`은 구체적으로 응답을 지칭하며, `description`은 일반적인 *경로 작동*을 지칭합니다.
+
+!!! check "확인"
+ OpenAPI는 각 *경로 작동*이 응답에 관한 설명을 요구할 것을 명시합니다.
+
+ 따라서, 응답에 관한 설명이 없을경우, **FastAPI**가 자동으로 "성공 응답" 중 하나를 생성합니다.
+
+
+
+## 단일 *경로 작동* 지원중단
+
+단일 *경로 작동*을 없애지 않고 지원중단을 해야한다면, `deprecated` 매개변수를 전달하면 됩니다.
+
+```Python hl_lines="16"
+{!../../../docs_src/path_operation_configuration/tutorial006.py!}
+```
+
+대화형 문서에 지원중단이라고 표시됩니다.
+
+
+
+지원중단된 경우와 지원중단 되지 않은 경우에 대한 *경로 작동*이 어떻게 보이는 지 확인하십시오.
+
+
+
+## 정리
+
+*경로 작동 데코레이터*에 매개변수(들)를 전달함으로 *경로 작동*을 설정하고 메타데이터를 추가할수 있습니다.
diff --git a/docs/ko/docs/tutorial/path-params.md b/docs/ko/docs/tutorial/path-params.md
index 5cf397e7a..a75c3cc8c 100644
--- a/docs/ko/docs/tutorial/path-params.md
+++ b/docs/ko/docs/tutorial/path-params.md
@@ -1,6 +1,6 @@
# 경로 매개변수
-파이썬 포맷 문자열이 사용하는 동일한 문법으로 "매개변수" 또는 "변수"를 경로에 선언할 수 있습니다:
+파이썬의 포맷 문자열 리터럴에서 사용되는 문법을 이용하여 경로 "매개변수" 또는 "변수"를 선언할 수 있습니다:
```Python hl_lines="6-7"
{!../../../docs_src/path_params/tutorial001.py!}
@@ -22,10 +22,10 @@
{!../../../docs_src/path_params/tutorial002.py!}
```
-지금과 같은 경우, `item_id`는 `int`로 선언 되었습니다.
+위의 예시에서, `item_id`는 `int`로 선언되었습니다.
!!! check "확인"
- 이 기능은 함수 내에서 오류 검사, 자동완성 등을 편집기를 지원합니다
+ 이 기능은 함수 내에서 오류 검사, 자동완성 등의 편집기 기능을 활용할 수 있게 해줍니다.
## 데이터 변환
@@ -42,7 +42,7 @@
## 데이터 검증
-하지만 브라우저에서 http://127.0.0.1:8000/items/foo로 이동하면, 멋진 HTTP 오류를 볼 수 있습니다:
+하지만 브라우저에서 http://127.0.0.1:8000/items/foo로 이동하면, HTTP 오류가 잘 뜨는 것을 확인할 수 있습니다:
```JSON
{
@@ -61,12 +61,12 @@
경로 매개변수 `item_id`는 `int`가 아닌 `"foo"` 값이기 때문입니다.
-`int` 대신 `float`을 전달하면 동일한 오류가 나타납니다: http://127.0.0.1:8000/items/4.2
+`int`가 아닌 `float`을 전달하는 경우에도 동일한 오류가 나타납니다: http://127.0.0.1:8000/items/4.2
!!! check "확인"
즉, 파이썬 타입 선언을 하면 **FastAPI**는 데이터 검증을 합니다.
- 오류는 검증을 통과하지 못한 지점도 정확하게 명시합니다.
+ 오류에는 정확히 어느 지점에서 검증을 통과하지 못했는지 명시됩니다.
이는 API와 상호 작용하는 코드를 개발하고 디버깅하는 데 매우 유용합니다.
@@ -77,11 +77,11 @@
!!! check "확인"
- 다시 한번, 그저 파이썬 타입 선언을 하기만 하면 **FastAPI**는 자동 대화식 API 문서(Swagger UI 통합)를 제공합니다.
+ 그저 파이썬 타입 선언을 하기만 하면 **FastAPI**는 자동 대화형 API 문서(Swagger UI)를 제공합니다.
- 경로 매개변수는 정수형으로 선언됐음을 주목하세요.
+ 경로 매개변수가 정수형으로 명시된 것을 확인할 수 있습니다.
-## 표준 기반의 이점, 대체 문서화
+## 표준 기반의 이점, 대체 문서
그리고 생성된 스키마는 OpenAPI 표준에서 나온 것이기 때문에 호환되는 도구가 많이 있습니다.
@@ -89,53 +89,53 @@
-이와 마찬가지로 호환되는 도구가 많이 있습니다. 다양한 언어에 대한 코드 생성 도구를 포함합니다.
+이와 마찬가지로 다양한 언어에 대한 코드 생성 도구를 포함하여 여러 호환되는 도구가 있습니다.
## Pydantic
-모든 데이터 검증은 Pydantic에 의해 내부적으로 수행되므로 이로 인한 모든 이점을 얻을 수 있습니다. 여러분은 관리를 잘 받고 있음을 느낄 수 있습니다.
+모든 데이터 검증은 Pydantic에 의해 내부적으로 수행되므로 이로 인한 이점을 모두 얻을 수 있습니다. 여러분은 관리를 잘 받고 있음을 느낄 수 있습니다.
-`str`, `float`, `bool`과 다른 복잡한 데이터 타입 선언을 할 수 있습니다.
+`str`, `float`, `bool`, 그리고 다른 여러 복잡한 데이터 타입 선언을 할 수 있습니다.
-이 중 몇 가지는 자습서의 다음 장에서 살펴봅니다.
+이 중 몇 가지는 자습서의 다음 장에 설명되어 있습니다.
## 순서 문제
-*경로 동작*을 만들때 고정 경로를 갖고 있는 상황들을 맞닦뜨릴 수 있습니다.
+*경로 작동*을 만들때 고정 경로를 갖고 있는 상황들을 맞닥뜨릴 수 있습니다.
`/users/me`처럼, 현재 사용자의 데이터를 가져온다고 합시다.
사용자 ID를 이용해 특정 사용자의 정보를 가져오는 경로 `/users/{user_id}`도 있습니다.
-*경로 동작*은 순차적으로 평가되기 때문에 `/users/{user_id}` 이전에 `/users/me`를 먼저 선언해야 합니다:
+*경로 작동*은 순차적으로 실행되기 때문에 `/users/{user_id}` 이전에 `/users/me`를 먼저 선언해야 합니다:
```Python hl_lines="6 11"
{!../../../docs_src/path_params/tutorial003.py!}
```
-그렇지 않으면 `/users/{user_id}`는 매개변수 `user_id`의 값을 `"me"`라고 "생각하여" `/users/me`도 연결합니다.
+그렇지 않으면 `/users/{user_id}`는 `/users/me` 요청 또한 매개변수 `user_id`의 값이 `"me"`인 것으로 "생각하게" 됩니다.
## 사전정의 값
-만약 *경로 매개변수*를 받는 *경로 동작*이 있지만, 유효하고 미리 정의할 수 있는 *경로 매개변수* 값을 원한다면 파이썬 표준 `Enum`을 사용할 수 있습니다.
+만약 *경로 매개변수*를 받는 *경로 작동*이 있지만, *경로 매개변수*로 가능한 값들을 미리 정의하고 싶다면 파이썬 표준 `Enum`을 사용할 수 있습니다.
### `Enum` 클래스 생성
`Enum`을 임포트하고 `str`과 `Enum`을 상속하는 서브 클래스를 만듭니다.
-`str`을 상속함으로써 API 문서는 값이 `string` 형이어야 하는 것을 알게 되고 제대로 렌더링 할 수 있게 됩니다.
+`str`을 상속함으로써 API 문서는 값이 `string` 형이어야 하는 것을 알게 되고 이는 문서에 제대로 표시됩니다.
-고정값으로 사용할 수 있는 유효한 클래스 어트리뷰트를 만듭니다:
+가능한 값들에 해당하는 고정된 값의 클래스 어트리뷰트들을 만듭니다:
```Python hl_lines="1 6-9"
{!../../../docs_src/path_params/tutorial005.py!}
```
!!! info "정보"
- 열거형(또는 enums)은 파이썬 버전 3.4 이후로 사용가능합니다.
+ 열거형(또는 enums)은 파이썬 버전 3.4 이후로 사용 가능합니다.
!!! tip "팁"
- 혹시 헷갈린다면, "AlexNet", "ResNet", 그리고 "LeNet"은 그저 기계 학습 모델들의 이름입니다.
+ 혹시 궁금하다면, "AlexNet", "ResNet", 그리고 "LeNet"은 그저 기계 학습 모델들의 이름입니다.
### *경로 매개변수* 선언
@@ -147,7 +147,7 @@
### 문서 확인
-*경로 매개변수*에 사용할 수 있는 값은 미리 정의되어 있으므로 대화형 문서에서 멋지게 표시됩니다:
+*경로 매개변수*에 사용할 수 있는 값은 미리 정의되어 있으므로 대화형 문서에서 잘 표시됩니다:
@@ -157,7 +157,7 @@
#### *열거형 멤버* 비교
-열거체 `ModelName`의 *열거형 멤버*를 비교할 수 있습니다:
+열거형 `ModelName`의 *열거형 멤버*를 비교할 수 있습니다:
```Python hl_lines="17"
{!../../../docs_src/path_params/tutorial005.py!}
@@ -165,7 +165,7 @@
#### *열거형 값* 가져오기
-`model_name.value` 또는 일반적으로 `your_enum_member.value`를 이용하여 실제값(지금의 경우 `str`)을 가져올 수 있습니다:
+`model_name.value` 또는 일반적으로 `your_enum_member.value`를 이용하여 실제 값(위 예시의 경우 `str`)을 가져올 수 있습니다:
```Python hl_lines="20"
{!../../../docs_src/path_params/tutorial005.py!}
@@ -176,7 +176,7 @@
#### *열거형 멤버* 반환
-*경로 동작*에서 중첩 JSON 본문(예: `dict`) 역시 *열거형 멤버*를 반환할 수 있습니다.
+*경로 작동*에서 *열거형 멤버*를 반환할 수 있습니다. 이는 중첩 JSON 본문(예: `dict`)내의 값으로도 가능합니다.
클라이언트에 반환하기 전에 해당 값(이 경우 문자열)으로 변환됩니다:
@@ -195,50 +195,50 @@
## 경로를 포함하는 경로 매개변수
-`/files/{file_path}`가 있는 *경로 동작*이 있다고 해봅시다.
+경로를 포함하는 *경로 작동* `/files/{file_path}`이 있다고 해봅시다.
-그런데 여러분은 `home/johndoe/myfile.txt`처럼 *path*에 들어있는 `file_path` 자체가 필요합니다.
+그런데 이 경우 `file_path` 자체가 `home/johndoe/myfile.txt`와 같은 경로를 포함해야 합니다.
-따라서 해당 파일의 URL은 다음처럼 됩니다: `/files/home/johndoe/myfile.txt`.
+이때 해당 파일의 URL은 다음처럼 됩니다: `/files/home/johndoe/myfile.txt`.
### OpenAPI 지원
테스트와 정의가 어려운 시나리오로 이어질 수 있으므로 OpenAPI는 *경로*를 포함하는 *경로 매개변수*를 내부에 선언하는 방법을 지원하지 않습니다.
-그럼에도 Starlette의 내부 도구중 하나를 사용하여 **FastAPI**에서는 할 수 있습니다.
+그럼에도 Starlette의 내부 도구중 하나를 사용하여 **FastAPI**에서는 이가 가능합니다.
-매개변수에 경로가 포함되어야 한다는 문서를 추가하지 않아도 문서는 계속 작동합니다.
+문서에 매개변수에 경로가 포함되어야 한다는 정보가 명시되지는 않지만 여전히 작동합니다.
### 경로 변환기
-Starlette에서 직접 옵션을 사용하면 다음과 같은 URL을 사용하여 *path*를 포함하는 *경로 매개변수*를 선언 할 수 있습니다:
+Starlette의 옵션을 직접 이용하여 다음과 같은 URL을 사용함으로써 *path*를 포함하는 *경로 매개변수*를 선언할 수 있습니다:
```
/files/{file_path:path}
```
-이러한 경우 매개변수의 이름은 `file_path`이고 마지막 부분 `:path`는 매개변수가 *경로*와 일치해야함을 알려줍니다.
+이러한 경우 매개변수의 이름은 `file_path`이며, 마지막 부분 `:path`는 매개변수가 *경로*와 일치해야 함을 명시합니다.
-그러므로 다음과 같이 사용할 수 있습니다:
+따라서 다음과 같이 사용할 수 있습니다:
```Python hl_lines="6"
{!../../../docs_src/path_params/tutorial004.py!}
```
!!! tip "팁"
- 매개변수가 `/home/johndoe/myfile.txt`를 갖고 있어 슬래시로 시작(`/`)해야 할 수 있습니다.
+ 매개변수가 가져야 하는 값이 `/home/johndoe/myfile.txt`와 같이 슬래시로 시작(`/`)해야 할 수 있습니다.
이 경우 URL은: `/files//home/johndoe/myfile.txt`이며 `files`과 `home` 사이에 이중 슬래시(`//`)가 생깁니다.
## 요약
-**FastAPI**과 함께라면 짧고 직관적인 표준 파이썬 타입 선언을 사용하여 다음을 얻을 수 있습니다:
+**FastAPI**를 이용하면 짧고 직관적인 표준 파이썬 타입 선언을 사용하여 다음을 얻을 수 있습니다:
* 편집기 지원: 오류 검사, 자동완성 등
* 데이터 "파싱"
* 데이터 검증
* API 주석(Annotation)과 자동 문서
-위 사항들을 그저 한번에 선언하면 됩니다.
+단 한번의 선언만으로 위 사항들을 모두 선언할 수 있습니다.
-이는 (원래 성능과는 별개로) 대체 프레임워크와 비교했을 때 **FastAPI**의 주요 가시적 장점일 것입니다.
+이는 대체 프레임워크와 비교했을 때 (엄청나게 빠른 성능 외에도) **FastAPI**의 주요한 장점일 것입니다.
diff --git a/docs/ko/docs/tutorial/query-params-str-validations.md b/docs/ko/docs/tutorial/query-params-str-validations.md
new file mode 100644
index 000000000..2e6396ccc
--- /dev/null
+++ b/docs/ko/docs/tutorial/query-params-str-validations.md
@@ -0,0 +1,303 @@
+# 쿼리 매개변수와 문자열 검증
+
+**FastAPI**를 사용하면 매개변수에 대한 추가 정보 및 검증을 선언할 수 있습니다.
+
+이 응용 프로그램을 예로 들어보겠습니다:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial001.py!}
+```
+
+쿼리 매개변수 `q`는 `Optional[str]` 자료형입니다. 즉, `str` 자료형이지만 `None` 역시 될 수 있음을 뜻하고, 실제로 기본값은 `None`이기 때문에 FastAPI는 이 매개변수가 필수가 아니라는 것을 압니다.
+
+!!! note "참고"
+ FastAPI는 `q`의 기본값이 `= None`이기 때문에 필수가 아님을 압니다.
+
+ `Optional[str]`에 있는 `Optional`은 FastAPI가 사용하는게 아니지만, 편집기에게 더 나은 지원과 오류 탐지를 제공하게 해줍니다.
+
+## 추가 검증
+
+`q`가 선택적이지만 값이 주어질 때마다 **값이 50 글자를 초과하지 않게** 강제하려 합니다.
+
+### `Query` 임포트
+
+이를 위해 먼저 `fastapi`에서 `Query`를 임포트합니다:
+
+```Python hl_lines="3"
+{!../../../docs_src/query_params_str_validations/tutorial002.py!}
+```
+
+## 기본값으로 `Query` 사용
+
+이제 `Query`를 매개변수의 기본값으로 사용하여 `max_length` 매개변수를 50으로 설정합니다:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial002.py!}
+```
+
+기본값 `None`을 `Query(None)`으로 바꿔야 하므로, `Query`의 첫 번째 매개변수는 기본값을 정의하는 것과 같은 목적으로 사용됩니다.
+
+그러므로:
+
+```Python
+q: Optional[str] = Query(None)
+```
+
+...위 코드는 아래와 동일하게 매개변수를 선택적으로 만듭니다:
+
+```Python
+q: Optional[str] = None
+```
+
+하지만 명시적으로 쿼리 매개변수를 선언합니다.
+
+!!! info "정보"
+ FastAPI는 다음 부분에 관심이 있습니다:
+
+ ```Python
+ = None
+ ```
+
+ 또는:
+
+ ```Python
+ = Query(None)
+ ```
+
+ 그리고 `None`을 사용하여 쿼라 매개변수가 필수적이지 않다는 것을 파악합니다.
+
+ `Optional` 부분은 편집기에게 더 나은 지원을 제공하기 위해서만 사용됩니다.
+
+또한 `Query`로 더 많은 매개변수를 전달할 수 있습니다. 지금의 경우 문자열에 적용되는 `max_length` 매개변수입니다:
+
+```Python
+q: str = Query(None, max_length=50)
+```
+
+이는 데이터를 검증할 것이고, 데이터가 유효하지 않다면 명백한 오류를 보여주며, OpenAPI 스키마 *경로 작동*에 매개변수를 문서화 합니다.
+
+## 검증 추가
+
+매개변수 `min_length` 또한 추가할 수 있습니다:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial003.py!}
+```
+
+## 정규식 추가
+
+매개변수와 일치해야 하는 정규표현식을 정의할 수 있습니다:
+
+```Python hl_lines="10"
+{!../../../docs_src/query_params_str_validations/tutorial004.py!}
+```
+
+이 특정 정규표현식은 전달 받은 매개변수 값을 검사합니다:
+
+* `^`: 이전에 문자가 없고 뒤따르는 문자로 시작합니다.
+* `fixedquery`: 정확히 `fixedquery` 값을 갖습니다.
+* `$`: 여기서 끝나고 `fixedquery` 이후로 아무 문자도 갖지 않습니다.
+
+**"정규표현식"** 개념에 대해 상실감을 느꼈다면 걱정하지 않아도 됩니다. 많은 사람에게 어려운 주제입니다. 아직은 정규표현식 없이도 많은 작업들을 할 수 있습니다.
+
+하지만 언제든지 가서 배울수 있고, **FastAPI**에서 직접 사용할 수 있다는 사실을 알고 있어야 합니다.
+
+## 기본값
+
+기본값으로 사용하는 첫 번째 인자로 `None`을 전달하듯이, 다른 값을 전달할 수 있습니다.
+
+`min_length`가 `3`이고, 기본값이 `"fixedquery"`인 쿼리 매개변수 `q`를 선언해봅시다:
+
+```Python hl_lines="7"
+{!../../../docs_src/query_params_str_validations/tutorial005.py!}
+```
+
+!!! note "참고"
+ 기본값을 갖는 것만으로 매개변수는 선택적이 됩니다.
+
+## 필수로 만들기
+
+더 많은 검증이나 메타데이터를 선언할 필요가 없는 경우, 다음과 같이 기본값을 선언하지 않고 쿼리 매개변수 `q`를 필수로 만들 수 있습니다:
+
+```Python
+q: str
+```
+
+아래 대신:
+
+```Python
+q: Optional[str] = None
+```
+
+그러나 이제 다음과 같이 `Query`로 선언합니다:
+
+```Python
+q: Optional[str] = Query(None, min_length=3)
+```
+
+그래서 `Query`를 필수값으로 만들어야 할 때면, 첫 번째 인자로 `...`를 사용할 수 있습니다:
+
+```Python hl_lines="7"
+{!../../../docs_src/query_params_str_validations/tutorial006.py!}
+```
+
+!!! info "정보"
+ 이전에 `...`를 본적이 없다면: 특별한 단일값으로, 파이썬의 일부이며 "Ellipsis"라 부릅니다.
+
+이렇게 하면 **FastAPI**가 이 매개변수는 필수임을 알 수 있습니다.
+
+## 쿼리 매개변수 리스트 / 다중값
+
+쿼리 매개변수를 `Query`와 함께 명시적으로 선언할 때, 값들의 리스트나 다른 방법으로 여러 값을 받도록 선언 할 수도 있습니다.
+
+예를 들어, URL에서 여러번 나오는 `q` 쿼리 매개변수를 선언하려면 다음과 같이 작성할 수 있습니다:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial011.py!}
+```
+
+아래와 같은 URL을 사용합니다:
+
+```
+http://localhost:8000/items/?q=foo&q=bar
+```
+
+여러 `q` *쿼리 매개변수* 값들을 (`foo` 및 `bar`) 파이썬 `list`로 *경로 작동 함수* 내 *함수 매개변수* `q`로 전달 받습니다.
+
+따라서 해당 URL에 대한 응답은 다음과 같습니다:
+
+```JSON
+{
+ "q": [
+ "foo",
+ "bar"
+ ]
+}
+```
+
+!!! tip "팁"
+ 위의 예와 같이 `list` 자료형으로 쿼리 매개변수를 선언하려면 `Query`를 명시적으로 사용해야 합니다. 그렇지 않으면 요청 본문으로 해석됩니다.
+
+대화형 API 문서는 여러 값을 허용하도록 수정 됩니다:
+
+
+
+### 쿼리 매개변수 리스트 / 기본값을 사용하는 다중값
+
+그리고 제공된 값이 없으면 기본 `list` 값을 정의할 수도 있습니다:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial012.py!}
+```
+
+아래로 이동한다면:
+
+```
+http://localhost:8000/items/
+```
+
+`q`의 기본값은: `["foo", "bar"]`이며 응답은 다음이 됩니다:
+
+```JSON
+{
+ "q": [
+ "foo",
+ "bar"
+ ]
+}
+```
+
+#### `list` 사용하기
+
+`List[str]` 대신 `list`를 직접 사용할 수도 있습니다:
+
+```Python hl_lines="7"
+{!../../../docs_src/query_params_str_validations/tutorial013.py!}
+```
+
+!!! note "참고"
+ 이 경우 FastAPI는 리스트의 내용을 검사하지 않음을 명심하기 바랍니다.
+
+ 예를 들어, `List[int]`는 리스트 내용이 정수인지 검사(및 문서화)합니다. 하지만 `list` 단독일 경우는 아닙니다.
+
+## 더 많은 메타데이터 선언
+
+매개변수에 대한 정보를 추가할 수 있습니다.
+
+해당 정보는 생성된 OpenAPI에 포함되고 문서 사용자 인터페이스 및 외부 도구에서 사용됩니다.
+
+!!! note "참고"
+ 도구에 따라 OpenAPI 지원 수준이 다를 수 있음을 명심하기 바랍니다.
+
+ 일부는 아직 선언된 추가 정보를 모두 표시하지 않을 수 있지만, 대부분의 경우 누락된 기능은 이미 개발 계획이 있습니다.
+
+`title`을 추가할 수 있습니다:
+
+```Python hl_lines="10"
+{!../../../docs_src/query_params_str_validations/tutorial007.py!}
+```
+
+그리고 `description`도 추가할 수 있습니다:
+
+```Python hl_lines="13"
+{!../../../docs_src/query_params_str_validations/tutorial008.py!}
+```
+
+## 별칭 매개변수
+
+매개변수가 `item-query`이길 원한다고 가정해 봅시다.
+
+마치 다음과 같습니다:
+
+```
+http://127.0.0.1:8000/items/?item-query=foobaritems
+```
+
+그러나 `item-query`은 유효한 파이썬 변수 이름이 아닙니다.
+
+가장 가까운 것은 `item_query`일 겁니다.
+
+하지만 정확히`item-query`이길 원합니다...
+
+이럴 경우 `alias`를 선언할 수 있으며, 해당 별칭은 매개변수 값을 찾는 데 사용됩니다:
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params_str_validations/tutorial009.py!}
+```
+
+## 매개변수 사용하지 않게 하기
+
+이제는 더이상 이 매개변수를 마음에 들어하지 않는다고 가정해 봅시다.
+
+이 매개변수를 사용하는 클라이언트가 있기 때문에 한동안은 남겨둬야 하지만, 사용되지 않는다(deprecated)고 확실하게 문서에서 보여주고 싶습니다.
+
+그렇다면 `deprecated=True` 매개변수를 `Query`로 전달합니다:
+
+```Python hl_lines="18"
+{!../../../docs_src/query_params_str_validations/tutorial010.py!}
+```
+
+문서가 아래와 같이 보일겁니다:
+
+
+
+## 요약
+
+매개변수에 검증과 메타데이터를 추가 선언할 수 있습니다.
+
+제네릭 검증과 메타데이터:
+
+* `alias`
+* `title`
+* `description`
+* `deprecated`
+
+특정 문자열 검증:
+
+* `min_length`
+* `max_length`
+* `regex`
+
+예제에서 `str` 값의 검증을 어떻게 추가하는지 살펴보았습니다.
+
+숫자와 같은 다른 자료형에 대한 검증을 어떻게 선언하는지 확인하려면 다음 장을 확인하기 바랍니다.
diff --git a/docs/ko/docs/tutorial/query-params.md b/docs/ko/docs/tutorial/query-params.md
index bb631e6ff..43a6c1a36 100644
--- a/docs/ko/docs/tutorial/query-params.md
+++ b/docs/ko/docs/tutorial/query-params.md
@@ -1,6 +1,6 @@
# 쿼리 매개변수
-경로 매개변수의 일부가 아닌 다른 함수 매개변수를 선언할 때, "쿼리" 매개변수로 자동 해석합니다.
+경로 매개변수의 일부가 아닌 다른 함수 매개변수를 선언하면 "쿼리" 매개변수로 자동 해석합니다.
```Python hl_lines="9"
{!../../../docs_src/query_params/tutorial001.py!}
@@ -8,7 +8,7 @@
쿼리는 URL에서 `?` 후에 나오고 `&`으로 구분되는 키-값 쌍의 집합입니다.
-예를 들어, URL에서:
+예를 들어, 아래 URL에서:
```
http://127.0.0.1:8000/items/?skip=0&limit=10
@@ -21,7 +21,7 @@ http://127.0.0.1:8000/items/?skip=0&limit=10
URL의 일부이므로 "자연스럽게" 문자열입니다.
-하지만 파이썬 타입과 함께 선언할 경우(위 예에서 `int`), 해당 타입으로 변환되고 이에 대해 검증합니다.
+하지만 파이썬 타입과 함께 선언할 경우(위 예에서 `int`), 해당 타입으로 변환 및 검증됩니다.
경로 매개변수에 적용된 동일한 프로세스가 쿼리 매개변수에도 적용됩니다:
@@ -36,13 +36,13 @@ URL의 일부이므로 "자연스럽게" 문자열입니다.
위 예에서 `skip=0`과 `limit=10`은 기본값을 갖고 있습니다.
-그러므로 URL로 이동하면:
+그러므로 URL로 이동하는 것은:
```
http://127.0.0.1:8000/items/
```
-아래로 이동한 것과 같습니다:
+아래로 이동하는 것과 같습니다:
```
http://127.0.0.1:8000/items/?skip=0&limit=10
@@ -136,7 +136,7 @@ http://127.0.0.1:8000/items/foo?short=yes
특정값을 추가하지 않고 선택적으로 만들기 위해선 기본값을 `None`으로 설정하면 됩니다.
-그러나 쿼리 매개변수를 필수로 만들려면 기본값을 선언할 수 없습니다:
+그러나 쿼리 매개변수를 필수로 만들려면 단순히 기본값을 선언하지 않으면 됩니다:
```Python hl_lines="6-7"
{!../../../docs_src/query_params/tutorial005.py!}
@@ -144,7 +144,7 @@ http://127.0.0.1:8000/items/foo?short=yes
여기 쿼리 매개변수 `needy`는 `str`형인 필수 쿼리 매개변수입니다.
-브라우저에서 URL을 아래처럼 연다면:
+브라우저에서 아래와 같은 URL을 연다면:
```
http://127.0.0.1:8000/items/foo-item
@@ -188,11 +188,11 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
{!../../../docs_src/query_params/tutorial006.py!}
```
-이 경우 3가지 쿼리 매개변수가 있습니다:
+위 예시에서는 3가지 쿼리 매개변수가 있습니다:
* `needy`, 필수적인 `str`.
* `skip`, 기본값이 `0`인 `int`.
* `limit`, 선택적인 `int`.
!!! tip "팁"
- [경로 매개변수](path-params.md#predefined-values){.internal-link target=_blank}와 마찬가지로 `Enum`을 사용할 수 있습니다.
+ [경로 매개변수](path-params.md#_8){.internal-link target=_blank}와 마찬가지로 `Enum`을 사용할 수 있습니다.
diff --git a/docs/ko/docs/tutorial/request-files.md b/docs/ko/docs/tutorial/request-files.md
index decefe981..468c46283 100644
--- a/docs/ko/docs/tutorial/request-files.md
+++ b/docs/ko/docs/tutorial/request-files.md
@@ -3,7 +3,7 @@
`File`을 사용하여 클라이언트가 업로드할 파일들을 정의할 수 있습니다.
!!! info "정보"
- 업로드된 파일을 전달받기 위해 먼저 `python-multipart`를 설치해야합니다.
+ 업로드된 파일을 전달받기 위해 먼저 `python-multipart`를 설치해야합니다.
예시) `pip install python-multipart`.
@@ -108,7 +108,7 @@ HTML의 폼들(``)이 서버에 데이터를 전송하는 방식은
인코딩과 폼 필드에 대해 더 알고싶다면, POST에 관한MDN웹 문서 를 참고하기 바랍니다,.
-!!! warning "주의"
+!!! warning "경고"
다수의 `File` 과 `Form` 매개변수를 한 *경로 작동*에 선언하는 것이 가능하지만, 요청의 본문이 `application/json` 가 아닌 `multipart/form-data` 로 인코딩 되기 때문에 JSON으로 받아야하는 `Body` 필드를 함께 선언할 수는 없습니다.
이는 **FastAPI**의 한계가 아니라, HTTP 프로토콜에 의한 것입니다.
diff --git a/docs/ko/docs/tutorial/request-forms-and-files.md b/docs/ko/docs/tutorial/request-forms-and-files.md
index ddf232e7f..bd5f41918 100644
--- a/docs/ko/docs/tutorial/request-forms-and-files.md
+++ b/docs/ko/docs/tutorial/request-forms-and-files.md
@@ -3,7 +3,7 @@
`File` 과 `Form` 을 사용하여 파일과 폼을 함께 정의할 수 있습니다.
!!! info "정보"
- 파일과 폼 데이터를 함께, 또는 각각 업로드하기 위해 먼저 `python-multipart`를 설치해야합니다.
+ 파일과 폼 데이터를 함께, 또는 각각 업로드하기 위해 먼저 `python-multipart`를 설치해야합니다.
예 ) `pip install python-multipart`.
@@ -25,7 +25,7 @@
어떤 파일들은 `bytes`로, 또 어떤 파일들은 `UploadFile`로 선언할 수 있습니다.
-!!! warning "주의"
+!!! warning "경고"
다수의 `File`과 `Form` 매개변수를 한 *경로 작동*에 선언하는 것이 가능하지만, 요청의 본문이 `application/json`가 아닌 `multipart/form-data`로 인코딩 되기 때문에 JSON으로 받아야하는 `Body` 필드를 함께 선언할 수는 없습니다.
이는 **FastAPI**의 한계가 아니라, HTTP 프로토콜에 의한 것입니다.
diff --git a/docs/ko/docs/tutorial/response-model.md b/docs/ko/docs/tutorial/response-model.md
new file mode 100644
index 000000000..feff88a42
--- /dev/null
+++ b/docs/ko/docs/tutorial/response-model.md
@@ -0,0 +1,210 @@
+# 응답 모델
+
+어떤 *경로 작동*이든 매개변수 `response_model`를 사용하여 응답을 위한 모델을 선언할 수 있습니다:
+
+* `@app.get()`
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+* 기타.
+
+```Python hl_lines="17"
+{!../../../docs_src/response_model/tutorial001.py!}
+```
+
+!!! note "참고"
+ `response_model`은 "데코레이터" 메소드(`get`, `post`, 등)의 매개변수입니다. 모든 매개변수들과 본문(body)처럼 *경로 작동 함수*가 아닙니다.
+
+Pydantic 모델 어트리뷰트를 선언한 것과 동일한 타입을 수신하므로 Pydantic 모델이 될 수 있지만, `List[Item]`과 같이 Pydantic 모델들의 `list`일 수도 있습니다.
+
+FastAPI는 이 `response_model`를 사용하여:
+
+* 출력 데이터를 타입 선언으로 변환.
+* 데이터 검증.
+* OpenAPI *경로 작동*의 응답에 JSON 스키마 추가.
+* 자동 생성 문서 시스템에 사용.
+
+하지만 가장 중요한 것은:
+
+* 해당 모델의 출력 데이터 제한. 이것이 얼마나 중요한지 아래에서 볼 것입니다.
+
+!!! note "기술 세부사항"
+ 응답 모델은 함수의 타입 어노테이션 대신 이 매개변수로 선언하는데, 경로 함수가 실제 응답 모델을 반환하지 않고 `dict`, 데이터베이스 객체나 기타 다른 모델을 `response_model`을 사용하여 필드 제한과 직렬화를 수행하고 반환할 수 있기 때문입니다
+
+## 동일한 입력 데이터 반환
+
+여기서 우리는 평문 비밀번호를 포함하는 `UserIn` 모델을 선언합니다:
+
+```Python hl_lines="9 11"
+{!../../../docs_src/response_model/tutorial002.py!}
+```
+
+그리고 이 모델을 사용하여 입력을 선언하고 같은 모델로 출력을 선언합니다:
+
+```Python hl_lines="17-18"
+{!../../../docs_src/response_model/tutorial002.py!}
+```
+
+이제 브라우저가 비밀번호로 사용자를 만들 때마다 API는 응답으로 동일한 비밀번호를 반환합니다.
+
+이 경우, 사용자가 스스로 비밀번호를 발신했기 때문에 문제가 되지 않을 수 있습니다.
+
+그러나 동일한 모델을 다른 *경로 작동*에서 사용할 경우, 모든 클라이언트에게 사용자의 비밀번호를 발신할 수 있습니다.
+
+!!! danger "위험"
+ 절대로 사용자의 평문 비밀번호를 저장하거나 응답으로 발신하지 마십시오.
+
+## 출력 모델 추가
+
+대신 평문 비밀번호로 입력 모델을 만들고 해당 비밀번호 없이 출력 모델을 만들 수 있습니다:
+
+```Python hl_lines="9 11 16"
+{!../../../docs_src/response_model/tutorial003.py!}
+```
+
+여기서 *경로 작동 함수*가 비밀번호를 포함하는 동일한 입력 사용자를 반환할지라도:
+
+```Python hl_lines="24"
+{!../../../docs_src/response_model/tutorial003.py!}
+```
+
+...`response_model`을 `UserOut` 모델로 선언했기 때문에 비밀번호를 포함하지 않습니다:
+
+```Python hl_lines="22"
+{!../../../docs_src/response_model/tutorial003.py!}
+```
+
+따라서 **FastAPI**는 출력 모델에서 선언하지 않은 모든 데이터를 (Pydantic을 사용하여) 필터링합니다.
+
+## 문서에서 보기
+
+자동 생성 문서를 보면 입력 모델과 출력 모델이 각자의 JSON 스키마를 가지고 있음을 확인할 수 있습니다:
+
+
+
+그리고 두 모델 모두 대화형 API 문서에 사용됩니다:
+
+
+
+## 응답 모델 인코딩 매개변수
+
+응답 모델은 아래와 같이 기본값을 가질 수 있습니다:
+
+```Python hl_lines="11 13-14"
+{!../../../docs_src/response_model/tutorial004.py!}
+```
+
+* `description: Optional[str] = None`은 기본값으로 `None`을 갖습니다.
+* `tax: float = 10.5`는 기본값으로 `10.5`를 갖습니다.
+* `tags: List[str] = []` 빈 리스트의 기본값으로: `[]`.
+
+그러나 실제로 저장되지 않았을 경우 결과에서 값을 생략하고 싶을 수 있습니다.
+
+예를 들어, NoSQL 데이터베이스에 많은 선택적 속성이 있는 모델이 있지만, 기본값으로 가득 찬 매우 긴 JSON 응답을 보내고 싶지 않습니다.
+
+### `response_model_exclude_unset` 매개변수 사용
+
+*경로 작동 데코레이터* 매개변수를 `response_model_exclude_unset=True`로 설정 할 수 있습니다:
+
+```Python hl_lines="24"
+{!../../../docs_src/response_model/tutorial004.py!}
+```
+
+이러한 기본값은 응답에 포함되지 않고 실제로 설정된 값만 포함됩니다.
+
+따라서 해당 *경로 작동*에 ID가 `foo`인 항목(items)을 요청으로 보내면 (기본값을 제외한) 응답은 다음과 같습니다:
+
+```JSON
+{
+ "name": "Foo",
+ "price": 50.2
+}
+```
+
+!!! info "정보"
+ FastAPI는 이를 위해 Pydantic 모델의 `.dict()`의 `exclude_unset` 매개변수를 사용합니다.
+
+!!! info "정보"
+ 아래 또한 사용할 수 있습니다:
+
+ * `response_model_exclude_defaults=True`
+ * `response_model_exclude_none=True`
+
+ Pydantic 문서에서 `exclude_defaults` 및 `exclude_none`에 대해 설명한 대로 사용할 수 있습니다.
+
+#### 기본값이 있는 필드를 갖는 값의 데이터
+
+하지만 모델의 필드가 기본값이 있어도 ID가 `bar`인 항목(items)처럼 데이터가 값을 갖는다면:
+
+```Python hl_lines="3 5"
+{
+ "name": "Bar",
+ "description": "The bartenders",
+ "price": 62,
+ "tax": 20.2
+}
+```
+
+응답에 해당 값들이 포함됩니다.
+
+#### 기본값과 동일한 값을 갖는 데이터
+
+If the data has the same values as the default ones, like the item with ID `baz`:
+ID가 `baz`인 항목(items)처럼 기본값과 동일한 값을 갖는다면:
+
+```Python hl_lines="3 5-6"
+{
+ "name": "Baz",
+ "description": None,
+ "price": 50.2,
+ "tax": 10.5,
+ "tags": []
+}
+```
+
+`description`, `tax` 그리고 `tags`가 기본값과 같더라도 (기본값에서 가져오는 대신) 값들이 명시적으로 설정되었다는 것을 인지할 정도로 FastAPI는 충분히 똑똑합니다(사실, Pydantic이 충분히 똑똑합니다).
+
+따라서 JSON 스키마에 포함됩니다.
+
+!!! tip "팁"
+ `None` 뿐만 아니라 다른 어떤 것도 기본값이 될 수 있습니다.
+
+ 리스트(`[]`), `float`인 `10.5` 등이 될 수 있습니다.
+
+### `response_model_include` 및 `response_model_exclude`
+
+*경로 작동 데코레이터* 매개변수 `response_model_include` 및 `response_model_exclude`를 사용할 수 있습니다.
+
+이들은 포함(나머지 생략)하거나 제외(나머지 포함) 할 어트리뷰트의 이름과 `str`의 `set`을 받습니다.
+
+Pydantic 모델이 하나만 있고 출력에서 일부 데이터를 제거하려는 경우 빠른 지름길로 사용할 수 있습니다.
+
+!!! tip "팁"
+ 하지만 이러한 매개변수 대신 여러 클래스를 사용하여 위 아이디어를 사용하는 것을 추천합니다.
+
+ 이는 일부 어트리뷰트를 생략하기 위해 `response_model_include` 또는 `response_model_exclude`를 사용하더라도 앱의 OpenAPI(및 문서)가 생성한 JSON 스키마가 여전히 전체 모델에 대한 스키마이기 때문입니다.
+
+ 비슷하게 작동하는 `response_model_by_alias` 역시 마찬가지로 적용됩니다.
+
+```Python hl_lines="31 37"
+{!../../../docs_src/response_model/tutorial005.py!}
+```
+
+!!! tip "팁"
+ 문법 `{"name", "description"}`은 두 값을 갖는 `set`을 만듭니다.
+
+ 이는 `set(["name", "description"])`과 동일합니다.
+
+#### `set` 대신 `list` 사용하기
+
+`list` 또는 `tuple` 대신 `set`을 사용하는 법을 잊었더라도, FastAPI는 `set`으로 변환하고 정상적으로 작동합니다:
+
+```Python hl_lines="31 37"
+{!../../../docs_src/response_model/tutorial006.py!}
+```
+
+## 요약
+
+응답 모델을 정의하고 개인정보가 필터되는 것을 보장하기 위해 *경로 작동 데코레이터*의 매개변수 `response_model`을 사용하세요.
+
+명시적으로 설정된 값만 반환하려면 `response_model_exclude_unset`을 사용하세요.
diff --git a/docs/ko/docs/tutorial/schema-extra-example.md b/docs/ko/docs/tutorial/schema-extra-example.md
new file mode 100644
index 000000000..4e319e075
--- /dev/null
+++ b/docs/ko/docs/tutorial/schema-extra-example.md
@@ -0,0 +1,326 @@
+# 요청 예제 데이터 선언
+
+여러분의 앱이 받을 수 있는 데이터 예제를 선언할 수 있습니다.
+
+여기 이를 위한 몇가지 방식이 있습니다.
+
+## Pydantic 모델 속 추가 JSON 스키마 데이터
+
+생성된 JSON 스키마에 추가될 Pydantic 모델을 위한 `examples`을 선언할 수 있습니다.
+
+=== "Python 3.10+ Pydantic v2"
+
+ ```Python hl_lines="13-24"
+ {!> ../../../docs_src/schema_extra_example/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.10+ Pydantic v1"
+
+ ```Python hl_lines="13-23"
+ {!> ../../../docs_src/schema_extra_example/tutorial001_py310_pv1.py!}
+ ```
+
+=== "Python 3.8+ Pydantic v2"
+
+ ```Python hl_lines="15-26"
+ {!> ../../../docs_src/schema_extra_example/tutorial001.py!}
+ ```
+
+=== "Python 3.8+ Pydantic v1"
+
+ ```Python hl_lines="15-25"
+ {!> ../../../docs_src/schema_extra_example/tutorial001_pv1.py!}
+ ```
+
+추가 정보는 있는 그대로 해당 모델의 **JSON 스키마** 결과에 추가되고, API 문서에서 사용합니다.
+
+=== "Pydantic v2"
+
+ Pydantic 버전 2에서 Pydantic 공식 문서: Model Config에 나와 있는 것처럼 `dict`를 받는 `model_config` 어트리뷰트를 사용할 것입니다.
+
+ `"json_schema_extra"`를 생성된 JSON 스키마에서 보여주고 싶은 별도의 데이터와 `examples`를 포함하는 `dict`으로 설정할 수 있습니다.
+
+=== "Pydantic v1"
+
+ Pydantic v1에서 Pydantic 공식 문서: Schema customization에서 설명하는 것처럼, 내부 클래스인 `Config`와 `schema_extra`를 사용할 것입니다.
+
+ `schema_extra`를 생성된 JSON 스키마에서 보여주고 싶은 별도의 데이터와 `examples`를 포함하는 `dict`으로 설정할 수 있습니다.
+
+!!! tip "팁"
+ JSON 스키마를 확장하고 여러분의 별도의 자체 데이터를 추가하기 위해 같은 기술을 사용할 수 있습니다.
+
+ 예를 들면, 프론트엔드 사용자 인터페이스에 메타데이터를 추가하는 등에 사용할 수 있습니다.
+
+!!! info "정보"
+ (FastAPI 0.99.0부터 쓰이기 시작한) OpenAPI 3.1.0은 **JSON 스키마** 표준의 일부인 `examples`에 대한 지원을 추가했습니다.
+
+ 그 전에는, 하나의 예제만 가능한 `example` 키워드만 지원했습니다. 이는 아직 OpenAPI 3.1.0에서 지원하지만, 지원이 종료될 것이며 JSON 스키마 표준에 포함되지 않습니다. 그렇기에 `example`을 `examples`으로 이전하는 것을 추천합니다. 🤓
+
+ 이 문서 끝에 더 많은 읽을거리가 있습니다.
+
+## `Field` 추가 인자
+
+Pydantic 모델과 같이 `Field()`를 사용할 때 추가적인 `examples`를 선언할 수 있습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="2 8-11"
+ {!> ../../../docs_src/schema_extra_example/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4 10-13"
+ {!> ../../../docs_src/schema_extra_example/tutorial002.py!}
+ ```
+
+## JSON Schema에서의 `examples` - OpenAPI
+
+이들 중에서 사용합니다:
+
+* `Path()`
+* `Query()`
+* `Header()`
+* `Cookie()`
+* `Body()`
+* `Form()`
+* `File()`
+
+**OpenAPI**의 **JSON 스키마**에 추가될 부가적인 정보를 포함한 `examples` 모음을 선언할 수 있습니다.
+
+### `examples`를 포함한 `Body`
+
+여기, `Body()`에 예상되는 예제 데이터 하나를 포함한 `examples`를 넘겼습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="22-29"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="22-29"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="23-30"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="18-25"
+ {!> ../../../docs_src/schema_extra_example/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="20-27"
+ {!> ../../../docs_src/schema_extra_example/tutorial003.py!}
+ ```
+
+### 문서 UI 예시
+
+위의 어느 방법과 함께라면 `/docs`에서 다음과 같이 보일 것입니다:
+
+
+
+### 다중 `examples`를 포함한 `Body`
+
+물론 여러 `examples`를 넘길 수 있습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="23-38"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="23-38"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24-39"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="19-34"
+ {!> ../../../docs_src/schema_extra_example/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="21-36"
+ {!> ../../../docs_src/schema_extra_example/tutorial004.py!}
+ ```
+
+이와 같이 하면 이 예제는 그 본문 데이터를 위한 내부 **JSON 스키마**의 일부가 될 것입니다.
+
+그럼에도 불구하고, 지금 이 문서를 작성하는 시간에, 문서 UI를 보여주는 역할을 맡은 Swagger UI는 **JSON 스키마** 속 데이터를 위한 여러 예제의 표현을 지원하지 않습니다. 하지만 해결 방안을 밑에서 읽어보세요.
+
+### OpenAPI-특화 `examples`
+
+**JSON 스키마**가 `examples`를 지원하기 전 부터, OpenAPI는 `examples`이라 불리는 다른 필드를 지원해 왔습니다.
+
+이 **OpenAPI-특화** `examples`는 OpenAPI 명세서의 다른 구역으로 들어갑니다. 각 JSON 스키마 내부가 아니라 **각 *경로 작동* 세부 정보**에 포함됩니다.
+
+그리고 Swagger UI는 이 특정한 `examples` 필드를 한동안 지원했습니다. 그래서, 이를 다른 **문서 UI에 있는 예제**를 **표시**하기 위해 사용할 수 있습니다.
+
+이 OpenAPI-특화 필드인 `examples`의 형태는 (`list`대신에) **다중 예제**가 포함된 `dict`이며, 각각의 별도 정보 또한 **OpenAPI**에 추가될 것입니다.
+
+이는 OpenAPI에 포함된 JSON 스키마 안으로 포함되지 않으며, *경로 작동*에 직접적으로 포함됩니다.
+
+### `openapi_examples` 매개변수 사용하기
+
+다음 예시 속에 OpenAPI-특화 `examples`를 FastAPI 안에서 매개변수 `openapi_examples` 매개변수와 함께 선언할 수 있습니다:
+
+* `Path()`
+* `Query()`
+* `Header()`
+* `Cookie()`
+* `Body()`
+* `Form()`
+* `File()`
+
+`dict`의 키가 또 다른 `dict`인 각 예제와 값을 구별합니다.
+
+각각의 특정 `examples` 속 `dict` 예제는 다음을 포함할 수 있습니다:
+
+* `summary`: 예제에 대한 짧은 설명문.
+* `description`: 마크다운 텍스트를 포함할 수 있는 긴 설명문.
+* `value`: 실제로 보여지는 예시, 예를 들면 `dict`.
+* `externalValue`: `value`의 대안이며 예제를 가르키는 URL. 비록 `value`처럼 많은 도구를 지원하지 못할 수 있습니다.
+
+이를 다음과 같이 사용할 수 있습니다:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="23-49"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="23-49"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="24-50"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_an.py!}
+ ```
+
+=== "Python 3.10+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="19-45"
+ {!> ../../../docs_src/schema_extra_example/tutorial005_py310.py!}
+ ```
+
+=== "Python 3.8+ Annotated가 없는 경우"
+
+ !!! tip "팁"
+ 가능하다면 `Annotated`가 달린 버전을 권장합니다.
+
+ ```Python hl_lines="21-47"
+ {!> ../../../docs_src/schema_extra_example/tutorial005.py!}
+ ```
+
+### 문서 UI에서의 OpenAPI 예시
+
+`Body()`에 추가된 `openapi_examples`를 포함한 `/docs`는 다음과 같이 보일 것입니다:
+
+
+
+## 기술적 세부 사항
+
+!!! tip "팁"
+ 이미 **FastAPI**의 **0.99.0 혹은 그 이상** 버전을 사용하고 있다면, 이 세부 사항을 **스킵**해도 상관 없을 것입니다.
+
+ 세부 사항은 OpenAPI 3.1.0이 사용가능하기 전, 예전 버전과 더 관련있습니다.
+
+ 간략한 OpenAPI와 JSON 스키마 **역사 강의**로 생각할 수 있습니다. 🤓
+
+!!! warning "경고"
+ 표준 **JSON 스키마**와 **OpenAPI**에 대한 아주 기술적인 세부사항입니다.
+
+ 만약 위의 생각이 작동한다면, 그것으로 충분하며 이 세부 사항은 필요없을 것이니, 마음 편하게 스킵하셔도 됩니다.
+
+OpenAPI 3.1.0 전에 OpenAPI는 오래된 **JSON 스키마**의 수정된 버전을 사용했습니다.
+
+JSON 스키마는 `examples`를 가지고 있지 않았고, 따라서 OpenAPI는 그들만의 `example` 필드를 수정된 버전에 추가했습니다.
+
+OpenAPI는 또한 `example`과 `examples` 필드를 명세서의 다른 부분에 추가했습니다:
+
+* `(명세서에 있는) Parameter Object`는 FastAPI의 다음 기능에서 쓰였습니다:
+ * `Path()`
+ * `Query()`
+ * `Header()`
+ * `Cookie()`
+* (명세서에 있는)`Media Type Object`속 `content`에 있는 `Request Body Object`는 FastAPI의 다음 기능에서 쓰였습니다:
+ * `Body()`
+ * `File()`
+ * `Form()`
+
+!!! info "정보"
+ 이 예전 OpenAPI-특화 `examples` 매개변수는 이제 FastAPI `0.103.0`부터 `openapi_examples`입니다.
+
+### JSON 스키마의 `examples` 필드
+
+하지만, 후에 JSON 스키마는 `examples`필드를 명세서의 새 버전에 추가했습니다.
+
+그리고 새로운 OpenAPI 3.1.0은 이 새로운 `examples` 필드가 포함된 최신 버전 (JSON 스키마 2020-12)을 기반으로 했습니다.
+
+이제 새로운 `examples` 필드는 이전의 단일 (그리고 커스텀) `example` 필드보다 우선되며, `example`은 사용하지 않는 것이 좋습니다.
+
+JSON 스키마의 새로운 `examples` 필드는 예제 속 **단순한 `list`**이며, (위에서 상술한 것처럼) OpenAPI의 다른 곳에 존재하는 dict으로 된 추가적인 메타데이터가 아닙니다.
+
+!!! info "정보"
+ 더 쉽고 새로운 JSON 스키마와의 통합과 함께 OpenAPI 3.1.0가 배포되었지만, 잠시동안 자동 문서 생성을 제공하는 도구인 Swagger UI는 OpenAPI 3.1.0을 지원하지 않았습니다 (5.0.0 버전부터 지원합니다 🎉).
+
+ 이로인해, FastAPI 0.99.0 이전 버전은 아직 OpenAPI 3.1.0 보다 낮은 버전을 사용했습니다.
+
+### Pydantic과 FastAPI `examples`
+
+`examples`를 Pydantic 모델 속에 추가할 때, `schema_extra` 혹은 `Field(examples=["something"])`를 사용하면 Pydantic 모델의 **JSON 스키마**에 해당 예시가 추가됩니다.
+
+그리고 Pydantic 모델의 **JSON 스키마**는 API의 **OpenAPI**에 포함되고, 그 후 문서 UI 속에서 사용됩니다.
+
+FastAPI 0.99.0 이전 버전에서 (0.99.0 이상 버전은 새로운 OpenAPI 3.1.0을 사용합니다), `example` 혹은 `examples`를 다른 유틸리티(`Query()`, `Body()` 등)와 함께 사용했을 때, 저러한 예시는 데이터를 설명하는 JSON 스키마에 추가되지 않으며 (심지어 OpenAPI의 자체 JSON 스키마에도 포함되지 않습니다), OpenAPI의 *경로 작동* 선언에 직접적으로 추가됩니다 (JSON 스키마를 사용하는 OpenAPI 부분 외에도).
+
+하지만 지금은 FastAPI 0.99.0 및 이후 버전에서는 JSON 스키마 2020-12를 사용하는 OpenAPI 3.1.0과 Swagger UI 5.0.0 및 이후 버전을 사용하며, 모든 것이 더 일관성을 띄고 예시는 JSON 스키마에 포함됩니다.
+
+### Swagger UI와 OpenAPI-특화 `examples`
+
+현재 (2023-08-26), Swagger UI가 다중 JSON 스키마 예시를 지원하지 않으며, 사용자는 다중 예시를 문서에 표시하는 방법이 없었습니다.
+
+이를 해결하기 위해, FastAPI `0.103.0`은 새로운 매개변수인 `openapi_examples`를 포함하는 예전 **OpenAPI-특화** `examples` 필드를 선언하기 위한 **지원을 추가**했습니다. 🤓
+
+### 요약
+
+저는 역사를 그다지 좋아하는 편이 아니라고 말하고는 했지만... "기술 역사" 강의를 가르치는 지금의 저를 보세요.
+
+요약하자면 **FastAPI 0.99.0 혹은 그 이상의 버전**으로 업그레이드하는 것은 많은 것들이 더 **쉽고, 일관적이며 직관적이게** 되며, 여러분은 이 모든 역사적 세부 사항을 알 필요가 없습니다. 😎
diff --git a/docs/ko/docs/tutorial/security/get-current-user.md b/docs/ko/docs/tutorial/security/get-current-user.md
new file mode 100644
index 000000000..f4b6f9471
--- /dev/null
+++ b/docs/ko/docs/tutorial/security/get-current-user.md
@@ -0,0 +1,151 @@
+# 현재 사용자 가져오기
+
+이전 장에서 (의존성 주입 시스템을 기반으로 한)보안 시스템은 *경로 작동 함수*에서 `str`로 `token`을 제공했습니다:
+
+```Python hl_lines="10"
+{!../../../docs_src/security/tutorial001.py!}
+```
+
+그러나 아직도 유용하지 않습니다.
+
+현재 사용자를 제공하도록 합시다.
+
+## 유저 모델 생성하기
+
+먼저 Pydantic 유저 모델을 만들어 보겠습니다.
+
+Pydantic을 사용하여 본문을 선언하는 것과 같은 방식으로 다른 곳에서 사용할 수 있습니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="5 12-16"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="3 10-14"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+## `get_current_user` 의존성 생성하기
+
+의존성 `get_current_user`를 만들어 봅시다.
+
+의존성이 하위 의존성을 가질 수 있다는 것을 기억하십니까?
+
+`get_current_user`는 이전에 생성한 것과 동일한 `oauth2_scheme`과 종속성을 갖게 됩니다.
+
+이전에 *경로 작동*에서 직접 수행했던 것과 동일하게 새 종속성 `get_current_user`는 하위 종속성 `oauth2_scheme`에서 `str`로 `token`을 수신합니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="25"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="23"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+## 유저 가져오기
+
+`get_current_user`는 토큰을 `str`로 취하고 Pydantic `User` 모델을 반환하는 우리가 만든 (가짜) 유틸리티 함수를 사용합니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="19-22 26-27"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="17-20 24-25"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+## 현재 유저 주입하기
+
+이제 *경로 작동*에서 `get_current_user`와 동일한 `Depends`를 사용할 수 있습니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="31"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="29"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+Pydantic 모델인 `User`로 `current_user`의 타입을 선언하는 것을 알아야 합니다.
+
+이것은 모든 완료 및 타입 검사를 통해 함수 내부에서 우리를 도울 것입니다.
+
+!!! tip "팁"
+ 요청 본문도 Pydantic 모델로 선언된다는 것을 기억할 것입니다.
+
+ 여기서 **FastAPI**는 `Depends`를 사용하고 있기 때문에 혼동되지 않습니다.
+
+!!! check "확인"
+ 이 의존성 시스템이 설계된 방식은 모두 `User` 모델을 반환하는 다양한 의존성(다른 "의존적인")을 가질 수 있도록 합니다.
+
+ 해당 타입의 데이터를 반환할 수 있는 의존성이 하나만 있는 것으로 제한되지 않습니다.
+
+## 다른 모델
+
+이제 *경로 작동 함수*에서 현재 사용자를 직접 가져올 수 있으며 `Depends`를 사용하여 **의존성 주입** 수준에서 보안 메커니즘을 처리할 수 있습니다.
+
+그리고 보안 요구 사항에 대한 모든 모델 또는 데이터를 사용할 수 있습니다(이 경우 Pydantic 모델 `User`).
+
+그러나 일부 특정 데이터 모델, 클래스 또는 타입을 사용하도록 제한되지 않습니다.
+
+모델에 `id`와 `email`이 있고 `username`이 없길 원하십니까? 맞습니다. 이들은 동일한 도구를 사용할 수 있습니다.
+
+`str`만 갖고 싶습니까? 아니면 그냥 `dict`를 갖고 싶습니까? 아니면 데이터베이스 클래스 모델 인스턴스를 직접 갖고 싶습니까? 그들은 모두 같은 방식으로 작동합니다.
+
+실제로 애플리케이션에 로그인하는 사용자가 없지만 액세스 토큰만 있는 로봇, 봇 또는 기타 시스템이 있습니까? 다시 말하지만 모두 동일하게 작동합니다.
+
+애플리케이션에 필요한 모든 종류의 모델, 모든 종류의 클래스, 모든 종류의 데이터베이스를 사용하십시오. **FastAPI**는 의존성 주입 시스템을 다루었습니다.
+
+## 코드 사이즈
+
+이 예는 장황해 보일 수 있습니다. 동일한 파일에서 보안, 데이터 모델, 유틸리티 기능 및 *경로 작동*을 혼합하고 있음을 염두에 두십시오.
+
+그러나 이게 키포인트입니다.
+
+보안과 종속성 주입 항목을 한 번만 작성하면 됩니다.
+
+그리고 원하는 만큼 복잡하게 만들 수 있습니다. 그래도 유연성과 함께 한 곳에 한 번에 작성할 수 있습니다.
+
+그러나 동일한 보안 시스템을 사용하여 수천 개의 엔드포인트(*경로 작동*)를 가질 수 있습니다.
+
+그리고 그들 모두(또는 원하는 부분)는 이러한 의존성 또는 생성한 다른 의존성을 재사용하는 이점을 얻을 수 있습니다.
+
+그리고 이 수천 개의 *경로 작동*은 모두 3줄 정도로 줄일 수 있습니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="30-32"
+ {!> ../../../docs_src/security/tutorial002.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="28-30"
+ {!> ../../../docs_src/security/tutorial002_py310.py!}
+ ```
+
+## 요약
+
+이제 *경로 작동 함수*에서 현재 사용자를 직접 가져올 수 있습니다.
+
+우리는 이미 이들 사이에 있습니다.
+
+사용자/클라이언트가 실제로 `username`과 `password`를 보내려면 *경로 작동*을 추가하기만 하면 됩니다.
+
+다음 장을 확인해 봅시다.
diff --git a/docs/ko/docs/tutorial/security/simple-oauth2.md b/docs/ko/docs/tutorial/security/simple-oauth2.md
new file mode 100644
index 000000000..1e33f5766
--- /dev/null
+++ b/docs/ko/docs/tutorial/security/simple-oauth2.md
@@ -0,0 +1,315 @@
+# 패스워드와 Bearer를 이용한 간단한 OAuth2
+
+이제 이전 장에서 빌드하고 누락된 부분을 추가하여 완전한 보안 흐름을 갖도록 하겠습니다.
+
+## `username`와 `password` 얻기
+
+**FastAPI** 보안 유틸리티를 사용하여 `username` 및 `password`를 가져올 것입니다.
+
+OAuth2는 (우리가 사용하고 있는) "패스워드 플로우"을 사용할 때 클라이언트/유저가 `username` 및 `password` 필드를 폼 데이터로 보내야 함을 지정합니다.
+
+그리고 사양에는 필드의 이름을 그렇게 지정해야 한다고 나와 있습니다. 따라서 `user-name` 또는 `email`은 작동하지 않습니다.
+
+하지만 걱정하지 않아도 됩니다. 프런트엔드에서 최종 사용자에게 원하는 대로 표시할 수 있습니다.
+
+그리고 데이터베이스 모델은 원하는 다른 이름을 사용할 수 있습니다.
+
+그러나 로그인 *경로 작동*의 경우 사양과 호환되도록 이러한 이름을 사용해야 합니다(예를 들어 통합 API 문서 시스템을 사용할 수 있어야 합니다).
+
+사양에는 또한 `username`과 `password`가 폼 데이터로 전송되어야 한다고 명시되어 있습니다(따라서 여기에는 JSON이 없습니다).
+
+### `scope`
+
+사양에는 클라이언트가 다른 폼 필드 "`scope`"를 보낼 수 있다고 나와 있습니다.
+
+폼 필드 이름은 `scope`(단수형)이지만 실제로는 공백으로 구분된 "범위"가 있는 긴 문자열입니다.
+
+각 "범위"는 공백이 없는 문자열입니다.
+
+일반적으로 특정 보안 권한을 선언하는 데 사용됩니다. 다음을 봅시다:
+
+* `users:read` 또는 `users:write`는 일반적인 예시입니다.
+* `instagram_basic`은 페이스북/인스타그램에서 사용합니다.
+* `https://www.googleapis.com/auth/drive`는 Google에서 사용합니다.
+
+!!! 정보
+ OAuth2에서 "범위"는 필요한 특정 권한을 선언하는 문자열입니다.
+
+ `:`과 같은 다른 문자가 있는지 또는 URL인지는 중요하지 않습니다.
+
+ 이러한 세부 사항은 구현에 따라 다릅니다.
+
+ OAuth2의 경우 문자열일 뿐입니다.
+
+## `username`과 `password`를 가져오는 코드
+
+이제 **FastAPI**에서 제공하는 유틸리티를 사용하여 이를 처리해 보겠습니다.
+
+### `OAuth2PasswordRequestForm`
+
+먼저 `OAuth2PasswordRequestForm`을 가져와 `/token`에 대한 *경로 작동*에서 `Depends`의 의존성으로 사용합니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="4 76"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="2 74"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+`OAuth2PasswordRequestForm`은 다음을 사용하여 폼 본문을 선언하는 클래스 의존성입니다:
+
+* `username`.
+* `password`.
+* `scope`는 선택적인 필드로 공백으로 구분된 문자열로 구성된 큰 문자열입니다.
+* `grant_type`(선택적으로 사용).
+
+!!! 팁
+ OAuth2 사양은 실제로 `password`라는 고정 값이 있는 `grant_type` 필드를 *요구*하지만 `OAuth2PasswordRequestForm`은 이를 강요하지 않습니다.
+
+ 사용해야 한다면 `OAuth2PasswordRequestForm` 대신 `OAuth2PasswordRequestFormStrict`를 사용하면 됩니다.
+
+* `client_id`(선택적으로 사용) (예제에서는 필요하지 않습니다).
+* `client_secret`(선택적으로 사용) (예제에서는 필요하지 않습니다).
+
+!!! 정보
+ `OAuth2PasswordRequestForm`은 `OAuth2PasswordBearer`와 같이 **FastAPI**에 대한 특수 클래스가 아닙니다.
+
+ `OAuth2PasswordBearer`는 **FastAPI**가 보안 체계임을 알도록 합니다. 그래서 OpenAPI에 그렇게 추가됩니다.
+
+ 그러나 `OAuth2PasswordRequestForm`은 직접 작성하거나 `Form` 매개변수를 직접 선언할 수 있는 클래스 의존성일 뿐입니다.
+
+ 그러나 일반적인 사용 사례이므로 더 쉽게 하기 위해 **FastAPI**에서 직접 제공합니다.
+
+### 폼 데이터 사용하기
+
+!!! 팁
+ 종속성 클래스 `OAuth2PasswordRequestForm`의 인스턴스에는 공백으로 구분된 긴 문자열이 있는 `scope` 속성이 없고 대신 전송된 각 범위에 대한 실제 문자열 목록이 있는 `scopes` 속성이 있습니다.
+
+ 이 예제에서는 `scopes`를 사용하지 않지만 필요한 경우, 기능이 있습니다.
+
+이제 폼 필드의 `username`을 사용하여 (가짜) 데이터베이스에서 유저 데이터를 가져옵니다.
+
+해당 사용자가 없으면 "잘못된 사용자 이름 또는 패스워드"라는 오류가 반환됩니다.
+
+오류의 경우 `HTTPException` 예외를 사용합니다:
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="3 77-79"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="1 75-77"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+### 패스워드 확인하기
+
+이 시점에서 데이터베이스의 사용자 데이터 형식을 확인했지만 암호를 확인하지 않았습니다.
+
+먼저 데이터를 Pydantic `UserInDB` 모델에 넣겠습니다.
+
+일반 텍스트 암호를 저장하면 안 되니 (가짜) 암호 해싱 시스템을 사용합니다.
+
+두 패스워드가 일치하지 않으면 동일한 오류가 반환됩니다.
+
+#### 패스워드 해싱
+
+"해싱"은 일부 콘텐츠(이 경우 패스워드)를 횡설수설하는 것처럼 보이는 일련의 바이트(문자열)로 변환하는 것을 의미합니다.
+
+정확히 동일한 콘텐츠(정확히 동일한 패스워드)를 전달할 때마다 정확히 동일한 횡설수설이 발생합니다.
+
+그러나 횡설수설에서 암호로 다시 변환할 수는 없습니다.
+
+##### 패스워드 해싱을 사용해야 하는 이유
+
+데이터베이스가 유출된 경우 해커는 사용자의 일반 텍스트 암호가 아니라 해시만 갖게 됩니다.
+
+따라서 해커는 다른 시스템에서 동일한 암호를 사용하려고 시도할 수 없습니다(많은 사용자가 모든 곳에서 동일한 암호를 사용하므로 이는 위험할 수 있습니다).
+
+=== "P파이썬 3.7 이상"
+
+ ```Python hl_lines="80-83"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="78-81"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+#### `**user_dict`에 대해
+
+`UserInDB(**user_dict)`는 다음을 의미한다:
+
+*`user_dict`의 키와 값을 다음과 같은 키-값 인수로 직접 전달합니다:*
+
+```Python
+UserInDB(
+ username = user_dict["username"],
+ email = user_dict["email"],
+ full_name = user_dict["full_name"],
+ disabled = user_dict["disabled"],
+ hashed_password = user_dict["hashed_password"],
+)
+```
+
+!!! 정보
+ `**user_dict`에 대한 자세한 설명은 [**추가 모델** 문서](../extra-models.md#about-user_indict){.internal-link target=_blank}를 다시 읽어봅시다.
+
+## 토큰 반환하기
+
+`token` 엔드포인트의 응답은 JSON 객체여야 합니다.
+
+`token_type`이 있어야 합니다. 여기서는 "Bearer" 토큰을 사용하므로 토큰 유형은 "`bearer`"여야 합니다.
+
+그리고 액세스 토큰을 포함하는 문자열과 함께 `access_token`이 있어야 합니다.
+
+이 간단한 예제에서는 완전히 안전하지 않고, 동일한 `username`을 토큰으로 반환합니다.
+
+!!! 팁
+ 다음 장에서는 패스워드 해싱 및 JWT 토큰을 사용하여 실제 보안 구현을 볼 수 있습니다.
+
+ 하지만 지금은 필요한 세부 정보에 집중하겠습니다.
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="85"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="83"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+!!! 팁
+ 사양에 따라 이 예제와 동일하게 `access_token` 및 `token_type`이 포함된 JSON을 반환해야 합니다.
+
+ 이는 코드에서 직접 수행해야 하며 해당 JSON 키를 사용해야 합니다.
+
+ 사양을 준수하기 위해 스스로 올바르게 수행하기 위해 거의 유일하게 기억해야 하는 것입니다.
+
+ 나머지는 **FastAPI**가 처리합니다.
+
+## 의존성 업데이트하기
+
+이제 의존성을 업데이트를 할 겁니다.
+
+이 사용자가 활성화되어 있는 *경우에만* `current_user`를 가져올 겁니다.
+
+따라서 `get_current_user`를 의존성으로 사용하는 추가 종속성 `get_current_active_user`를 만듭니다.
+
+이러한 의존성 모두, 사용자가 존재하지 않거나 비활성인 경우 HTTP 오류를 반환합니다.
+
+따라서 엔드포인트에서는 사용자가 존재하고 올바르게 인증되었으며 활성 상태인 경우에만 사용자를 얻습니다:
+
+=== "파이썬 3.7 이상"
+
+ ```Python hl_lines="58-66 69-72 90"
+ {!> ../../../docs_src/security/tutorial003.py!}
+ ```
+
+=== "파이썬 3.10 이상"
+
+ ```Python hl_lines="55-64 67-70 88"
+ {!> ../../../docs_src/security/tutorial003_py310.py!}
+ ```
+
+!!! 정보
+ 여기서 반환하는 값이 `Bearer`인 추가 헤더 `WWW-Authenticate`도 사양의 일부입니다.
+
+ 모든 HTTP(오류) 상태 코드 401 "UNAUTHORIZED"는 `WWW-Authenticate` 헤더도 반환해야 합니다.
+
+ 베어러 토큰의 경우(지금의 경우) 해당 헤더의 값은 `Bearer`여야 합니다.
+
+ 실제로 추가 헤더를 건너뛸 수 있으며 여전히 작동합니다.
+
+ 그러나 여기에서는 사양을 준수하도록 제공됩니다.
+
+ 또한 이를 예상하고 (현재 또는 미래에) 사용하는 도구가 있을 수 있으며, 현재 또는 미래에 자신 혹은 자신의 유저들에게 유용할 것입니다.
+
+ 그것이 표준의 이점입니다 ...
+
+## 확인하기
+
+대화형 문서 열기: http://127.0.0.1:8000/docs.
+
+### 인증하기
+
+"Authorize" 버튼을 눌러봅시다.
+
+자격 증명을 사용합니다.
+
+유저명: `johndoe`
+
+패스워드: `secret`
+
+
+
+시스템에서 인증하면 다음과 같이 표시됩니다:
+
+
+
+### 자신의 유저 데이터 가져오기
+
+이제 `/users/me` 경로에 `GET` 작업을 진행합시다.
+
+다음과 같은 사용자 데이터를 얻을 수 있습니다:
+
+```JSON
+{
+ "username": "johndoe",
+ "email": "johndoe@example.com",
+ "full_name": "John Doe",
+ "disabled": false,
+ "hashed_password": "fakehashedsecret"
+}
+```
+
+
+
+잠금 아이콘을 클릭하고 로그아웃한 다음 동일한 작업을 다시 시도하면 다음과 같은 HTTP 401 오류가 발생합니다.
+
+```JSON
+{
+ "detail": "Not authenticated"
+}
+```
+
+### 비활성된 유저
+
+이제 비활성된 사용자로 시도하고, 인증해봅시다:
+
+유저명: `alice`
+
+패스워드: `secret2`
+
+그리고 `/users/me` 경로와 함께 `GET` 작업을 사용해 봅시다.
+
+다음과 같은 "Inactive user" 오류가 발생합니다:
+
+```JSON
+{
+ "detail": "Inactive user"
+}
+```
+
+## 요약
+
+이제 API에 대한 `username` 및 `password`를 기반으로 완전한 보안 시스템을 구현할 수 있는 도구가 있습니다.
+
+이러한 도구를 사용하여 보안 시스템을 모든 데이터베이스 및 모든 사용자 또는 데이터 모델과 호환되도록 만들 수 있습니다.
+
+유일한 오점은 아직 실제로 "안전"하지 않다는 것입니다.
+
+다음 장에서는 안전한 패스워드 해싱 라이브러리와 JWT 토큰을 사용하는 방법을 살펴보겠습니다.
diff --git a/docs/ko/docs/tutorial/static-files.md b/docs/ko/docs/tutorial/static-files.md
new file mode 100644
index 000000000..fe1aa4e5e
--- /dev/null
+++ b/docs/ko/docs/tutorial/static-files.md
@@ -0,0 +1,40 @@
+# 정적 파일
+
+'StaticFiles'를 사용하여 디렉토리에서 정적 파일을 자동으로 제공할 수 있습니다.
+
+## `StaticFiles` 사용
+
+* `StaticFiles` 임포트합니다.
+* 특정 경로에 `StaticFiles()` 인스턴스를 "마운트" 합니다.
+
+```Python hl_lines="2 6"
+{!../../../docs_src/static_files/tutorial001.py!}
+```
+
+!!! note "기술적 세부사항"
+ `from starlette.staticfiles import StaticFiles` 를 사용할 수도 있습니다.
+
+ **FastAPI**는 단지 개발자인, 당신에게 편의를 제공하기 위해 `fastapi.static files` 와 동일한 `starlett.static files`를 제공합니다. 하지만 사실 이것은 Starlett에서 직접 온 것입니다.
+
+### "마운팅" 이란
+
+"마운팅"은 특정 경로에 완전히 "독립적인" 애플리케이션을 추가하는 것을 의미하는데, 그 후 모든 하위 경로에 대해서도 적용됩니다.
+
+마운트된 응용 프로그램은 완전히 독립적이기 때문에 `APIRouter`를 사용하는 것과는 다릅니다. OpenAPI 및 응용 프로그램의 문서는 마운트된 응용 프로그램 등에서 어떤 것도 포함하지 않습니다.
+
+자세한 내용은 **숙련된 사용자 안내서**에서 확인할 수 있습니다.
+
+## 세부사항
+
+첫 번째 `"/static"`은 이 "하위 응용 프로그램"이 "마운트"될 하위 경로를 가리킵니다. 따라서 `"/static"`으로 시작하는 모든 경로는 `"/static"`으로 처리됩니다.
+
+`'directory="static"`은 정적 파일이 들어 있는 디렉토리의 이름을 나타냅니다.
+
+`name="static"`은 **FastAPI**에서 내부적으로 사용할 수 있는 이름을 제공합니다.
+
+이 모든 매개변수는 "`static`"과 다를 수 있으며, 사용자 응용 프로그램의 요구 사항 및 구체적인 세부 정보에 따라 매개변수를 조정할 수 있습니다.
+
+
+## 추가 정보
+
+자세한 내용과 선택 사항을 보려면 Starlette의 정적 파일에 관한 문서를 확인하십시오.
diff --git a/docs/language_names.yml b/docs/language_names.yml
index 7c37ff2b1..c5a15ddd9 100644
--- a/docs/language_names.yml
+++ b/docs/language_names.yml
@@ -178,6 +178,6 @@ xh: isiXhosa
yi: ייִדיש
yo: Yorùbá
za: Saɯ cueŋƅ
-zh: 汉语
+zh: 简体中文
zh-hant: 繁體中文
zu: isiZulu
diff --git a/docs/pl/docs/features.md b/docs/pl/docs/features.md
index ed10af9bc..7c2013799 100644
--- a/docs/pl/docs/features.md
+++ b/docs/pl/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Cechy
## Cechy FastAPI
@@ -174,7 +179,7 @@ Dzięki **FastAPI** otrzymujesz wszystkie funkcje **Starlette** (ponieważ FastA
## Cechy Pydantic
-**FastAPI** jest w pełni kompatybilny z (oraz bazuje na) Pydantic. Tak więc każdy dodatkowy kod Pydantic, który posiadasz, również będzie działał.
+**FastAPI** jest w pełni kompatybilny z (oraz bazuje na) Pydantic. Tak więc każdy dodatkowy kod Pydantic, który posiadasz, również będzie działał.
Wliczając w to zewnętrzne biblioteki, również oparte o Pydantic, takie jak ORM, ODM dla baz danych.
@@ -189,8 +194,6 @@ Dzięki **FastAPI** otrzymujesz wszystkie funkcje **Pydantic** (ponieważ FastAP
* Jeśli znasz adnotacje typów Pythona to wiesz jak używać Pydantic.
* Dobrze współpracuje z Twoim **IDE/linterem/mózgiem**:
* Ponieważ struktury danych Pydantic to po prostu instancje klas, które definiujesz; autouzupełnianie, linting, mypy i twoja intuicja powinny działać poprawnie z Twoimi zwalidowanymi danymi.
-* **Szybkość**:
- * w benchmarkach Pydantic jest szybszy niż wszystkie inne testowane biblioteki.
* Walidacja **złożonych struktur**:
* Wykorzystanie hierarchicznych modeli Pydantic, Pythonowego modułu `typing` zawierającego `List`, `Dict`, itp.
* Walidatory umożliwiają jasne i łatwe definiowanie, sprawdzanie złożonych struktur danych oraz dokumentowanie ich jako JSON Schema.
diff --git a/docs/pl/docs/help-fastapi.md b/docs/pl/docs/help-fastapi.md
index 3d02a8741..fdc3b0bf9 100644
--- a/docs/pl/docs/help-fastapi.md
+++ b/docs/pl/docs/help-fastapi.md
@@ -12,7 +12,7 @@ Istnieje również kilka sposobów uzyskania pomocy.
## Zapisz się do newslettera
-Możesz zapisać się do rzadkiego [newslettera o **FastAPI i jego przyjaciołach**](/newsletter/){.internal-link target=_blank}, aby być na bieżąco z:
+Możesz zapisać się do rzadkiego [newslettera o **FastAPI i jego przyjaciołach**](newsletter.md){.internal-link target=_blank}, aby być na bieżąco z:
* Aktualnościami o FastAPI i przyjaciołach 🚀
* Przewodnikami 📝
@@ -78,7 +78,7 @@ Możesz spróbować pomóc innym, odpowiadając w:
W wielu przypadkach możesz już znać odpowiedź na te pytania. 🤓
-Jeśli pomożesz wielu ludziom, możesz zostać oficjalnym [Ekspertem FastAPI](fastapi-people.md#experts){.internal-link target=_blank}. 🎉
+Jeśli pomożesz wielu ludziom, możesz zostać oficjalnym [Ekspertem FastAPI](fastapi-people.md#fastapi-experts){.internal-link target=_blank}. 🎉
Pamiętaj tylko o najważniejszym: bądź życzliwy. Ludzie przychodzą sfrustrowani i w wielu przypadkach nie zadają pytań w najlepszy sposób, ale mimo to postaraj się być dla nich jak najbardziej życzliwy. 🤗
@@ -215,8 +215,8 @@ Jest wiele pracy do zrobienia, a w większości przypadków **TY** możesz to zr
Główne zadania, które możesz wykonać teraz to:
-* [Pomóc innym z pytaniami na GitHubie](#help-others-with-questions-in-github){.internal-link target=_blank} (zobacz sekcję powyżej).
-* [Oceniać Pull Requesty](#review-pull-requests){.internal-link target=_blank} (zobacz sekcję powyżej).
+* [Pomóc innym z pytaniami na GitHubie](#pomagaj-innym-odpowiadajac-na-ich-pytania-na-githubie){.internal-link target=_blank} (zobacz sekcję powyżej).
+* [Oceniać Pull Requesty](#przegladaj-pull-requesty){.internal-link target=_blank} (zobacz sekcję powyżej).
Te dwie czynności **zajmują najwięcej czasu**. To główna praca związana z utrzymaniem FastAPI.
@@ -226,8 +226,8 @@ Jeśli możesz mi w tym pomóc, **pomożesz mi utrzymać FastAPI** i zapewnisz
Dołącz do 👥 serwera czatu na Discordzie 👥 i spędzaj czas z innymi w społeczności FastAPI.
-!!! wskazówka
- Jeśli masz pytania, zadaj je w Dyskusjach na GitHubie, jest dużo większa szansa, że otrzymasz pomoc od [Ekspertów FastAPI](fastapi-people.md#experts){.internal-link target=_blank}.
+!!! tip "Wskazówka"
+ Jeśli masz pytania, zadaj je w Dyskusjach na GitHubie, jest dużo większa szansa, że otrzymasz pomoc od [Ekspertów FastAPI](fastapi-people.md#fastapi-experts){.internal-link target=_blank}.
Używaj czatu tylko do innych ogólnych rozmów.
@@ -237,7 +237,7 @@ Miej na uwadze, że ponieważ czaty pozwalają na bardziej "swobodną rozmowę",
Na GitHubie szablon poprowadzi Cię do napisania odpowiedniego pytania, dzięki czemu łatwiej uzyskasz dobrą odpowiedź, a nawet rozwiążesz problem samodzielnie, zanim zapytasz. Ponadto na GitHubie mogę się upewnić, że zawsze odpowiadam na wszystko, nawet jeśli zajmuje to trochę czasu. Osobiście nie mogę tego zrobić z systemami czatu. 😅
-Rozmów w systemach czatu nie można tak łatwo przeszukiwać, jak na GitHubie, więc pytania i odpowiedzi mogą zaginąć w rozmowie. A tylko te na GitHubie liczą się do zostania [Ekspertem FastAPI](fastapi-people.md#experts){.internal-link target=_blank}, więc najprawdopodobniej otrzymasz więcej uwagi na GitHubie.
+Rozmów w systemach czatu nie można tak łatwo przeszukiwać, jak na GitHubie, więc pytania i odpowiedzi mogą zaginąć w rozmowie. A tylko te na GitHubie liczą się do zostania [Ekspertem FastAPI](fastapi-people.md#fastapi-experts){.internal-link target=_blank}, więc najprawdopodobniej otrzymasz więcej uwagi na GitHubie.
Z drugiej strony w systemach czatu są tysiące użytkowników, więc jest duża szansa, że znajdziesz tam kogoś do rozmowy, prawie w każdej chwili. 😄
diff --git a/docs/pl/docs/index.md b/docs/pl/docs/index.md
index 49f5c2b01..06fa706bc 100644
--- a/docs/pl/docs/index.md
+++ b/docs/pl/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -111,7 +120,7 @@ Python 3.8+
FastAPI oparty jest na:
* Starlette dla części webowej.
-* Pydantic dla części obsługujących dane.
+* Pydantic dla części obsługujących dane.
## Instalacja
@@ -442,16 +451,16 @@ Używane przez Starlette:
* httpx - Wymagane jeżeli chcesz korzystać z `TestClient`.
* aiofiles - Wymagane jeżeli chcesz korzystać z `FileResponse` albo `StaticFiles`.
* jinja2 - Wymagane jeżeli chcesz używać domyślnej konfiguracji szablonów.
-* python-multipart - Wymagane jeżelich chcesz wsparcie "parsowania" formularzy, używając `request.form()`.
+* python-multipart - Wymagane jeżelich chcesz wsparcie "parsowania" formularzy, używając `request.form()`.
* itsdangerous - Wymagany dla wsparcia `SessionMiddleware`.
* pyyaml - Wymagane dla wsparcia `SchemaGenerator` z Starlette (z FastAPI prawdopodobnie tego nie potrzebujesz).
* graphene - Wymagane dla wsparcia `GraphQLApp`.
-* ujson - Wymagane jeżeli chcesz korzystać z `UJSONResponse`.
Używane przez FastAPI / Starlette:
* uvicorn - jako serwer, który ładuje i obsługuje Twoją aplikację.
* orjson - Wymagane jeżeli chcesz używać `ORJSONResponse`.
+* ujson - Wymagane jeżeli chcesz korzystać z `UJSONResponse`.
Możesz zainstalować wszystkie te aplikacje przy pomocy `pip install fastapi[all]`.
diff --git a/docs/pl/docs/tutorial/first-steps.md b/docs/pl/docs/tutorial/first-steps.md
index 9406d703d..ce71f8b83 100644
--- a/docs/pl/docs/tutorial/first-steps.md
+++ b/docs/pl/docs/tutorial/first-steps.md
@@ -311,7 +311,7 @@ Możesz również zdefiniować to jako normalną funkcję zamiast `async def`:
```
!!! note
- Jeśli nie znasz różnicy, sprawdź [Async: *"In a hurry?"*](/async/#in-a-hurry){.internal-link target=_blank}.
+ Jeśli nie znasz różnicy, sprawdź [Async: *"In a hurry?"*](../async.md#in-a-hurry){.internal-link target=_blank}.
### Krok 5: zwróć zawartość
diff --git a/docs/pt/docs/about/index.md b/docs/pt/docs/about/index.md
new file mode 100644
index 000000000..1f42e8831
--- /dev/null
+++ b/docs/pt/docs/about/index.md
@@ -0,0 +1,3 @@
+# Sobre
+
+Sobre o FastAPI, seus padrões, inspirações e muito mais. 🤓
diff --git a/docs/pt/docs/advanced/events.md b/docs/pt/docs/advanced/events.md
index 7f6cb6f5d..12aa93f29 100644
--- a/docs/pt/docs/advanced/events.md
+++ b/docs/pt/docs/advanced/events.md
@@ -160,4 +160,4 @@ Por baixo, na especificação técnica ASGI, essa é a parte do
+
+```console
+$ pip install jinja2
+```
+
+httpx - Necessário se você quiser utilizar o `TestClient`.
* jinja2 - Necessário se você quiser utilizar a configuração padrão de templates.
-* python-multipart - Necessário se você quiser suporte com "parsing" de formulário, com `request.form()`.
+* python-multipart - Necessário se você quiser suporte com "parsing" de formulário, com `request.form()`.
* itsdangerous - Necessário para suporte a `SessionMiddleware`.
* pyyaml - Necessário para suporte a `SchemaGenerator` da Starlette (você provavelmente não precisará disso com o FastAPI).
* graphene - Necessário para suporte a `GraphQLApp`.
-* ujson - Necessário se você quer utilizar `UJSONResponse`.
Usados por FastAPI / Starlette:
* uvicorn - para o servidor que carrega e serve sua aplicação.
* orjson - Necessário se você quer utilizar `ORJSONResponse`.
+* ujson - Necessário se você quer utilizar `UJSONResponse`.
Você pode instalar todas essas dependências com `pip install fastapi[all]`.
diff --git a/docs/pt/docs/learn/index.md b/docs/pt/docs/learn/index.md
new file mode 100644
index 000000000..b9a7f5972
--- /dev/null
+++ b/docs/pt/docs/learn/index.md
@@ -0,0 +1,5 @@
+# Aprender
+
+Nesta parte da documentação encontramos as seções introdutórias e os tutoriais para aprendermos como usar o **FastAPI**.
+
+Nós poderíamos considerar isto um **livro**, **curso**, a maneira **oficial** e recomendada de aprender o FastAPI. 😎
diff --git a/docs/pt/docs/python-types.md b/docs/pt/docs/python-types.md
index 9f12211c7..52b2dad8e 100644
--- a/docs/pt/docs/python-types.md
+++ b/docs/pt/docs/python-types.md
@@ -266,7 +266,7 @@ E então, novamente, você recebe todo o suporte do editor:
## Modelos Pydantic
- Pydantic é uma biblioteca Python para executar a validação de dados.
+ Pydantic é uma biblioteca Python para executar a validação de dados.
Você declara a "forma" dos dados como classes com atributos.
@@ -283,7 +283,7 @@ Retirado dos documentos oficiais dos Pydantic:
```
!!! info "Informação"
- Para saber mais sobre o Pydantic, verifique seus documentos .
+ Para saber mais sobre o Pydantic, verifique seus documentos .
**FastAPI** é todo baseado em Pydantic.
diff --git a/docs/pt/docs/resources/index.md b/docs/pt/docs/resources/index.md
new file mode 100644
index 000000000..6eff8f9e7
--- /dev/null
+++ b/docs/pt/docs/resources/index.md
@@ -0,0 +1,3 @@
+# Recursos
+
+Material complementar, links externos, artigos e muito mais. ✈️
diff --git a/docs/pt/docs/tutorial/body-multiple-params.md b/docs/pt/docs/tutorial/body-multiple-params.md
index 0eaa9664c..7d0435a6b 100644
--- a/docs/pt/docs/tutorial/body-multiple-params.md
+++ b/docs/pt/docs/tutorial/body-multiple-params.md
@@ -20,7 +20,7 @@ E você também pode declarar parâmetros de corpo como opcionais, definindo o v
{!> ../../../docs_src/body_multiple_params/tutorial001.py!}
```
-!!! nota
+!!! note "Nota"
Repare que, neste caso, o `item` que seria capturado a partir do corpo é opcional. Visto que ele possui `None` como valor padrão.
## Múltiplos parâmetros de corpo
@@ -69,7 +69,7 @@ Então, ele usará o nome dos parâmetros como chaves (nome dos campos) no corpo
}
```
-!!! nota
+!!! note "Nota"
Repare que mesmo que o `item` esteja declarado da mesma maneira que antes, agora é esperado que ele esteja dentro do corpo com uma chave `item`.
diff --git a/docs/pt/docs/tutorial/body-nested-models.md b/docs/pt/docs/tutorial/body-nested-models.md
index 8ab77173e..c9d0b8bb6 100644
--- a/docs/pt/docs/tutorial/body-nested-models.md
+++ b/docs/pt/docs/tutorial/body-nested-models.md
@@ -121,7 +121,7 @@ Novamente, apenas fazendo essa declaração, com o **FastAPI**, você ganha:
Além dos tipos singulares normais como `str`, `int`, `float`, etc. Você também pode usar tipos singulares mais complexos que herdam de `str`.
-Para ver todas as opções possíveis, cheque a documentação para ostipos exoticos do Pydantic. Você verá alguns exemplos no próximo capitulo.
+Para ver todas as opções possíveis, cheque a documentação para ostipos exoticos do Pydantic. Você verá alguns exemplos no próximo capitulo.
Por exemplo, no modelo `Image` nós temos um campo `url`, nós podemos declara-lo como um `HttpUrl` do Pydantic invés de como uma `str`:
@@ -165,7 +165,7 @@ Isso vai esperar(converter, validar, documentar, etc) um corpo JSON tal qual:
}
```
-!!! Informação
+!!! info "informação"
Note como o campo `images` agora tem uma lista de objetos de image.
## Modelos profundamente aninhados
@@ -176,7 +176,7 @@ Você pode definir modelos profundamente aninhados de forma arbitrária:
{!../../../docs_src/body_nested_models/tutorial007.py!}
```
-!!! Informação
+!!! info "informação"
Note como `Offer` tem uma lista de `Item`s, que por sua vez possui opcionalmente uma lista `Image`s
## Corpos de listas puras
@@ -226,7 +226,7 @@ Neste caso, você aceitaria qualquer `dict`, desde que tenha chaves` int` com va
{!../../../docs_src/body_nested_models/tutorial009.py!}
```
-!!! Dica
+!!! tip "Dica"
Leve em condideração que o JSON só suporta `str` como chaves.
Mas o Pydantic tem conversão automática de dados.
diff --git a/docs/pt/docs/tutorial/body.md b/docs/pt/docs/tutorial/body.md
index 99e05ab77..713bea2d1 100644
--- a/docs/pt/docs/tutorial/body.md
+++ b/docs/pt/docs/tutorial/body.md
@@ -6,7 +6,7 @@ O corpo da **requisição** é a informação enviada pelo cliente para sua API.
Sua API quase sempre irá enviar um corpo na **resposta**. Mas os clientes não necessariamente precisam enviar um corpo em toda **requisição**.
-Para declarar um corpo da **requisição**, você utiliza os modelos do Pydantic com todos os seus poderes e benefícios.
+Para declarar um corpo da **requisição**, você utiliza os modelos do Pydantic com todos os seus poderes e benefícios.
!!! info "Informação"
Para enviar dados, você deve usar utilizar um dos métodos: `POST` (Mais comum), `PUT`, `DELETE` ou `PATCH`.
@@ -162,4 +162,4 @@ Os parâmetros da função serão reconhecidos conforme abaixo:
## Sem o Pydantic
-Se você não quer utilizar os modelos Pydantic, você também pode utilizar o parâmetro **Body**. Veja a documentação para [Body - Parâmetros múltiplos: Valores singulares no body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
+Se você não quer utilizar os modelos Pydantic, você também pode utilizar o parâmetro **Body**. Veja a documentação para [Body - Parâmetros múltiplos: Valores singulares no body](body-multiple-params.md#valores-singulares-no-corpo){.internal-link target=_blank}.
diff --git a/docs/pt/docs/tutorial/encoder.md b/docs/pt/docs/tutorial/encoder.md
index b9bfbf63b..7a8d20515 100644
--- a/docs/pt/docs/tutorial/encoder.md
+++ b/docs/pt/docs/tutorial/encoder.md
@@ -38,5 +38,5 @@ O resultado de chamar a função é algo que pode ser codificado com o padrão d
A função não retorna um grande `str` contendo os dados no formato JSON (como uma string). Mas sim, retorna uma estrutura de dados padrão do Python (por exemplo, um `dict`) com valores e subvalores compatíveis com JSON.
-!!! nota
+!!! note "Nota"
`jsonable_encoder` é realmente usado pelo **FastAPI** internamente para converter dados. Mas também é útil em muitos outros cenários.
diff --git a/docs/pt/docs/tutorial/extra-data-types.md b/docs/pt/docs/tutorial/extra-data-types.md
index e4b9913dc..5d50d8942 100644
--- a/docs/pt/docs/tutorial/extra-data-types.md
+++ b/docs/pt/docs/tutorial/extra-data-types.md
@@ -36,7 +36,7 @@ Aqui estão alguns dos tipos de dados adicionais que você pode usar:
* `datetime.timedelta`:
* O `datetime.timedelta` do Python.
* Em requisições e respostas será representado como um `float` de segundos totais.
- * O Pydantic também permite representá-lo como uma "codificação ISO 8601 diferença de tempo", cheque a documentação para mais informações.
+ * O Pydantic também permite representá-lo como uma "codificação ISO 8601 diferença de tempo", cheque a documentação para mais informações.
* `frozenset`:
* Em requisições e respostas, será tratado da mesma forma que um `set`:
* Nas requisições, uma lista será lida, eliminando duplicadas e convertendo-a em um `set`.
@@ -49,7 +49,7 @@ Aqui estão alguns dos tipos de dados adicionais que você pode usar:
* `Decimal`:
* O `Decimal` padrão do Python.
* Em requisições e respostas será representado como um `float`.
-* Você pode checar todos os tipos de dados válidos do Pydantic aqui: Tipos de dados do Pydantic.
+* Você pode checar todos os tipos de dados válidos do Pydantic aqui: Tipos de dados do Pydantic.
## Exemplo
diff --git a/docs/pt/docs/tutorial/extra-models.md b/docs/pt/docs/tutorial/extra-models.md
index 1343a3ae4..3b1f6ee54 100644
--- a/docs/pt/docs/tutorial/extra-models.md
+++ b/docs/pt/docs/tutorial/extra-models.md
@@ -179,7 +179,7 @@ Isso será definido no OpenAPI com `anyOf`.
Para fazer isso, use a dica de tipo padrão do Python `typing.Union`:
!!! note
- Ao definir um `Union`, inclua o tipo mais específico primeiro, seguido pelo tipo menos específico. No exemplo abaixo, o tipo mais específico `PlaneItem` vem antes de `CarItem` em `Union[PlaneItem, CarItem]`.
+ Ao definir um `Union`, inclua o tipo mais específico primeiro, seguido pelo tipo menos específico. No exemplo abaixo, o tipo mais específico `PlaneItem` vem antes de `CarItem` em `Union[PlaneItem, CarItem]`.
=== "Python 3.8 and above"
diff --git a/docs/pt/docs/tutorial/first-steps.md b/docs/pt/docs/tutorial/first-steps.md
index 9fcdaf91f..619a68601 100644
--- a/docs/pt/docs/tutorial/first-steps.md
+++ b/docs/pt/docs/tutorial/first-steps.md
@@ -24,7 +24,7 @@ $ uvicorn main:app --reload
+
+### `Body` com vários `examples`
+
+Alternativamente ao único `example`, você pode passar `examples` usando um `dict` com **vários examples**, cada um com informações extras que serão adicionadas no **OpenAPI** também.
+
+As chaves do `dict` identificam cada exemplo, e cada valor é outro `dict`.
+
+Cada `dict` de exemplo específico em `examples` pode conter:
+
+* `summary`: Pequena descrição do exemplo.
+* `description`: Uma descrição longa que pode conter texto em Markdown.
+* `value`: O próprio exemplo mostrado, ex: um `dict`.
+* `externalValue`: alternativa ao `value`, uma URL apontando para o exemplo. Embora isso possa não ser suportado por tantas ferramentas quanto `value`.
+
+```Python hl_lines="22-48"
+{!../../../docs_src/schema_extra_example/tutorial004.py!}
+```
+
+### Exemplos na UI da documentação
+
+Com `examples` adicionado a `Body()`, os `/docs` vão ficar assim:
+
+
+
+## Detalhes técnicos
+
+!!! warning "Atenção"
+ Esses são detalhes muito técnicos sobre os padrões **JSON Schema** e **OpenAPI**.
+
+ Se as ideias explicadas acima já funcionam para você, isso pode ser o suficiente, e você provavelmente não precisa desses detalhes, fique à vontade para pular.
+
+Quando você adiciona um exemplo dentro de um modelo Pydantic, usando `schema_extra` ou` Field(example="something") `esse exemplo é adicionado ao **JSON Schema** para esse modelo Pydantic.
+
+E esse **JSON Schema** do modelo Pydantic está incluído no **OpenAPI** da sua API e, em seguida, é usado na UI da documentação.
+
+O **JSON Schema** na verdade não tem um campo `example` nos padrões. Versões recentes do JSON Schema definem um campo `examples`, mas o OpenAPI 3.0.3 é baseado numa versão mais antiga do JSON Schema que não tinha `examples`.
+
+Por isso, o OpenAPI 3.0.3 definiu o seu próprio `example` para a versão modificada do **JSON Schema** que é usada, para o mesmo próposito (mas é apenas `example` no singular, não `examples`), e é isso que é usado pela UI da documentação da API(usando o Swagger UI).
+
+Portanto, embora `example` não seja parte do JSON Schema, é parte da versão customizada do JSON Schema usada pelo OpenAPI, e é isso que vai ser usado dentro da UI de documentação.
+
+Mas quando você usa `example` ou `examples` com qualquer um dos outros utilitários (`Query()`, `Body()`, etc.) esses exemplos não são adicionados ao JSON Schema que descreve esses dados (nem mesmo para versão própria do OpenAPI do JSON Schema), eles são adicionados diretamente à declaração da *operação de rota* no OpenAPI (fora das partes do OpenAPI que usam o JSON Schema).
+
+Para `Path()`, `Query()`, `Header()`, e `Cookie()`, o `example` e `examples` são adicionados a definição do OpenAPI, dentro do `Parameter Object` (na especificação).
+
+E para `Body()`, `File()`, e `Form()`, o `example` e `examples` são de maneira equivalente adicionados para a definição do OpenAPI, dentro do `Request Body Object`, no campo `content`, no `Media Type Object` (na especificação).
+
+Por outro lado, há uma versão mais recente do OpenAPI: **3.1.0**, lançada recentemente. Baseado no JSON Schema mais recente e a maioria das modificações da versão customizada do OpenAPI do JSON Schema são removidas, em troca dos recursos das versões recentes do JSON Schema, portanto, todas essas pequenas diferenças são reduzidas. No entanto, a UI do Swagger atualmente não oferece suporte a OpenAPI 3.1.0, então, por enquanto, é melhor continuar usando as opções acima.
diff --git a/docs/pt/docs/tutorial/security/first-steps.md b/docs/pt/docs/tutorial/security/first-steps.md
index ed07d1c96..4331a0bc3 100644
--- a/docs/pt/docs/tutorial/security/first-steps.md
+++ b/docs/pt/docs/tutorial/security/first-steps.md
@@ -25,8 +25,8 @@ Copie o exemplo em um arquivo `main.py`:
## Execute-o
-!!! informação
- Primeiro, instale `python-multipart`.
+!!! info "informação"
+ Primeiro, instale `python-multipart`.
Ex: `pip install python-multipart`.
@@ -52,7 +52,7 @@ Você verá algo deste tipo:
-!!! marque o "botão de Autorizar!"
+!!! check "Botão de Autorizar!"
Você já tem um novo "botão de autorizar!".
E seu *path operation* tem um pequeno cadeado no canto superior direito que você pode clicar.
@@ -61,7 +61,7 @@ E se você clicar, você terá um pequeno formulário de autorização para digi
-!!! nota
+!!! note "Nota"
Não importa o que você digita no formulário, não vai funcionar ainda. Mas nós vamos chegar lá.
Claro que este não é o frontend para os usuários finais, mas é uma ótima ferramenta automática para documentar interativamente toda sua API.
@@ -104,7 +104,7 @@ Então, vamos rever de um ponto de vista simplificado:
Neste exemplo, nós vamos usar o **OAuth2** com o fluxo de **Senha**, usando um token **Bearer**. Fazemos isso usando a classe `OAuth2PasswordBearer`.
-!!! informação
+!!! info "informação"
Um token "bearer" não é a única opção.
Mas é a melhor no nosso caso.
@@ -119,7 +119,7 @@ Quando nós criamos uma instância da classe `OAuth2PasswordBearer`, nós passam
{!../../../docs_src/security/tutorial001.py!}
```
-!!! dica
+!!! tip "Dica"
Esse `tokenUrl="token"` se refere a uma URL relativa que nós não criamos ainda. Como é uma URL relativa, é equivalente a `./token`.
Porque estamos usando uma URL relativa, se sua API estava localizada em `https://example.com/`, então irá referir-se à `https://example.com/token`. Mas se sua API estava localizada em `https://example.com/api/v1/`, então irá referir-se à `https://example.com/api/v1/token`.
@@ -130,7 +130,7 @@ Esse parâmetro não cria um endpoint / *path operation*, mas declara que a URL
Em breve também criaremos o atual path operation.
-!!! informação
+!!! info "informação"
Se você é um "Pythonista" muito rigoroso, você pode não gostar do estilo do nome do parâmetro `tokenUrl` em vez de `token_url`.
Isso ocorre porque está utilizando o mesmo nome que está nas especificações do OpenAPI. Então, se você precisa investigar mais sobre qualquer um desses esquemas de segurança, você pode simplesmente copiar e colar para encontrar mais informações sobre isso.
@@ -157,7 +157,7 @@ Esse dependência vai fornecer uma `str` que é atribuído ao parâmetro `token
A **FastAPI** saberá que pode usar essa dependência para definir um "esquema de segurança" no esquema da OpenAPI (e na documentação da API automática).
-!!! informação "Detalhes técnicos"
+!!! info "Detalhes técnicos"
**FastAPI** saberá que pode usar a classe `OAuth2PasswordBearer` (declarada na dependência) para definir o esquema de segurança na OpenAPI porque herda de `fastapi.security.oauth2.OAuth2`, que por sua vez herda de `fastapi.security.base.Securitybase`.
Todos os utilitários de segurança que se integram com OpenAPI (e na documentação da API automática) herdam de `SecurityBase`, é assim que **FastAPI** pode saber como integrá-los no OpenAPI.
diff --git a/docs/ru/docs/alternatives.md b/docs/ru/docs/alternatives.md
index 9e3c497d1..24a45fa55 100644
--- a/docs/ru/docs/alternatives.md
+++ b/docs/ru/docs/alternatives.md
@@ -384,7 +384,7 @@ Hug был одним из первых фреймворков, реализов
## Что используется в **FastAPI**
-### Pydantic
+### Pydantic
Pydantic - это библиотека для валидации данных, сериализации и документирования (используя JSON Schema), основываясь на подсказках типов Python, что делает его чрезвычайно интуитивным.
diff --git a/docs/ru/docs/async.md b/docs/ru/docs/async.md
index 4c44fc22d..20dbb108b 100644
--- a/docs/ru/docs/async.md
+++ b/docs/ru/docs/async.md
@@ -468,7 +468,7 @@ Starlette (и **FastAPI**) основаны на
Ещё раз повторим, что все эти технические подробности полезны, только если вы специально их искали.
-В противном случае просто ознакомьтесь с основными принципами в разделе выше: Нет времени?.
+В противном случае просто ознакомьтесь с основными принципами в разделе выше: Нет времени?.
diff --git a/docs/ru/docs/deployment/concepts.md b/docs/ru/docs/deployment/concepts.md
index 681acf15e..26db356c1 100644
--- a/docs/ru/docs/deployment/concepts.md
+++ b/docs/ru/docs/deployment/concepts.md
@@ -1,6 +1,6 @@
# Концепции развёртывания
-Существует несколько концепций, применяемых для развёртывания приложений **FastAPI**, равно как и для любых других типов веб-приложений, среди которых Вы можете выбрать **наиболее подходящий** способ.
+Существует несколько концепций, применяемых для развёртывания приложений **FastAPI**, равно как и для любых других типов веб-приложений, среди которых вы можете выбрать **наиболее подходящий** способ.
Самые важные из них:
@@ -13,11 +13,11 @@
Рассмотрим ниже влияние каждого из них на процесс **развёртывания**.
-Наша конечная цель - **обслуживать клиентов Вашего API безопасно** и **бесперебойно**, с максимально эффективным использованием **вычислительных ресурсов** (например, удалённых серверов/виртуальных машин). 🚀
+Наша конечная цель - **обслуживать клиентов вашего API безопасно** и **бесперебойно**, с максимально эффективным использованием **вычислительных ресурсов** (например, удалённых серверов/виртуальных машин). 🚀
-Здесь я немного расскажу Вам об этих **концепциях** и надеюсь, что у Вас сложится **интуитивное понимание**, какой способ выбрать при развертывании Вашего API в различных окружениях, возможно, даже **ещё не существующих**.
+Здесь я немного расскажу Вам об этих **концепциях** и надеюсь, что у вас сложится **интуитивное понимание**, какой способ выбрать при развертывании вашего API в различных окружениях, возможно, даже **ещё не существующих**.
-Ознакомившись с этими концепциями, Вы сможете **оценить и выбрать** лучший способ развёртывании **Вашего API**.
+Ознакомившись с этими концепциями, вы сможете **оценить и выбрать** лучший способ развёртывании **Вашего API**.
В последующих главах я предоставлю Вам **конкретные рецепты** развёртывания приложения FastAPI.
@@ -25,15 +25,15 @@
## Использование более безопасного протокола HTTPS
-В [предыдущей главе об HTTPS](./https.md){.internal-link target=_blank} мы рассмотрели, как HTTPS обеспечивает шифрование для Вашего API.
+В [предыдущей главе об HTTPS](https.md){.internal-link target=_blank} мы рассмотрели, как HTTPS обеспечивает шифрование для вашего API.
-Также мы заметили, что обычно для работы с HTTPS Вашему приложению нужен **дополнительный** компонент - **прокси-сервер завершения работы TLS**.
+Также мы заметили, что обычно для работы с HTTPS вашему приложению нужен **дополнительный** компонент - **прокси-сервер завершения работы TLS**.
И если прокси-сервер не умеет сам **обновлять сертификаты HTTPS**, то нужен ещё один компонент для этого действия.
### Примеры инструментов для работы с HTTPS
-Вот некоторые инструменты, которые Вы можете применять как прокси-серверы:
+Вот некоторые инструменты, которые вы можете применять как прокси-серверы:
* Traefik
* С автоматическим обновлением сертификатов ✨
@@ -47,7 +47,7 @@
* С дополнительным компонентом типа cert-manager для обновления сертификатов
* Использование услуг облачного провайдера (читайте ниже 👇)
-В последнем варианте Вы можете воспользоваться услугами **облачного сервиса**, который сделает большую часть работы, включая настройку HTTPS. Это может наложить дополнительные ограничения или потребовать дополнительную плату и т.п. Зато Вам не понадобится самостоятельно заниматься настройками прокси-сервера.
+В последнем варианте вы можете воспользоваться услугами **облачного сервиса**, который сделает большую часть работы, включая настройку HTTPS. Это может наложить дополнительные ограничения или потребовать дополнительную плату и т.п. Зато Вам не понадобится самостоятельно заниматься настройками прокси-сервера.
В дальнейшем я покажу Вам некоторые конкретные примеры их применения.
@@ -63,7 +63,7 @@
Термином **программа** обычно описывают множество вещей:
-* **Код**, который Вы написали, в нашем случае **Python-файлы**.
+* **Код**, который вы написали, в нашем случае **Python-файлы**.
* **Файл**, который может быть **исполнен** операционной системой, например `python`, `python.exe` или `uvicorn`.
* Конкретная программа, **запущенная** операционной системой и использующая центральный процессор и память. В таком случае это также называется **процесс**.
@@ -74,13 +74,13 @@
* Конкретная программа, **запущенная** операционной системой.
* Это не имеет отношения к какому-либо файлу или коду, но нечто **определённое**, управляемое и **выполняемое** операционной системой.
* Любая программа, любой код, **могут делать что-то** только когда они **выполняются**. То есть, когда являются **работающим процессом**.
-* Процесс может быть **прерван** (или "убит") Вами или Вашей операционной системой. В результате чего он перестанет исполняться и **не будет продолжать делать что-либо**.
-* Каждое приложение, которое Вы запустили на своём компьютере, каждая программа, каждое "окно" запускает какой-то процесс. И обычно на включенном компьютере **одновременно** запущено множество процессов.
+* Процесс может быть **прерван** (или "убит") Вами или вашей операционной системой. В результате чего он перестанет исполняться и **не будет продолжать делать что-либо**.
+* Каждое приложение, которое вы запустили на своём компьютере, каждая программа, каждое "окно" запускает какой-то процесс. И обычно на включенном компьютере **одновременно** запущено множество процессов.
* И **одна программа** может запустить **несколько параллельных процессов**.
-Если Вы заглянете в "диспетчер задач" или "системный монитор" (или аналогичные инструменты) Вашей операционной системы, то увидите множество работающих процессов.
+Если вы заглянете в "диспетчер задач" или "системный монитор" (или аналогичные инструменты) вашей операционной системы, то увидите множество работающих процессов.
-Вполне вероятно, что Вы увидите несколько процессов с одним и тем же названием браузерной программы (Firefox, Chrome, Edge и т. Д.). Обычно браузеры запускают один процесс на вкладку и вдобавок некоторые дополнительные процессы.
+Вполне вероятно, что вы увидите несколько процессов с одним и тем же названием браузерной программы (Firefox, Chrome, Edge и т. Д.). Обычно браузеры запускают один процесс на вкладку и вдобавок некоторые дополнительные процессы.
@@ -90,21 +90,21 @@
## Настройки запуска приложения
-В большинстве случаев когда Вы создаёте веб-приложение, то желаете, чтоб оно **работало постоянно** и непрерывно, предоставляя клиентам доступ в любое время. Хотя иногда у Вас могут быть причины, чтоб оно запускалось только при определённых условиях.
+В большинстве случаев когда вы создаёте веб-приложение, то желаете, чтоб оно **работало постоянно** и непрерывно, предоставляя клиентам доступ в любое время. Хотя иногда у вас могут быть причины, чтоб оно запускалось только при определённых условиях.
### Удалённый сервер
-Когда Вы настраиваете удалённый сервер (облачный сервер, виртуальную машину и т.п.), самое простое, что можно сделать, запустить Uvicorn (или его аналог) вручную, как Вы делаете при локальной разработке.
+Когда вы настраиваете удалённый сервер (облачный сервер, виртуальную машину и т.п.), самое простое, что можно сделать, запустить Uvicorn (или его аналог) вручную, как вы делаете при локальной разработке.
Это рабочий способ и он полезен **во время разработки**.
-Но если Вы потеряете соединение с сервером, то не сможете отслеживать - работает ли всё ещё **запущенный Вами процесс**.
+Но если вы потеряете соединение с сервером, то не сможете отслеживать - работает ли всё ещё **запущенный Вами процесс**.
-И если сервер перезагрузится (например, после обновления или каких-то действий облачного провайдера), Вы скорее всего **этого не заметите**, чтобы снова запустить процесс вручную. Вследствие этого Ваш API останется мёртвым. 😱
+И если сервер перезагрузится (например, после обновления или каких-то действий облачного провайдера), вы скорее всего **этого не заметите**, чтобы снова запустить процесс вручную. Вследствие этого Ваш API останется мёртвым. 😱
### Автоматический запуск программ
-Вероятно Вы пожелаете, чтоб Ваша серверная программа (такая как Uvicorn) стартовала автоматически при включении сервера, без **человеческого вмешательства** и всегда могла управлять Вашим API (так как Uvicorn запускает приложение FastAPI).
+Вероятно вы захотите, чтоб Ваша серверная программа (такая, как Uvicorn) стартовала автоматически при включении сервера, без **человеческого вмешательства** и всегда могла управлять Вашим API (так как Uvicorn запускает приложение FastAPI).
### Отдельная программа
@@ -127,7 +127,7 @@
## Перезапуск
-Вы, вероятно, также пожелаете, чтоб Ваше приложение **перезапускалось**, если в нём произошёл сбой.
+Вы, вероятно, также захотите, чтоб ваше приложение **перезапускалось**, если в нём произошёл сбой.
### Мы ошибаемся
@@ -137,7 +137,7 @@
### Небольшие ошибки обрабатываются автоматически
-Когда Вы создаёте свои API на основе FastAPI и допускаете в коде ошибку, то FastAPI обычно остановит её распространение внутри одного запроса, при обработке которого она возникла. 🛡
+Когда вы создаёте свои API на основе FastAPI и допускаете в коде ошибку, то FastAPI обычно остановит её распространение внутри одного запроса, при обработке которого она возникла. 🛡
Клиент получит ошибку **500 Internal Server Error** в ответ на свой запрос, но приложение не сломается и будет продолжать работать с последующими запросами.
@@ -152,11 +152,11 @@
Для случаев, когда ошибки приводят к сбою в запущенном **процессе**, Вам понадобится добавить компонент, который **перезапустит** процесс хотя бы пару раз...
!!! tip "Заметка"
- ... Если приложение падает сразу же после запуска, вероятно бесполезно его бесконечно перезапускать. Но полагаю, Вы заметите такое поведение во время разработки или, по крайней мере, сразу после развёртывания.
+ ... Если приложение падает сразу же после запуска, вероятно бесполезно его бесконечно перезапускать. Но полагаю, вы заметите такое поведение во время разработки или, по крайней мере, сразу после развёртывания.
Так что давайте сосредоточимся на конкретных случаях, когда приложение может полностью выйти из строя, но всё ещё есть смысл его запустить заново.
-Возможно Вы захотите, чтоб был некий **внешний компонент**, ответственный за перезапуск Вашего приложения даже если уже не работает Uvicorn или Python. То есть ничего из того, что написано в Вашем коде внутри приложения, не может быть выполнено в принципе.
+Возможно вы захотите, чтоб был некий **внешний компонент**, ответственный за перезапуск вашего приложения даже если уже не работает Uvicorn или Python. То есть ничего из того, что написано в вашем коде внутри приложения, не может быть выполнено в принципе.
### Примеры инструментов для автоматического перезапуска
@@ -181,13 +181,13 @@
### Множество процессов - Воркеры (Workers)
-Если количество Ваших клиентов больше, чем может обслужить один процесс (допустим, что виртуальная машина не слишком мощная), но при этом Вам доступно **несколько ядер процессора**, то Вы можете запустить **несколько процессов** одного и того же приложения параллельно и распределить запросы между этими процессами.
+Если количество Ваших клиентов больше, чем может обслужить один процесс (допустим, что виртуальная машина не слишком мощная), но при этом Вам доступно **несколько ядер процессора**, то вы можете запустить **несколько процессов** одного и того же приложения параллельно и распределить запросы между этими процессами.
**Несколько запущенных процессов** одной и той же API-программы часто называют **воркерами**.
### Процессы и порты́
-Помните ли Вы, как на странице [Об HTTPS](./https.md){.internal-link target=_blank} мы обсуждали, что на сервере только один процесс может слушать одну комбинацию IP-адреса и порта?
+Помните ли Вы, как на странице [Об HTTPS](https.md){.internal-link target=_blank} мы обсуждали, что на сервере только один процесс может слушать одну комбинацию IP-адреса и порта?
С тех пор ничего не изменилось.
@@ -197,11 +197,11 @@
Работающая программа загружает в память данные, необходимые для её работы, например, переменные содержащие модели машинного обучения или большие файлы. Каждая переменная **потребляет некоторое количество оперативной памяти (RAM)** сервера.
-Обычно процессы **не делятся памятью друг с другом**. Сие означает, что каждый работающий процесс имеет свои данные, переменные и свой кусок памяти. И если для выполнения Вашего кода процессу нужно много памяти, то **каждый такой же процесс** запущенный дополнительно, потребует такого же количества памяти.
+Обычно процессы **не делятся памятью друг с другом**. Сие означает, что каждый работающий процесс имеет свои данные, переменные и свой кусок памяти. И если для выполнения вашего кода процессу нужно много памяти, то **каждый такой же процесс** запущенный дополнительно, потребует такого же количества памяти.
### Память сервера
-Допустим, что Ваш код загружает модель машинного обучения **размером 1 ГБ**. Когда Вы запустите своё API как один процесс, он займёт в оперативной памяти не менее 1 ГБ. А если Вы запустите **4 таких же процесса** (4 воркера), то каждый из них займёт 1 ГБ оперативной памяти. В результате Вашему API потребуется **4 ГБ оперативной памяти (RAM)**.
+Допустим, что Ваш код загружает модель машинного обучения **размером 1 ГБ**. Когда вы запустите своё API как один процесс, он займёт в оперативной памяти не менее 1 ГБ. А если вы запустите **4 таких же процесса** (4 воркера), то каждый из них займёт 1 ГБ оперативной памяти. В результате вашему API потребуется **4 ГБ оперативной памяти (RAM)**.
И если Ваш удалённый сервер или виртуальная машина располагает только 3 ГБ памяти, то попытка загрузить в неё 4 ГБ данных вызовет проблемы. 🚨
@@ -211,15 +211,15 @@
Менеджер процессов будет слушать определённый **сокет** (IP:порт) и передавать данные работающим процессам.
-Каждый из этих процессов будет запускать Ваше приложение для обработки полученного **запроса** и возвращения вычисленного **ответа** и они будут использовать оперативную память.
+Каждый из этих процессов будет запускать ваше приложение для обработки полученного **запроса** и возвращения вычисленного **ответа** и они будут использовать оперативную память.
HTTPX - Обязательно, если вы хотите использовать `TestClient`.
* jinja2 - Обязательно, если вы хотите использовать конфигурацию шаблона по умолчанию.
-* python-multipart - Обязательно, если вы хотите поддерживать форму "парсинга" с помощью `request.form()`.
+* python-multipart - Обязательно, если вы хотите поддерживать форму "парсинга" с помощью `request.form()`.
* itsdangerous - Обязательно, для поддержки `SessionMiddleware`.
* pyyaml - Обязательно, для поддержки `SchemaGenerator` Starlette (возможно, вам это не нужно с FastAPI).
-* ujson - Обязательно, если вы хотите использовать `UJSONResponse`.
Используется FastAPI / Starlette:
* uvicorn - сервер, который загружает и обслуживает ваше приложение.
* orjson - Обязательно, если вы хотите использовать `ORJSONResponse`.
+* ujson - Обязательно, если вы хотите использовать `UJSONResponse`.
Вы можете установить все это с помощью `pip install "fastapi[all]"`.
diff --git a/docs/ru/docs/python-types.md b/docs/ru/docs/python-types.md
index 7523083c8..3c8492c67 100644
--- a/docs/ru/docs/python-types.md
+++ b/docs/ru/docs/python-types.md
@@ -265,7 +265,7 @@ John Doe
## Pydantic-модели
-Pydantic является Python-библиотекой для выполнения валидации данных.
+Pydantic является Python-библиотекой для выполнения валидации данных.
Вы объявляете «форму» данных как классы с атрибутами.
@@ -282,7 +282,7 @@ John Doe
```
!!! info
- Чтобы узнать больше о Pydantic, читайте его документацию.
+ Чтобы узнать больше о Pydantic, читайте его документацию.
**FastAPI** целиком основан на Pydantic.
diff --git a/docs/ru/docs/tutorial/body-multiple-params.md b/docs/ru/docs/tutorial/body-multiple-params.md
index e52ef6f6f..ffba1d0f4 100644
--- a/docs/ru/docs/tutorial/body-multiple-params.md
+++ b/docs/ru/docs/tutorial/body-multiple-params.md
@@ -28,7 +28,7 @@
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="17-19"
@@ -37,14 +37,14 @@
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать версию с `Annotated`, если это возможно.
```Python hl_lines="19-21"
{!> ../../../docs_src/body_multiple_params/tutorial001.py!}
```
-!!! Заметка
+!!! note "Заметка"
Заметьте, что в данном случае параметр `item`, который будет взят из тела запроса, необязателен. Так как было установлено значение `None` по умолчанию.
## Несколько параметров тела запроса
@@ -93,7 +93,7 @@
}
```
-!!! Внимание
+!!! note "Внимание"
Обратите внимание, что хотя параметр `item` был объявлен таким же способом, как и раньше, теперь предпологается, что он находится внутри тела с ключом `item`.
@@ -131,7 +131,7 @@
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="20"
@@ -140,7 +140,7 @@
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="22"
@@ -205,7 +205,7 @@ q: str | None = None
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="25"
@@ -214,14 +214,14 @@ q: str | None = None
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="27"
{!> ../../../docs_src/body_multiple_params/tutorial004.py!}
```
-!!! Информация
+!!! info "Информация"
`Body` также имеет все те же дополнительные параметры валидации и метаданных, как у `Query`,`Path` и других, которые вы увидите позже.
## Добавление одного body-параметра
@@ -258,7 +258,7 @@ item: Item = Body(embed=True)
=== "Python 3.10+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="15"
@@ -267,7 +267,7 @@ item: Item = Body(embed=True)
=== "Python 3.8+ non-Annotated"
- !!! Заметка
+ !!! tip "Заметка"
Рекомендуется использовать `Annotated` версию, если это возможно.
```Python hl_lines="17"
diff --git a/docs/ru/docs/tutorial/body-nested-models.md b/docs/ru/docs/tutorial/body-nested-models.md
index bbf9b7685..51a32ba56 100644
--- a/docs/ru/docs/tutorial/body-nested-models.md
+++ b/docs/ru/docs/tutorial/body-nested-models.md
@@ -192,7 +192,7 @@ my_list: List[str]
Помимо обычных простых типов, таких как `str`, `int`, `float`, и т.д. Вы можете использовать более сложные базовые типы, которые наследуются от типа `str`.
-Чтобы увидеть все варианты, которые у вас есть, ознакомьтесь с документацией по необычным типам Pydantic. Вы увидите некоторые примеры в следующей главе.
+Чтобы увидеть все варианты, которые у вас есть, ознакомьтесь с документацией по необычным типам Pydantic. Вы увидите некоторые примеры в следующей главе.
Например, так как в модели `Image` у нас есть поле `url`, то мы можем объявить его как тип `HttpUrl` из модуля Pydantic вместо типа `str`:
diff --git a/docs/ru/docs/tutorial/body-updates.md b/docs/ru/docs/tutorial/body-updates.md
new file mode 100644
index 000000000..4998ab31a
--- /dev/null
+++ b/docs/ru/docs/tutorial/body-updates.md
@@ -0,0 +1,153 @@
+# Body - Обновления
+
+## Полное обновление с помощью `PUT`
+
+Для полного обновления элемента можно воспользоваться операцией HTTP `PUT`.
+
+Вы можете использовать функцию `jsonable_encoder` для преобразования входных данных в JSON, так как нередки случаи, когда работать можно только с простыми типами данных (например, для хранения в NoSQL-базе данных).
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="28-33"
+ {!> ../../../docs_src/body_updates/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="30-35"
+ {!> ../../../docs_src/body_updates/tutorial001_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="30-35"
+ {!> ../../../docs_src/body_updates/tutorial001.py!}
+ ```
+
+`PUT` используется для получения данных, которые должны полностью заменить существующие данные.
+
+### Предупреждение о замене
+
+Это означает, что если вы хотите обновить элемент `bar`, используя `PUT` с телом, содержащим:
+
+```Python
+{
+ "name": "Barz",
+ "price": 3,
+ "description": None,
+}
+```
+
+поскольку оно не включает уже сохраненный атрибут `"tax": 20.2`, входная модель примет значение по умолчанию `"tax": 10.5`.
+
+И данные будут сохранены с этим "новым" `tax`, равным `10,5`.
+
+## Частичное обновление с помощью `PATCH`
+
+Также можно использовать HTTP `PATCH` операцию для *частичного* обновления данных.
+
+Это означает, что можно передавать только те данные, которые необходимо обновить, оставляя остальные нетронутыми.
+
+!!! note "Технические детали"
+ `PATCH` менее распространен и известен, чем `PUT`.
+
+ А многие команды используют только `PUT`, даже для частичного обновления.
+
+ Вы можете **свободно** использовать их как угодно, **FastAPI** не накладывает никаких ограничений.
+
+ Но в данном руководстве более или менее понятно, как они должны использоваться.
+
+### Использование параметра `exclude_unset` в Pydantic
+
+Если необходимо выполнить частичное обновление, то очень полезно использовать параметр `exclude_unset` в методе `.dict()` модели Pydantic.
+
+Например, `item.dict(exclude_unset=True)`.
+
+В результате будет сгенерирован словарь, содержащий только те данные, которые были заданы при создании модели `item`, без учета значений по умолчанию. Затем вы можете использовать это для создания словаря только с теми данными, которые были установлены (отправлены в запросе), опуская значения по умолчанию:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="32"
+ {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="34"
+ {!> ../../../docs_src/body_updates/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="34"
+ {!> ../../../docs_src/body_updates/tutorial002.py!}
+ ```
+
+### Использование параметра `update` в Pydantic
+
+Теперь можно создать копию существующей модели, используя `.copy()`, и передать параметр `update` с `dict`, содержащим данные для обновления.
+
+Например, `stored_item_model.copy(update=update_data)`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="33"
+ {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="35"
+ {!> ../../../docs_src/body_updates/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="35"
+ {!> ../../../docs_src/body_updates/tutorial002.py!}
+ ```
+
+### Кратко о частичном обновлении
+
+В целом, для применения частичных обновлений необходимо:
+
+* (Опционально) использовать `PATCH` вместо `PUT`.
+* Извлечь сохранённые данные.
+* Поместить эти данные в Pydantic модель.
+* Сгенерировать `dict` без значений по умолчанию из входной модели (с использованием `exclude_unset`).
+ * Таким образом, можно обновлять только те значения, которые действительно установлены пользователем, вместо того чтобы переопределять значения, уже сохраненные в модели по умолчанию.
+* Создать копию хранимой модели, обновив ее атрибуты полученными частичными обновлениями (с помощью параметра `update`).
+* Преобразовать скопированную модель в то, что может быть сохранено в вашей БД (например, с помощью `jsonable_encoder`).
+ * Это сравнимо с повторным использованием метода модели `.dict()`, но при этом происходит проверка (и преобразование) значений в типы данных, которые могут быть преобразованы в JSON, например, `datetime` в `str`.
+* Сохранить данные в своей БД.
+* Вернуть обновленную модель.
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="28-35"
+ {!> ../../../docs_src/body_updates/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="30-37"
+ {!> ../../../docs_src/body_updates/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="30-37"
+ {!> ../../../docs_src/body_updates/tutorial002.py!}
+ ```
+
+!!! tip "Подсказка"
+ Эту же технику можно использовать и для операции HTTP `PUT`.
+
+ Но в приведенном примере используется `PATCH`, поскольку он был создан именно для таких случаев использования.
+
+!!! note "Технические детали"
+ Обратите внимание, что входная модель по-прежнему валидируется.
+
+ Таким образом, если вы хотите получать частичные обновления, в которых могут быть опущены все атрибуты, вам необходимо иметь модель, в которой все атрибуты помечены как необязательные (со значениями по умолчанию или `None`).
+
+ Чтобы отличить модели со всеми необязательными значениями для **обновления** от моделей с обязательными значениями для **создания**, можно воспользоваться идеями, описанными в [Дополнительные модели](extra-models.md){.internal-link target=_blank}.
diff --git a/docs/ru/docs/tutorial/body.md b/docs/ru/docs/tutorial/body.md
index c03d40c3f..5d0e033fd 100644
--- a/docs/ru/docs/tutorial/body.md
+++ b/docs/ru/docs/tutorial/body.md
@@ -6,7 +6,7 @@
Ваш API почти всегда отправляет тело **ответа**. Но клиентам не обязательно всегда отправлять тело **запроса**.
-Чтобы объявить тело **запроса**, необходимо использовать модели Pydantic, со всей их мощью и преимуществами.
+Чтобы объявить тело **запроса**, необходимо использовать модели Pydantic, со всей их мощью и преимуществами.
!!! info "Информация"
Чтобы отправить данные, необходимо использовать один из методов: `POST` (обычно), `PUT`, `DELETE` или `PATCH`.
@@ -162,4 +162,4 @@
## Без Pydantic
-Если вы не хотите использовать модели Pydantic, вы все еще можете использовать параметры **тела запроса**. Читайте в документации раздел [Тело - Несколько параметров: Единичные значения в теле](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}.
+Если вы не хотите использовать модели Pydantic, вы все еще можете использовать параметры **тела запроса**. Читайте в документации раздел [Тело - Несколько параметров: Единичные значения в теле](body-multiple-params.md#_2){.internal-link target=_blank}.
diff --git a/docs/ru/docs/tutorial/debugging.md b/docs/ru/docs/tutorial/debugging.md
index 38709e56d..5fc6a2c1f 100644
--- a/docs/ru/docs/tutorial/debugging.md
+++ b/docs/ru/docs/tutorial/debugging.md
@@ -74,7 +74,7 @@ from myapp import app
не будет выполнена.
-!!! Информация
+!!! info "Информация"
Для получения дополнительной информации, ознакомьтесь с официальной документацией Python.
## Запуск вашего кода с помощью отладчика
diff --git a/docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md b/docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
new file mode 100644
index 000000000..2bd096189
--- /dev/null
+++ b/docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
@@ -0,0 +1,139 @@
+# Зависимости в декораторах операции пути
+
+В некоторых случаях, возвращаемое значение зависимости не используется внутри *функции операции пути*.
+
+Или же зависимость не возвращает никакого значения.
+
+Но вам всё-таки нужно, чтобы она выполнилась.
+
+Для таких ситуаций, вместо объявления *функции операции пути* с параметром `Depends`, вы можете добавить список зависимостей `dependencies` в *декоратор операции пути*.
+
+## Добавление `dependencies` в *декоратор операции пути*
+
+*Декоратор операции пути* получает необязательный аргумент `dependencies`.
+
+Это должен быть `list` состоящий из `Depends()`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="19"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="18"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 без Annotated"
+
+ !!! Подсказка
+ Рекомендуется использовать версию с Annotated, если возможно.
+
+ ```Python hl_lines="17"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+Зависимости из dependencies выполнятся так же, как и обычные зависимости. Но их значения (если они были) не будут переданы в *функцию операции пути*.
+
+!!! Подсказка
+ Некоторые редакторы кода определяют неиспользуемые параметры функций и подсвечивают их как ошибку.
+
+ Использование `dependencies` в *декораторе операции пути* гарантирует выполнение зависимостей, избегая при этом предупреждений редактора кода и других инструментов.
+
+ Это также должно помочь предотвратить путаницу у начинающих разработчиков, которые видят неиспользуемые параметры в коде и могут подумать что в них нет необходимости.
+
+!!! Дополнительная информация
+ В этом примере мы используем выдуманные пользовательские заголовки `X-Key` и `X-Token`.
+
+ Но в реальных проектах, при внедрении системы безопасности, вы получите больше пользы используя интегрированные [средства защиты (следующая глава)](../security/index.md){.internal-link target=_blank}.
+
+## Исключения в dependencies и возвращаемые значения
+
+Вы можете использовать те же *функции* зависимостей, что и обычно.
+
+### Требования к зависимостям
+
+Они могут объявлять требования к запросу (например заголовки) или другие подзависимости:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7 12"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 без Annotated"
+
+ !!! Подсказка
+ Рекомендуется использовать версию с Annotated, если возможно.
+
+ ```Python hl_lines="6 11"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+### Вызов исключений
+
+Зависимости из dependencies могут вызывать исключения с помощью `raise`, как и обычные зависимости:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9 14"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 без Annotated"
+
+ !!! Подсказка
+ Рекомендуется использовать версию с Annotated, если возможно.
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+### Возвращаемые значения
+
+И они могут возвращать значения или нет, эти значения использоваться не будут.
+
+Таким образом, вы можете переиспользовать обычную зависимость (возвращающую значение), которую вы уже используете где-то в другом месте, и хотя значение не будет использоваться, зависимость будет выполнена:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+ ```
+
+=== "Python 3.8 без Annotated"
+
+ !!! Подсказка
+ Рекомендуется использовать версию с Annotated, если возможно.
+
+ ```Python hl_lines="9 14"
+ {!> ../../../docs_src/dependencies/tutorial006.py!}
+ ```
+
+## Dependencies для группы *операций путей*
+
+Позже, читая о том как структурировать большие приложения ([Bigger Applications - Multiple Files](../../tutorial/bigger-applications.md){.internal-link target=_blank}), возможно, многофайловые, вы узнаете как объявить единый параметр `dependencies` для всей группы *операций путей*.
+
+## Глобальный Dependencies
+
+Далее мы увидим, как можно добавить dependencies для всего `FastAPI` приложения, так чтобы они применялись к каждой *операции пути*.
diff --git a/docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md
new file mode 100644
index 000000000..cd524cf66
--- /dev/null
+++ b/docs/ru/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -0,0 +1,275 @@
+# Зависимости с yield
+
+FastAPI поддерживает зависимости, которые выполняют некоторые дополнительные действия после завершения работы.
+
+Для этого используйте `yield` вместо `return`, а дополнительный код напишите после него.
+
+!!! tip "Подсказка"
+ Обязательно используйте `yield` один-единственный раз.
+
+!!! note "Технические детали"
+ Любая функция, с которой может работать:
+
+ * `@contextlib.contextmanager` или
+ * `@contextlib.asynccontextmanager`
+
+ будет корректно использоваться в качестве **FastAPI**-зависимости.
+
+ На самом деле, FastAPI использует эту пару декораторов "под капотом".
+
+## Зависимость базы данных с помощью `yield`
+
+Например, с его помощью можно создать сессию работы с базой данных и закрыть его после завершения.
+
+Перед созданием ответа будет выполнен только код до и включая `yield`.
+
+```Python hl_lines="2-4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+Полученное значение и есть то, что будет внедрено в функцию операции пути и другие зависимости:
+
+```Python hl_lines="4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+Код, следующий за оператором `yield`, выполняется после доставки ответа:
+
+```Python hl_lines="5-6"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+!!! tip "Подсказка"
+ Можно использовать как `async` так и обычные функции.
+
+ **FastAPI** это корректно обработает, и в обоих случаях будет делать то же самое, что и с обычными зависимостями.
+
+## Зависимость с `yield` и `try` одновременно
+
+Если использовать блок `try` в зависимости с `yield`, то будет получено всякое исключение, которое было выброшено при использовании зависимости.
+
+Например, если какой-то код в какой-то момент в середине, в другой зависимости или в *функции операции пути*, сделал "откат" транзакции базы данных или создал любую другую ошибку, то вы получите исключение в своей зависимости.
+
+Таким образом, можно искать конкретное исключение внутри зависимости с помощью `except SomeException`.
+
+Таким же образом можно использовать `finally`, чтобы убедиться, что обязательные шаги при выходе выполнены, независимо от того, было ли исключение или нет.
+
+```Python hl_lines="3 5"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+## Подзависимости с `yield`
+
+Вы можете иметь подзависимости и "деревья" подзависимостей любого размера и формы, и любая из них или все они могут использовать `yield`.
+
+**FastAPI** будет следить за тем, чтобы "код по выходу" в каждой зависимости с `yield` выполнялся в правильном порядке.
+
+Например, `dependency_c` может иметь зависимость от `dependency_b`, а `dependency_b` от `dependency_a`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="6 14 22"
+ {!> ../../../docs_src/dependencies/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="5 13 21"
+ {!> ../../../docs_src/dependencies/tutorial008_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "Подсказка"
+ Предпочтительнее использовать версию с аннотацией, если это возможно.
+
+ ```Python hl_lines="4 12 20"
+ {!> ../../../docs_src/dependencies/tutorial008.py!}
+ ```
+
+И все они могут использовать `yield`.
+
+В этом случае `dependency_c` для выполнения своего кода выхода нуждается в том, чтобы значение из `dependency_b` (здесь `dep_b`) было еще доступно.
+
+И, в свою очередь, `dependency_b` нуждается в том, чтобы значение из `dependency_a` (здесь `dep_a`) было доступно для ее завершающего кода.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18-19 26-27"
+ {!> ../../../docs_src/dependencies/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="17-18 25-26"
+ {!> ../../../docs_src/dependencies/tutorial008_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "Подсказка"
+ Предпочтительнее использовать версию с аннотацией, если это возможно.
+
+ ```Python hl_lines="16-17 24-25"
+ {!> ../../../docs_src/dependencies/tutorial008.py!}
+ ```
+
+Точно так же можно иметь часть зависимостей с `yield`, часть с `return`, и какие-то из них могут зависеть друг от друга.
+
+Либо у вас может быть одна зависимость, которая требует несколько других зависимостей с `yield` и т.д.
+
+Комбинации зависимостей могут быть какими вам угодно.
+
+**FastAPI** проследит за тем, чтобы все выполнялось в правильном порядке.
+
+!!! note "Технические детали"
+ Это работает благодаря Контекстным менеджерам в Python.
+
+ **FastAPI** использует их "под капотом" с этой целью.
+
+## Зависимости с `yield` и `HTTPException`
+
+Вы видели, что можно использовать зависимости с `yield` совместно с блоком `try`, отлавливающие исключения.
+
+Таким же образом вы можете поднять исключение `HTTPException` или что-то подобное в завершающем коде, после `yield`.
+
+Код выхода в зависимостях с `yield` выполняется *после* отправки ответа, поэтому [Обработчик исключений](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} уже будет запущен. В коде выхода (после `yield`) нет ничего, перехватывающего исключения, брошенные вашими зависимостями.
+
+Таким образом, если после `yield` возникает `HTTPException`, то стандартный (или любой пользовательский) обработчик исключений, который перехватывает `HTTPException` и возвращает ответ HTTP 400, уже не сможет перехватить это исключение.
+
+Благодаря этому все, что установлено в зависимости (например, сеанс работы с БД), может быть использовано, например, фоновыми задачами.
+
+Фоновые задачи выполняются *после* отправки ответа. Поэтому нет возможности поднять `HTTPException`, так как нет даже возможности изменить уже отправленный ответ.
+
+Но если фоновая задача создает ошибку в БД, то, по крайней мере, можно сделать откат или чисто закрыть сессию в зависимости с помощью `yield`, а также, возможно, занести ошибку в журнал или сообщить о ней в удаленную систему отслеживания.
+
+Если у вас есть код, который, как вы знаете, может вызвать исключение, сделайте самую обычную/"питонячью" вещь и добавьте блок `try` в этот участок кода.
+
+Если у вас есть пользовательские исключения, которые вы хотите обрабатывать *до* возврата ответа и, возможно, модифицировать ответ, даже вызывая `HTTPException`, создайте [Cобственный обработчик исключений](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+
+!!! tip "Подсказка"
+ Вы все еще можете вызывать исключения, включая `HTTPException`, *до* `yield`. Но не после.
+
+Последовательность выполнения примерно такая, как на этой схеме. Время течет сверху вниз. А каждый столбец - это одна из частей, взаимодействующих с кодом или выполняющих код.
+
+```mermaid
+sequenceDiagram
+
+participant client as Client
+participant handler as Exception handler
+participant dep as Dep with yield
+participant operation as Path Operation
+participant tasks as Background tasks
+
+ Note over client,tasks: Can raise exception for dependency, handled after response is sent
+ Note over client,operation: Can raise HTTPException and can change the response
+ client ->> dep: Start request
+ Note over dep: Run code up to yield
+ opt raise
+ dep -->> handler: Raise HTTPException
+ handler -->> client: HTTP error response
+ dep -->> dep: Raise other exception
+ end
+ dep ->> operation: Run dependency, e.g. DB session
+ opt raise
+ operation -->> dep: Raise HTTPException
+ dep -->> handler: Auto forward exception
+ handler -->> client: HTTP error response
+ operation -->> dep: Raise other exception
+ dep -->> handler: Auto forward exception
+ end
+ operation ->> client: Return response to client
+ Note over client,operation: Response is already sent, can't change it anymore
+ opt Tasks
+ operation -->> tasks: Send background tasks
+ end
+ opt Raise other exception
+ tasks -->> dep: Raise other exception
+ end
+ Note over dep: After yield
+ opt Handle other exception
+ dep -->> dep: Handle exception, can't change response. E.g. close DB session.
+ end
+```
+
+!!! info "Дополнительная информация"
+ Клиенту будет отправлен только **один ответ**. Это может быть один из ответов об ошибке или это будет ответ от *операции пути*.
+
+ После отправки одного из этих ответов никакой другой ответ не может быть отправлен.
+
+!!! tip "Подсказка"
+ На этой диаграмме показано "HttpException", но вы также можете вызвать любое другое исключение, для которого вы создаете [Пользовательский обработчик исключений](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+
+ Если вы создадите какое-либо исключение, оно будет передано зависимостям с yield, включая `HttpException`, а затем **снова** обработчикам исключений. Если для этого исключения нет обработчика исключений, то оно будет обработано внутренним "ServerErrorMiddleware" по умолчанию, возвращающим код состояния HTTP 500, чтобы уведомить клиента, что на сервере произошла ошибка.
+
+## Зависимости с `yield`, `HTTPException` и фоновыми задачами
+
+!!! warning "Внимание"
+ Скорее всего, вам не нужны эти технические подробности, вы можете пропустить этот раздел и продолжить ниже.
+
+ Эти подробности полезны, главным образом, если вы использовали версию FastAPI до 0.106.0 и использовали ресурсы из зависимостей с `yield` в фоновых задачах.
+
+До версии FastAPI 0.106.0 вызывать исключения после `yield` было невозможно, код выхода в зависимостях с `yield` выполнялся *после* отправки ответа, поэтому [Обработчик Ошибок](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} уже был бы запущен.
+
+Это было сделано главным образом для того, чтобы позволить использовать те же объекты, "отданные" зависимостями, внутри фоновых задач, поскольку код выхода будет выполняться после завершения фоновых задач.
+
+Тем не менее, поскольку это означало бы ожидание ответа в сети, а также ненужное удержание ресурса в зависимости от доходности (например, соединение с базой данных), это было изменено в FastAPI 0.106.0.
+
+!!! tip "Подсказка"
+
+ Кроме того, фоновая задача обычно представляет собой независимый набор логики, который должен обрабатываться отдельно, со своими собственными ресурсами (например, собственным подключением к базе данных).
+ Таким образом, вы, вероятно, получите более чистый код.
+
+Если вы полагались на это поведение, то теперь вам следует создавать ресурсы для фоновых задач внутри самой фоновой задачи, а внутри использовать только те данные, которые не зависят от ресурсов зависимостей с `yield`.
+
+Например, вместо того чтобы использовать ту же сессию базы данных, вы создадите новую сессию базы данных внутри фоновой задачи и будете получать объекты из базы данных с помощью этой новой сессии. А затем, вместо того чтобы передавать объект из базы данных в качестве параметра в функцию фоновой задачи, вы передадите идентификатор этого объекта, а затем снова получите объект в функции фоновой задачи.
+
+## Контекстные менеджеры
+
+### Что такое "контекстные менеджеры"
+
+"Контекстные менеджеры" - это любые объекты Python, которые можно использовать в операторе `with`.
+
+Например, можно использовать `with` для чтения файла:
+
+```Python
+with open("./somefile.txt") as f:
+ contents = f.read()
+ print(contents)
+```
+
+Под капотом" open("./somefile.txt") создаёт объект называемый "контекстным менеджером".
+
+Когда блок `with` завершается, он обязательно закрывает файл, даже если были исключения.
+
+Когда вы создаете зависимость с помощью `yield`, **FastAPI** внутренне преобразует ее в контекстный менеджер и объединяет с некоторыми другими связанными инструментами.
+
+### Использование менеджеров контекста в зависимостях с помощью `yield`
+
+!!! warning "Внимание"
+ Это более или менее "продвинутая" идея.
+
+ Если вы только начинаете работать с **FastAPI**, то лучше пока пропустить этот пункт.
+
+В Python для создания менеджеров контекста можно создать класс с двумя методами: `__enter__()` и `__exit__()`.
+
+Вы также можете использовать их внутри зависимостей **FastAPI** с `yield`, используя операторы
+`with` или `async with` внутри функции зависимости:
+
+```Python hl_lines="1-9 13"
+{!../../../docs_src/dependencies/tutorial010.py!}
+```
+
+!!! tip "Подсказка"
+ Другой способ создания контекстного менеджера - с помощью:
+
+ * `@contextlib.contextmanager` или
+ * `@contextlib.asynccontextmanager`
+
+ используйте их для оформления функции с одним `yield`.
+
+ Это то, что **FastAPI** использует внутри себя для зависимостей с `yield`.
+
+ Но использовать декораторы для зависимостей FastAPI не обязательно (да и не стоит).
+
+ FastAPI сделает это за вас на внутреннем уровне.
diff --git a/docs/ru/docs/tutorial/dependencies/index.md b/docs/ru/docs/tutorial/dependencies/index.md
new file mode 100644
index 000000000..9fce46b97
--- /dev/null
+++ b/docs/ru/docs/tutorial/dependencies/index.md
@@ -0,0 +1,350 @@
+# Зависимости
+
+**FastAPI** имеет очень мощную и интуитивную систему **Dependency Injection**.
+
+Она проектировалась таким образом, чтобы быть простой в использовании и облегчить любому разработчику интеграцию других компонентов с **FastAPI**.
+
+## Что такое "Dependency Injection" (инъекция зависимости)
+
+**"Dependency Injection"** в программировании означает, что у вашего кода (в данном случае, вашей *функции обработки пути*) есть способы объявить вещи, которые запрашиваются для работы и использования: "зависимости".
+
+И потом эта система (в нашем случае **FastAPI**) организует всё, что требуется, чтобы обеспечить ваш код этой зависимостью (сделать "инъекцию" зависимости).
+
+Это очень полезно, когда вам нужно:
+
+* Обеспечить общую логику (один и тот же алгоритм снова и снова).
+* Общее соединение с базой данных.
+* Обеспечение безопасности, аутентификации, запроса роли и т.п.
+* И многое другое.
+
+Всё это минимизирует повторение кода.
+
+## Первые шаги
+
+Давайте рассмотрим очень простой пример. Он настолько простой, что на данный момент почти бесполезный.
+
+Но таким способом мы можем сфокусироваться на том, как же всё таки работает система **Dependency Injection**.
+
+### Создание зависимости или "зависимого"
+Давайте для начала сфокусируемся на зависимостях.
+
+Это просто функция, которая может принимать все те же параметры, что и *функции обработки пути*:
+=== "Python 3.10+"
+
+ ```Python hl_lines="8-9"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8-11"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9-12"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip "Подсказка"
+ Настоятельно рекомендуем использовать `Annotated` версию насколько это возможно.
+
+ ```Python hl_lines="6-7"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip "Подсказка"
+
+ Настоятельно рекомендуем использовать `Annotated` версию насколько это возможно.
+
+ ```Python hl_lines="8-11"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+**И всё.**
+
+**2 строки.**
+
+И теперь она той же формы и структуры, что и все ваши *функции обработки пути*.
+
+Вы можете думать об *функции обработки пути* как о функции без "декоратора" (без `@app.get("/some-path")`).
+
+И она может возвращать всё, что требуется.
+
+В этом случае, эта зависимость ожидает:
+
+* Необязательный query-параметр `q` с типом `str`
+* Необязательный query-параметр `skip` с типом `int`, и значением по умолчанию `0`
+* Необязательный query-параметр `limit` с типом `int`, и значением по умолчанию `100`
+
+И в конце она возвращает `dict`, содержащий эти значения.
+
+!!! info "Информация"
+
+ **FastAPI** добавил поддержку для `Annotated` (и начал её рекомендовать) в версии 0.95.0.
+
+ Если у вас более старая версия, будут ошибки при попытке использовать `Annotated`.
+
+ Убедитесь, что вы [Обновили FastAPI версию](../../deployment/versions.md#fastapi_2){.internal-link target=_blank} до, как минимум 0.95.1, перед тем как использовать `Annotated`.
+
+### Import `Depends`
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip "Подсказка"
+ Настоятельно рекомендуем использовать `Annotated` версию насколько это возможно.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip "Подсказка"
+ Настоятельно рекомендуем использовать `Annotated` версию насколько это возможно.
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+### Объявите зависимость в "зависимом"
+
+Точно так же, как вы использовали `Body`, `Query` и т.д. с вашей *функцией обработки пути* для параметров, используйте `Depends` с новым параметром:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="13 18"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="15 20"
+ {!> ../../../docs_src/dependencies/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="16 21"
+ {!> ../../../docs_src/dependencies/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip "Подсказка"
+ Настоятельно рекомендуем использовать `Annotated` версию насколько это возможно.
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/dependencies/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip "Подсказка"
+ Настоятельно рекомендуем использовать `Annotated` версию насколько это возможно.
+
+ ```Python hl_lines="15 20"
+ {!> ../../../docs_src/dependencies/tutorial001.py!}
+ ```
+
+`Depends` работает немного иначе. Вы передаёте в `Depends` одиночный параметр, который будет похож на функцию.
+
+Вы **не вызываете его** на месте (не добавляете скобочки в конце: 👎 *your_best_func()*👎), просто передаёте как параметр в `Depends()`.
+
+И потом функция берёт параметры так же, как *функция обработки пути*.
+
+!!! tip "Подсказка"
+ В следующей главе вы увидите, какие другие вещи, помимо функций, можно использовать в качестве зависимостей.
+
+Каждый раз, когда новый запрос приходит, **FastAPI** позаботится о:
+
+* Вызове вашей зависимости ("зависимого") функции с корректными параметрами.
+* Получении результата из вашей функции.
+* Назначении результата в параметр в вашей *функции обработки пути*.
+
+```mermaid
+graph TB
+
+common_parameters(["common_parameters"])
+read_items["/items/"]
+read_users["/users/"]
+
+common_parameters --> read_items
+common_parameters --> read_users
+```
+
+Таким образом, вы пишете общий код один раз, и **FastAPI** позаботится о его вызове для ваших *операций с путями*.
+
+!!! check "Проверка"
+ Обратите внимание, что вы не создаёте специальный класс и не передаёте его куда-то в **FastAPI** для регистрации, или что-то в этом роде.
+
+ Вы просто передаёте это в `Depends`, и **FastAPI** знает, что делать дальше.
+
+## Объединяем с `Annotated` зависимостями
+
+В приведенном выше примере есть небольшое **повторение кода**.
+
+Когда вам нужно использовать `common_parameters()` зависимость, вы должны написать весь параметр с аннотацией типов и `Depends()`:
+
+```Python
+commons: Annotated[dict, Depends(common_parameters)]
+```
+
+Но потому что мы используем `Annotated`, мы можем хранить `Annotated` значение в переменной и использовать его в нескольких местах:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="12 16 21"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14 18 23"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="15 19 24"
+ {!> ../../../docs_src/dependencies/tutorial001_02_an.py!}
+ ```
+
+!!! tip "Подсказка"
+ Это стандартный синтаксис python и называется "type alias", это не особенность **FastAPI**.
+
+ Но потому что **FastAPI** базируется на стандартах Python, включая `Annotated`, вы можете использовать этот трюк в вашем коде. 😎
+
+
+Зависимости продолжат работу как ожидалось, и **лучшая часть** в том, что **информация о типе будет сохранена**. Это означает, что ваш редактор кода будет корректно обрабатывать **автодополнения**, **встроенные ошибки** и так далее. То же самое относится и к инструментам, таким как `mypy`.
+
+Это очень полезно, когда вы интегрируете это в **большую кодовую базу**, используя **одинаковые зависимости** снова и снова во **многих** ***операциях пути***.
+
+## Использовать `async` или не `async`
+
+Для зависимостей, вызванных **FastAPI** (то же самое, что и ваши *функции обработки пути*), те же правила, что приняты для определения ваших функций.
+
+Вы можете использовать `async def` или обычное `def`.
+
+Вы также можете объявить зависимости с `async def` внутри обычной `def` *функции обработки пути*, или `def` зависимости внутри `async def` *функции обработки пути*, и так далее.
+
+Это всё не важно. **FastAPI** знает, что нужно сделать. 😎
+
+!!! note "Информация"
+ Если вам эта тема не знакома, прочтите [Async: *"In a hurry?"*](../../async.md){.internal-link target=_blank} раздел о `async` и `await` в документации.
+
+## Интеграция с OpenAPI
+
+Все заявления о запросах, валидаторы, требования ваших зависимостей (и подзависимостей) будут интегрированы в соответствующую OpenAPI-схему.
+
+В интерактивной документации будет вся информация по этим зависимостям тоже:
+
+
+
+## Простое использование
+
+Если вы посмотрите на фото, *функция обработки пути* объявляется каждый раз, когда вычисляется путь, и тогда **FastAPI** позаботится о вызове функции с корректными параметрами, извлекая информацию из запроса.
+
+На самом деле, все (или большинство) веб-фреймворков работают по схожему сценарию.
+
+Вы никогда не вызываете эти функции на месте. Их вызовет ваш фреймворк (в нашем случае, **FastAPI**).
+
+С системой Dependency Injection, вы можете сообщить **FastAPI**, что ваша *функция обработки пути* "зависит" от чего-то ещё, что должно быть извлечено перед вашей *функцией обработки пути*, и **FastAPI** позаботится об извлечении и инъекции результата.
+
+Другие распространённые термины для описания схожей идеи "dependency injection" являются:
+
+- ресурсность
+- доставка
+- сервисность
+- инъекция
+- компонентность
+
+## **FastAPI** подключаемые модули
+
+Инъекции и модули могут быть построены с использованием системы **Dependency Injection**. Но на самом деле, **нет необходимости создавать новые модули**, просто используя зависимости, можно объявить бесконечное количество интеграций и взаимодействий, которые доступны вашей *функции обработки пути*.
+
+И зависимости могут быть созданы очень простым и интуитивным способом, что позволяет вам просто импортировать нужные пакеты Python и интегрировать их в API функции за пару строк.
+
+Вы увидите примеры этого в следующих главах о реляционных и NoSQL базах данных, безопасности и т.д.
+
+## Совместимость с **FastAPI**
+
+Простота Dependency Injection делает **FastAPI** совместимым с:
+
+- всеми реляционными базами данных
+- NoSQL базами данных
+- внешними пакетами
+- внешними API
+- системами авторизации, аутентификации
+- системами мониторинга использования API
+- системами ввода данных ответов
+- и так далее.
+
+## Просто и сильно
+
+Хотя иерархическая система Dependency Injection очень проста для описания и использования, она по-прежнему очень мощная.
+
+Вы можете описывать зависимости в очередь, и они уже будут вызываться друг за другом.
+
+Когда иерархическое дерево построено, система **Dependency Injection** берет на себя решение всех зависимостей для вас (и их подзависимостей) и обеспечивает (инъектирует) результат на каждом шаге.
+
+Например, у вас есть 4 API-эндпоинта (*операции пути*):
+
+- `/items/public/`
+- `/items/private/`
+- `/users/{user_id}/activate`
+- `/items/pro/`
+
+Тогда вы можете требовать разные права для каждого из них, используя зависимости и подзависимости:
+
+```mermaid
+graph TB
+
+current_user(["current_user"])
+active_user(["active_user"])
+admin_user(["admin_user"])
+paying_user(["paying_user"])
+
+public["/items/public/"]
+private["/items/private/"]
+activate_user["/users/{user_id}/activate"]
+pro_items["/items/pro/"]
+
+current_user --> active_user
+active_user --> admin_user
+active_user --> paying_user
+
+current_user --> public
+active_user --> private
+admin_user --> activate_user
+paying_user --> pro_items
+```
+
+## Интегрировано с **OpenAPI**
+
+Все эти зависимости, объявляя свои требования, также добавляют параметры, проверки и т.д. к вашим операциям *path*.
+
+**FastAPI** позаботится о добавлении всего этого в схему открытого API, чтобы это отображалось в системах интерактивной документации.
diff --git a/docs/ru/docs/tutorial/encoder.md b/docs/ru/docs/tutorial/encoder.md
new file mode 100644
index 000000000..c26b2c941
--- /dev/null
+++ b/docs/ru/docs/tutorial/encoder.md
@@ -0,0 +1,42 @@
+# JSON кодировщик
+
+В некоторых случаях может потребоваться преобразование типа данных (например, Pydantic-модели) в тип, совместимый с JSON (например, `dict`, `list` и т.д.).
+
+Например, если необходимо хранить его в базе данных.
+
+Для этого **FastAPI** предоставляет функцию `jsonable_encoder()`.
+
+## Использование `jsonable_encoder`
+
+Представим, что у вас есть база данных `fake_db`, которая принимает только JSON-совместимые данные.
+
+Например, он не принимает объекты `datetime`, так как они не совместимы с JSON.
+
+В таком случае объект `datetime` следует преобразовать в строку соответствующую формату ISO.
+
+Точно так же эта база данных не может принять Pydantic модель (объект с атрибутами), а только `dict`.
+
+Для этого можно использовать функцию `jsonable_encoder`.
+
+Она принимает объект, например, модель Pydantic, и возвращает его версию, совместимую с JSON:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4 21"
+ {!> ../../../docs_src/encoder/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="5 22"
+ {!> ../../../docs_src/encoder/tutorial001.py!}
+ ```
+
+В данном примере она преобразует Pydantic модель в `dict`, а `datetime` - в `str`.
+
+Результатом её вызова является объект, который может быть закодирован с помощью функции из стандартной библиотеки Python – `json.dumps()`.
+
+Функция не возвращает большой `str`, содержащий данные в формате JSON (в виде строки). Она возвращает стандартную структуру данных Python (например, `dict`) со значениями и подзначениями, которые совместимы с JSON.
+
+!!! note "Технические детали"
+ `jsonable_encoder` фактически используется **FastAPI** внутри системы для преобразования данных. Однако он полезен и во многих других сценариях.
diff --git a/docs/ru/docs/tutorial/extra-data-types.md b/docs/ru/docs/tutorial/extra-data-types.md
index 0f613a6b2..d4727e2d4 100644
--- a/docs/ru/docs/tutorial/extra-data-types.md
+++ b/docs/ru/docs/tutorial/extra-data-types.md
@@ -36,7 +36,7 @@
* `datetime.timedelta`:
* Встроенный в Python `datetime.timedelta`.
* В запросах и ответах будет представлен в виде общего количества секунд типа `float`.
- * Pydantic также позволяет представить его как "Кодировку разницы во времени ISO 8601", см. документацию для получения дополнительной информации.
+ * Pydantic также позволяет представить его как "Кодировку разницы во времени ISO 8601", см. документацию для получения дополнительной информации.
* `frozenset`:
* В запросах и ответах обрабатывается так же, как и `set`:
* В запросах будет прочитан список, исключены дубликаты и преобразован в `set`.
@@ -49,7 +49,7 @@
* `Decimal`:
* Встроенный в Python `Decimal`.
* В запросах и ответах обрабатывается так же, как и `float`.
-* Вы можете проверить все допустимые типы данных pydantic здесь: Типы данных Pydantic.
+* Вы можете проверить все допустимые типы данных pydantic здесь: Типы данных Pydantic.
## Пример
diff --git a/docs/ru/docs/tutorial/extra-models.md b/docs/ru/docs/tutorial/extra-models.md
index 30176b4e3..78855313d 100644
--- a/docs/ru/docs/tutorial/extra-models.md
+++ b/docs/ru/docs/tutorial/extra-models.md
@@ -179,7 +179,7 @@ UserInDB(
Для этого используйте стандартные аннотации типов в Python `typing.Union`:
!!! note "Примечание"
- При объявлении `Union`, сначала указывайте наиболее детальные типы, затем менее детальные. В примере ниже более детальный `PlaneItem` стоит перед `CarItem` в `Union[PlaneItem, CarItem]`.
+ При объявлении `Union`, сначала указывайте наиболее детальные типы, затем менее детальные. В примере ниже более детальный `PlaneItem` стоит перед `CarItem` в `Union[PlaneItem, CarItem]`.
=== "Python 3.10+"
diff --git a/docs/ru/docs/tutorial/first-steps.md b/docs/ru/docs/tutorial/first-steps.md
index b46f235bc..8a0876bb4 100644
--- a/docs/ru/docs/tutorial/first-steps.md
+++ b/docs/ru/docs/tutorial/first-steps.md
@@ -310,7 +310,7 @@ https://example.com/items/foo
```
!!! note "Технические детали"
- Если не знаете в чём разница, посмотрите [Конкурентность: *"Нет времени?"*](../async.md#in-a-hurry){.internal-link target=_blank}.
+ Если не знаете в чём разница, посмотрите [Конкурентность: *"Нет времени?"*](../async.md#_1){.internal-link target=_blank}.
### Шаг 5: верните результат
diff --git a/docs/ru/docs/tutorial/handling-errors.md b/docs/ru/docs/tutorial/handling-errors.md
new file mode 100644
index 000000000..40b6f9bc4
--- /dev/null
+++ b/docs/ru/docs/tutorial/handling-errors.md
@@ -0,0 +1,261 @@
+# Обработка ошибок
+
+Существует множество ситуаций, когда необходимо сообщить об ошибке клиенту, использующему ваш API.
+
+Таким клиентом может быть браузер с фронтендом, чужой код, IoT-устройство и т.д.
+
+Возможно, вам придется сообщить клиенту о следующем:
+
+* Клиент не имеет достаточных привилегий для выполнения данной операции.
+* Клиент не имеет доступа к данному ресурсу.
+* Элемент, к которому клиент пытался получить доступ, не существует.
+* и т.д.
+
+В таких случаях обычно возвращается **HTTP-код статуса ответа** в диапазоне **400** (от 400 до 499).
+
+Они похожи на двухсотые HTTP статус-коды (от 200 до 299), которые означают, что запрос обработан успешно.
+
+Четырёхсотые статус-коды означают, что ошибка произошла по вине клиента.
+
+Помните ли ошибки **"404 Not Found "** (и шутки) ?
+
+## Использование `HTTPException`
+
+Для возврата клиенту HTTP-ответов с ошибками используется `HTTPException`.
+
+### Импортируйте `HTTPException`
+
+```Python hl_lines="1"
+{!../../../docs_src/handling_errors/tutorial001.py!}
+```
+
+### Вызовите `HTTPException` в своем коде
+
+`HTTPException` - это обычное исключение Python с дополнительными данными, актуальными для API.
+
+Поскольку это исключение Python, то его не `возвращают`, а `вызывают`.
+
+Это также означает, что если вы находитесь внутри функции, которая вызывается внутри вашей *функции операции пути*, и вы поднимаете `HTTPException` внутри этой функции, то она не будет выполнять остальной код в *функции операции пути*, а сразу завершит запрос и отправит HTTP-ошибку из `HTTPException` клиенту.
+
+О том, насколько выгоднее `вызывать` исключение, чем `возвращать` значение, будет рассказано в разделе, посвященном зависимостям и безопасности.
+
+В данном примере, когда клиент запрашивает элемент по несуществующему ID, возникает исключение со статус-кодом `404`:
+
+```Python hl_lines="11"
+{!../../../docs_src/handling_errors/tutorial001.py!}
+```
+
+### Возвращаемый ответ
+
+Если клиент запросит `http://example.com/items/foo` (`item_id` `"foo"`), то он получит статус-код 200 и ответ в формате JSON:
+
+```JSON
+{
+ "item": "The Foo Wrestlers"
+}
+```
+
+Но если клиент запросит `http://example.com/items/bar` (несуществующий `item_id` `"bar"`), то он получит статус-код 404 (ошибка "не найдено") и JSON-ответ в виде:
+
+```JSON
+{
+ "detail": "Item not found"
+}
+```
+
+!!! tip "Подсказка"
+ При вызове `HTTPException` в качестве параметра `detail` можно передавать любое значение, которое может быть преобразовано в JSON, а не только `str`.
+
+ Вы можете передать `dict`, `list` и т.д.
+
+ Они автоматически обрабатываются **FastAPI** и преобразуются в JSON.
+
+## Добавление пользовательских заголовков
+
+В некоторых ситуациях полезно иметь возможность добавлять пользовательские заголовки к ошибке HTTP. Например, для некоторых типов безопасности.
+
+Скорее всего, вам не потребуется использовать его непосредственно в коде.
+
+Но в случае, если это необходимо для продвинутого сценария, можно добавить пользовательские заголовки:
+
+```Python hl_lines="14"
+{!../../../docs_src/handling_errors/tutorial002.py!}
+```
+
+## Установка пользовательских обработчиков исключений
+
+Вы можете добавить пользовательские обработчики исключений с помощью то же самое исключение - утилиты от Starlette.
+
+Допустим, у вас есть пользовательское исключение `UnicornException`, которое вы (или используемая вами библиотека) можете `вызвать`.
+
+И вы хотите обрабатывать это исключение глобально с помощью FastAPI.
+
+Можно добавить собственный обработчик исключений с помощью `@app.exception_handler()`:
+
+```Python hl_lines="5-7 13-18 24"
+{!../../../docs_src/handling_errors/tutorial003.py!}
+```
+
+Здесь, если запросить `/unicorns/yolo`, то *операция пути* вызовет `UnicornException`.
+
+Но оно будет обработано `unicorn_exception_handler`.
+
+Таким образом, вы получите чистую ошибку с кодом состояния HTTP `418` и содержимым JSON:
+
+```JSON
+{"message": "Oops! yolo did something. There goes a rainbow..."}
+```
+
+!!! note "Технические детали"
+ Также можно использовать `from starlette.requests import Request` и `from starlette.responses import JSONResponse`.
+
+ **FastAPI** предоставляет тот же `starlette.responses`, что и `fastapi.responses`, просто для удобства разработчика. Однако большинство доступных ответов поступает непосредственно из Starlette. То же самое касается и `Request`.
+
+## Переопределение стандартных обработчиков исключений
+
+**FastAPI** имеет некоторые обработчики исключений по умолчанию.
+
+Эти обработчики отвечают за возврат стандартных JSON-ответов при `вызове` `HTTPException` и при наличии в запросе недопустимых данных.
+
+Вы можете переопределить эти обработчики исключений на свои собственные.
+
+### Переопределение исключений проверки запроса
+
+Когда запрос содержит недопустимые данные, **FastAPI** внутренне вызывает ошибку `RequestValidationError`.
+
+А также включает в себя обработчик исключений по умолчанию.
+
+Чтобы переопределить его, импортируйте `RequestValidationError` и используйте его с `@app.exception_handler(RequestValidationError)` для создания обработчика исключений.
+
+Обработчик исключения получит объект `Request` и исключение.
+
+```Python hl_lines="2 14-16"
+{!../../../docs_src/handling_errors/tutorial004.py!}
+```
+
+Теперь, если перейти к `/items/foo`, то вместо стандартной JSON-ошибки с:
+
+```JSON
+{
+ "detail": [
+ {
+ "loc": [
+ "path",
+ "item_id"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ]
+}
+```
+
+вы получите текстовую версию:
+
+```
+1 validation error
+path -> item_id
+ value is not a valid integer (type=type_error.integer)
+```
+
+#### `RequestValidationError` или `ValidationError`
+
+!!! warning "Внимание"
+ Это технические детали, которые можно пропустить, если они не важны для вас сейчас.
+
+`RequestValidationError` является подклассом Pydantic `ValidationError`.
+
+**FastAPI** использует его для того, чтобы, если вы используете Pydantic-модель в `response_model`, и ваши данные содержат ошибку, вы увидели ошибку в журнале.
+
+Но клиент/пользователь этого не увидит. Вместо этого клиент получит сообщение "Internal Server Error" с кодом состояния HTTP `500`.
+
+Так и должно быть, потому что если в вашем *ответе* или где-либо в вашем коде (не в *запросе* клиента) возникает Pydantic `ValidationError`, то это действительно ошибка в вашем коде.
+
+И пока вы не устраните ошибку, ваши клиенты/пользователи не должны иметь доступа к внутренней информации о ней, так как это может привести к уязвимости в системе безопасности.
+
+### Переопределите обработчик ошибок `HTTPException`
+
+Аналогичным образом можно переопределить обработчик `HTTPException`.
+
+Например, для этих ошибок можно вернуть обычный текстовый ответ вместо JSON:
+
+```Python hl_lines="3-4 9-11 22"
+{!../../../docs_src/handling_errors/tutorial004.py!}
+```
+
+!!! note "Технические детали"
+ Можно также использовать `from starlette.responses import PlainTextResponse`.
+
+ **FastAPI** предоставляет тот же `starlette.responses`, что и `fastapi.responses`, просто для удобства разработчика. Однако большинство доступных ответов поступает непосредственно из Starlette.
+
+### Используйте тело `RequestValidationError`
+
+Ошибка `RequestValidationError` содержит полученное `тело` с недопустимыми данными.
+
+Вы можете использовать его при разработке приложения для регистрации тела и его отладки, возврата пользователю и т.д.
+
+```Python hl_lines="14"
+{!../../../docs_src/handling_errors/tutorial005.py!}
+```
+
+Теперь попробуйте отправить недействительный элемент, например:
+
+```JSON
+{
+ "title": "towel",
+ "size": "XL"
+}
+```
+
+Вы получите ответ о том, что данные недействительны, содержащий следующее тело:
+
+```JSON hl_lines="12-15"
+{
+ "detail": [
+ {
+ "loc": [
+ "body",
+ "size"
+ ],
+ "msg": "value is not a valid integer",
+ "type": "type_error.integer"
+ }
+ ],
+ "body": {
+ "title": "towel",
+ "size": "XL"
+ }
+}
+```
+
+#### `HTTPException` в FastAPI или в Starlette
+
+**FastAPI** имеет собственный `HTTPException`.
+
+Класс ошибок **FastAPI** `HTTPException` наследует от класса ошибок Starlette `HTTPException`.
+
+Единственное отличие заключается в том, что `HTTPException` от **FastAPI** позволяет добавлять заголовки, которые будут включены в ответ.
+
+Он необходим/используется внутри системы для OAuth 2.0 и некоторых утилит безопасности.
+
+Таким образом, вы можете продолжать вызывать `HTTPException` от **FastAPI** как обычно в своем коде.
+
+Но когда вы регистрируете обработчик исключений, вы должны зарегистрировать его для `HTTPException` от Starlette.
+
+Таким образом, если какая-либо часть внутреннего кода Starlette, расширение или плагин Starlette вызовет исключение Starlette `HTTPException`, ваш обработчик сможет перехватить и обработать его.
+
+В данном примере, чтобы иметь возможность использовать оба `HTTPException` в одном коде, исключения Starlette переименованы в `StarletteHTTPException`:
+
+```Python
+from starlette.exceptions import HTTPException as StarletteHTTPException
+```
+
+### Переиспользование обработчиков исключений **FastAPI**
+
+Если вы хотите использовать исключение вместе с теми же обработчиками исключений по умолчанию из **FastAPI**, вы можете импортировать и повторно использовать обработчики исключений по умолчанию из `fastapi.exception_handlers`:
+
+```Python hl_lines="2-5 15 21"
+{!../../../docs_src/handling_errors/tutorial006.py!}
+```
+
+В этом примере вы просто `выводите в терминал` ошибку с очень выразительным сообщением, но идея вам понятна. Вы можете использовать исключение, а затем просто повторно использовать стандартные обработчики исключений.
diff --git a/docs/ru/docs/tutorial/metadata.md b/docs/ru/docs/tutorial/metadata.md
index 331c96734..0c6940d0e 100644
--- a/docs/ru/docs/tutorial/metadata.md
+++ b/docs/ru/docs/tutorial/metadata.md
@@ -65,7 +65,7 @@
```
!!! info "Дополнительная информация"
- Узнайте больше о тегах в [Конфигурации операции пути](../path-operation-configuration/#tags){.internal-link target=_blank}.
+ Узнайте больше о тегах в [Конфигурации операции пути](path-operation-configuration.md#_3){.internal-link target=_blank}.
### Проверьте документацию
diff --git a/docs/ru/docs/tutorial/path-params-numeric-validations.md b/docs/ru/docs/tutorial/path-params-numeric-validations.md
index bd2c29d0a..0baf51fa9 100644
--- a/docs/ru/docs/tutorial/path-params-numeric-validations.md
+++ b/docs/ru/docs/tutorial/path-params-numeric-validations.md
@@ -47,7 +47,7 @@
Если вы используете более старую версию, вы столкнётесь с ошибками при попытке использовать `Annotated`.
- Убедитесь, что вы [обновили версию FastAPI](../deployment/versions.md#upgrading-the-fastapi-versions){.internal-link target=_blank} как минимум до 0.95.1 перед тем, как использовать `Annotated`.
+ Убедитесь, что вы [обновили версию FastAPI](../deployment/versions.md#fastapi_2){.internal-link target=_blank} как минимум до 0.95.1 перед тем, как использовать `Annotated`.
## Определите метаданные
diff --git a/docs/ru/docs/tutorial/path-params.md b/docs/ru/docs/tutorial/path-params.md
index 55b498ef0..1241e0919 100644
--- a/docs/ru/docs/tutorial/path-params.md
+++ b/docs/ru/docs/tutorial/path-params.md
@@ -93,7 +93,7 @@
## Pydantic
-Вся проверка данных выполняется под капотом с помощью Pydantic. Поэтому вы можете быть уверены в качестве обработки данных.
+Вся проверка данных выполняется под капотом с помощью Pydantic. Поэтому вы можете быть уверены в качестве обработки данных.
Вы можете использовать в аннотациях как простые типы данных, вроде `str`, `float`, `bool`, так и более сложные типы.
diff --git a/docs/ru/docs/tutorial/query-params-str-validations.md b/docs/ru/docs/tutorial/query-params-str-validations.md
index cc826b871..108aefefc 100644
--- a/docs/ru/docs/tutorial/query-params-str-validations.md
+++ b/docs/ru/docs/tutorial/query-params-str-validations.md
@@ -479,7 +479,7 @@ q: Union[str, None] = None
```
!!! tip "Подсказка"
- Pydantic, мощь которого используется в FastAPI для валидации и сериализации, имеет специальное поведение для `Optional` или `Union[Something, None]` без значения по умолчанию. Вы можете узнать об этом больше в документации Pydantic, раздел Обязательные Опциональные поля.
+ Pydantic, мощь которого используется в FastAPI для валидации и сериализации, имеет специальное поведение для `Optional` или `Union[Something, None]` без значения по умолчанию. Вы можете узнать об этом больше в документации Pydantic, раздел Обязательные Опциональные поля.
### Использование Pydantic's `Required` вместо Ellipsis (`...`)
diff --git a/docs/ru/docs/tutorial/query-params.md b/docs/ru/docs/tutorial/query-params.md
index 6e885cb65..f6e18f971 100644
--- a/docs/ru/docs/tutorial/query-params.md
+++ b/docs/ru/docs/tutorial/query-params.md
@@ -77,7 +77,7 @@ http://127.0.0.1:8000/items/?skip=20
В этом случае, параметр `q` будет не обязательным и будет иметь значение `None` по умолчанию.
-!!! Важно
+!!! check "Важно"
Также обратите внимание, что **FastAPI** достаточно умён чтобы заметить, что параметр `item_id` является path-параметром, а `q` нет, поэтому, это параметр запроса.
## Преобразование типа параметра запроса
@@ -221,5 +221,5 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
* `skip`, типа `int` и со значением по умолчанию `0`.
* `limit`, необязательный `int`.
-!!! подсказка
- Вы можете использовать класс `Enum` также, как ранее применяли его с [Path-параметрами](path-params.md#predefined-values){.internal-link target=_blank}.
+!!! tip "Подсказка"
+ Вы можете использовать класс `Enum` также, как ранее применяли его с [Path-параметрами](path-params.md#_7){.internal-link target=_blank}.
diff --git a/docs/ru/docs/tutorial/request-files.md b/docs/ru/docs/tutorial/request-files.md
index 00f8c8377..79b3bd067 100644
--- a/docs/ru/docs/tutorial/request-files.md
+++ b/docs/ru/docs/tutorial/request-files.md
@@ -3,7 +3,7 @@
Используя класс `File`, мы можем позволить клиентам загружать файлы.
!!! info "Дополнительная информация"
- Чтобы получать загруженные файлы, сначала установите `python-multipart`.
+ Чтобы получать загруженные файлы, сначала установите `python-multipart`.
Например: `pip install python-multipart`.
diff --git a/docs/ru/docs/tutorial/request-forms-and-files.md b/docs/ru/docs/tutorial/request-forms-and-files.md
index 3f587c38a..a08232ca7 100644
--- a/docs/ru/docs/tutorial/request-forms-and-files.md
+++ b/docs/ru/docs/tutorial/request-forms-and-files.md
@@ -3,7 +3,7 @@
Вы можете определять файлы и поля формы одновременно, используя `File` и `Form`.
!!! info "Дополнительная информация"
- Чтобы получать загруженные файлы и/или данные форм, сначала установите `python-multipart`.
+ Чтобы получать загруженные файлы и/или данные форм, сначала установите `python-multipart`.
Например: `pip install python-multipart`.
diff --git a/docs/ru/docs/tutorial/request-forms.md b/docs/ru/docs/tutorial/request-forms.md
index 0fc9e4eda..fa2bcb7cb 100644
--- a/docs/ru/docs/tutorial/request-forms.md
+++ b/docs/ru/docs/tutorial/request-forms.md
@@ -3,7 +3,7 @@
Когда вам нужно получить поля формы вместо JSON, вы можете использовать `Form`.
!!! info "Дополнительная информация"
- Чтобы использовать формы, сначала установите `python-multipart`.
+ Чтобы использовать формы, сначала установите `python-multipart`.
Например, выполните команду `pip install python-multipart`.
diff --git a/docs/ru/docs/tutorial/response-model.md b/docs/ru/docs/tutorial/response-model.md
index 38b45e2a5..9b9b60dd5 100644
--- a/docs/ru/docs/tutorial/response-model.md
+++ b/docs/ru/docs/tutorial/response-model.md
@@ -377,7 +377,7 @@ FastAPI совместно с Pydantic выполнит некоторую ма
```
!!! info "Информация"
- "Под капотом" FastAPI использует метод `.dict()` у объектов моделей Pydantic с параметром `exclude_unset`, чтобы достичь такого эффекта.
+ "Под капотом" FastAPI использует метод `.dict()` у объектов моделей Pydantic с параметром `exclude_unset`, чтобы достичь такого эффекта.
!!! info "Информация"
Вы также можете использовать:
@@ -385,7 +385,7 @@ FastAPI совместно с Pydantic выполнит некоторую ма
* `response_model_exclude_defaults=True`
* `response_model_exclude_none=True`
- как описано в документации Pydantic для параметров `exclude_defaults` и `exclude_none`.
+ как описано в документации Pydantic для параметров `exclude_defaults` и `exclude_none`.
#### Если значение поля отличается от значения по-умолчанию
diff --git a/docs/ru/docs/tutorial/schema-extra-example.md b/docs/ru/docs/tutorial/schema-extra-example.md
index a13ab5935..e1011805a 100644
--- a/docs/ru/docs/tutorial/schema-extra-example.md
+++ b/docs/ru/docs/tutorial/schema-extra-example.md
@@ -6,7 +6,7 @@
## Pydantic `schema_extra`
-Вы можете объявить ключ `example` для модели Pydantic, используя класс `Config` и переменную `schema_extra`, как описано в Pydantic документации: Настройка схемы:
+Вы можете объявить ключ `example` для модели Pydantic, используя класс `Config` и переменную `schema_extra`, как описано в Pydantic документации: Настройка схемы:
=== "Python 3.10+"
diff --git a/docs/ru/docs/tutorial/security/first-steps.md b/docs/ru/docs/tutorial/security/first-steps.md
new file mode 100644
index 000000000..fdeccc01a
--- /dev/null
+++ b/docs/ru/docs/tutorial/security/first-steps.md
@@ -0,0 +1,232 @@
+# Безопасность - первые шаги
+
+Представим, что у вас есть свой **бэкенд** API на некотором домене.
+
+И у вас есть **фронтенд** на другом домене или на другом пути того же домена (или в мобильном приложении).
+
+И вы хотите иметь возможность аутентификации фронтенда с бэкендом, используя **имя пользователя** и **пароль**.
+
+Мы можем использовать **OAuth2** для создания такой системы с помощью **FastAPI**.
+
+Но давайте избавим вас от необходимости читать всю длинную спецификацию, чтобы найти те небольшие кусочки информации, которые вам нужны.
+
+Для работы с безопасностью воспользуемся средствами, предоставленными **FastAPI**.
+
+## Как это выглядит
+
+Давайте сначала просто воспользуемся кодом и посмотрим, как он работает, а затем детально разберём, что происходит.
+
+## Создание `main.py`
+
+Скопируйте пример в файл `main.py`:
+
+=== "Python 3.9+"
+
+ ```Python
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ без Annotated"
+
+ !!! tip "Подсказка"
+ Предпочтительнее использовать версию с аннотацией, если это возможно.
+
+ ```Python
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+
+## Запуск
+
+!!! info "Дополнительная информация"
+ Вначале, установите библиотеку `python-multipart`.
+
+ А именно: `pip install python-multipart`.
+
+ Это связано с тем, что **OAuth2** использует "данные формы" для передачи `имени пользователя` и `пароля`.
+
+Запустите ваш сервер:
+
+
+
+!!! check "Кнопка авторизации!"
+ У вас уже появилась новая кнопка "Authorize".
+
+ А у *операции пути* теперь появился маленький замочек в правом верхнем углу, на который можно нажать.
+
+При нажатии на нее появляется небольшая форма авторизации, в которую нужно ввести `имя пользователя` и `пароль` (и другие необязательные поля):
+
+
+
+!!! note "Технические детали"
+ Неважно, что вы введете в форму, она пока не будет работать. Но мы к этому еще придем.
+
+Конечно, это не фронтенд для конечных пользователей, но это отличный автоматический инструмент для интерактивного документирования всех ваших API.
+
+Он может использоваться командой фронтенда (которой можете быть и вы сами).
+
+Он может быть использован сторонними приложениями и системами.
+
+Кроме того, его можно использовать самостоятельно для отладки, проверки и тестирования одного и того же приложения.
+
+## Аутентификация по паролю
+
+Теперь давайте вернемся немного назад и разберемся, что же это такое.
+
+Аутентификация по паролю является одним из способов, определенных в OAuth2, для обеспечения безопасности и аутентификации.
+
+OAuth2 был разработан для того, чтобы бэкэнд или API были независимы от сервера, который аутентифицирует пользователя.
+
+Но в нашем случае одно и то же приложение **FastAPI** будет работать с API и аутентификацией.
+
+Итак, рассмотрим его с этой упрощенной точки зрения:
+
+* Пользователь вводит на фронтенде `имя пользователя` и `пароль` и нажимает `Enter`.
+* Фронтенд (работающий в браузере пользователя) отправляет эти `имя пользователя` и `пароль` на определенный URL в нашем API (объявленный с помощью параметра `tokenUrl="token"`).
+* API проверяет эти `имя пользователя` и `пароль` и выдает в ответ "токен" (мы еще не реализовали ничего из этого).
+ * "Токен" - это просто строка с некоторым содержимым, которое мы можем использовать позже для верификации пользователя.
+ * Обычно срок действия токена истекает через некоторое время.
+ * Таким образом, пользователю придется снова войти в систему в какой-то момент времени.
+ * И если токен будет украден, то риск будет меньше, так как он не похож на постоянный ключ, который будет работать вечно (в большинстве случаев).
+* Фронтенд временно хранит этот токен в каком-то месте.
+* Пользователь щелкает мышью на фронтенде, чтобы перейти в другой раздел на фронтенде.
+* Фронтенду необходимо получить дополнительные данные из API.
+ * Но для этого необходима аутентификация для конкретной конечной точки.
+ * Поэтому для аутентификации в нашем API он посылает заголовок `Authorization` со значением `Bearer` плюс сам токен.
+ * Если токен содержит `foobar`, то содержание заголовка `Authorization` будет таким: `Bearer foobar`.
+
+## Класс `OAuth2PasswordBearer` в **FastAPI**
+
+**FastAPI** предоставляет несколько средств на разных уровнях абстракции для реализации этих функций безопасности.
+
+В данном примере мы будем использовать **OAuth2**, с аутентификацией по паролю, используя токен **Bearer**. Для этого мы используем класс `OAuth2PasswordBearer`.
+
+!!! info "Дополнительная информация"
+ Токен "bearer" - не единственный вариант, но для нашего случая он является наилучшим.
+
+ И это может быть лучшим вариантом для большинства случаев использования, если только вы не являетесь экспертом в области OAuth2 и точно знаете, почему вам лучше подходит какой-то другой вариант.
+
+ В этом случае **FastAPI** также предоставляет инструменты для его реализации.
+
+При создании экземпляра класса `OAuth2PasswordBearer` мы передаем в него параметр `tokenUrl`. Этот параметр содержит URL, который клиент (фронтенд, работающий в браузере пользователя) будет использовать для отправки `имени пользователя` и `пароля` с целью получения токена.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ без Annotated"
+
+ !!! tip "Подсказка"
+ Предпочтительнее использовать версию с аннотацией, если это возможно.
+
+ ```Python hl_lines="6"
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+!!! tip "Подсказка"
+ Здесь `tokenUrl="token"` ссылается на относительный URL `token`, который мы еще не создали. Поскольку это относительный URL, он эквивалентен `./token`.
+
+ Поскольку мы используем относительный URL, если ваш API расположен по адресу `https://example.com/`, то он будет ссылаться на `https://example.com/token`. Если же ваш API расположен по адресу `https://example.com/api/v1/`, то он будет ссылаться на `https://example.com/api/v1/token`.
+
+ Использование относительного URL важно для того, чтобы ваше приложение продолжало работать даже в таких сложных случаях, как оно находится [за прокси-сервером](../../advanced/behind-a-proxy.md){.internal-link target=_blank}.
+
+Этот параметр не создает конечную точку / *операцию пути*, а объявляет, что URL `/token` будет таким, который клиент должен использовать для получения токена. Эта информация используется в OpenAPI, а затем в интерактивных системах документации API.
+
+Вскоре мы создадим и саму операцию пути.
+
+!!! info "Дополнительная информация"
+ Если вы очень строгий "питонист", то вам может не понравиться стиль названия параметра `tokenUrl` вместо `token_url`.
+
+ Это связано с тем, что тут используется то же имя, что и в спецификации OpenAPI. Таким образом, если вам необходимо более подробно изучить какую-либо из этих схем безопасности, вы можете просто использовать копирование/вставку, чтобы найти дополнительную информацию о ней.
+
+Переменная `oauth2_scheme` является экземпляром `OAuth2PasswordBearer`, но она также является "вызываемой".
+
+Ее можно вызвать следующим образом:
+
+```Python
+oauth2_scheme(some, parameters)
+```
+
+Поэтому ее можно использовать вместе с `Depends`.
+
+### Использование
+
+Теперь вы можете передать ваш `oauth2_scheme` в зависимость с помощью `Depends`.
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/security/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="11"
+ {!> ../../../docs_src/security/tutorial001_an.py!}
+ ```
+
+=== "Python 3.8+ без Annotated"
+
+ !!! tip "Подсказка"
+ Предпочтительнее использовать версию с аннотацией, если это возможно.
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/security/tutorial001.py!}
+ ```
+
+Эта зависимость будет предоставлять `строку`, которая присваивается параметру `token` в *функции операции пути*.
+
+**FastAPI** будет знать, что он может использовать эту зависимость для определения "схемы безопасности" в схеме OpenAPI (и автоматической документации по API).
+
+!!! info "Технические детали"
+ **FastAPI** будет знать, что он может использовать класс `OAuth2PasswordBearer` (объявленный в зависимости) для определения схемы безопасности в OpenAPI, поскольку он наследуется от `fastapi.security.oauth2.OAuth2`, который, в свою очередь, наследуется от `fastapi.security.base.SecurityBase`.
+
+ Все утилиты безопасности, интегрируемые в OpenAPI (и автоматическая документация по API), наследуются от `SecurityBase`, поэтому **FastAPI** может знать, как интегрировать их в OpenAPI.
+
+## Что он делает
+
+Он будет искать в запросе заголовок `Authorization` и проверять, содержит ли он значение `Bearer` с некоторым токеном, и возвращать токен в виде `строки`.
+
+Если он не видит заголовка `Authorization` или значение не имеет токена `Bearer`, то в ответ будет выдана ошибка с кодом состояния 401 (`UNAUTHORIZED`).
+
+Для возврата ошибки даже не нужно проверять, существует ли токен. Вы можете быть уверены, что если ваша функция будет выполнилась, то в этом токене есть `строка`.
+
+Проверить это можно уже сейчас в интерактивной документации:
+
+
+
+Мы пока не проверяем валидность токена, но для начала неплохо.
+
+## Резюме
+
+Таким образом, всего за 3-4 дополнительные строки вы получаете некую примитивную форму защиты.
diff --git a/docs/ru/docs/tutorial/static-files.md b/docs/ru/docs/tutorial/static-files.md
index ec09eb5a3..afe2075d9 100644
--- a/docs/ru/docs/tutorial/static-files.md
+++ b/docs/ru/docs/tutorial/static-files.md
@@ -11,7 +11,7 @@
{!../../../docs_src/static_files/tutorial001.py!}
```
-!!! заметка "Технические детали"
+!!! note "Технические детали"
Вы также можете использовать `from starlette.staticfiles import StaticFiles`.
**FastAPI** предоставляет `starlette.staticfiles` под псевдонимом `fastapi.staticfiles`, просто для вашего удобства, как разработчика. Но на самом деле это берётся напрямую из библиотеки Starlette.
diff --git a/docs/ru/docs/tutorial/testing.md b/docs/ru/docs/tutorial/testing.md
index ca47a6f51..4772660df 100644
--- a/docs/ru/docs/tutorial/testing.md
+++ b/docs/ru/docs/tutorial/testing.md
@@ -50,7 +50,7 @@
### Файл приложения **FastAPI**
-Допустим, структура файлов Вашего приложения похожа на ту, что описана на странице [Более крупные приложения](./bigger-applications.md){.internal-link target=_blank}:
+Допустим, структура файлов Вашего приложения похожа на ту, что описана на странице [Более крупные приложения](bigger-applications.md){.internal-link target=_blank}:
```
.
diff --git a/docs/tr/docs/about/index.md b/docs/tr/docs/about/index.md
new file mode 100644
index 000000000..e9dee5217
--- /dev/null
+++ b/docs/tr/docs/about/index.md
@@ -0,0 +1,3 @@
+# Hakkında
+
+FastAPI, tasarımı, ilham kaynağı ve daha fazlası hakkında. 🤓
diff --git a/docs/tr/docs/alternatives.md b/docs/tr/docs/alternatives.md
new file mode 100644
index 000000000..462d8b304
--- /dev/null
+++ b/docs/tr/docs/alternatives.md
@@ -0,0 +1,409 @@
+# Alternatifler, İlham Kaynakları ve Karşılaştırmalar
+
+**FastAPI**'ya neler ilham verdi? Diğer alternatiflerle karşılaştırıldığında farkları neler? **FastAPI** diğer alternatiflerinden neler öğrendi?
+
+## Giriş
+
+Başkalarının daha önceki çalışmaları olmasaydı, **FastAPI** var olmazdı.
+
+Geçmişte oluşturulan pek çok araç **FastAPI**'a ilham kaynağı olmuştur.
+
+Yıllardır yeni bir framework oluşturmaktan kaçınıyordum. Başlangıçta **FastAPI**'ın çözdüğü sorunları çözebilmek için pek çok farklı framework, eklenti ve araç kullanmayı denedim.
+
+Ancak bir noktada, geçmişteki diğer araçlardan en iyi fikirleri alarak bütün bu çözümleri kapsayan, ayrıca bütün bunları Python'ın daha önce mevcut olmayan özelliklerini (Python 3.6+ ile gelen tip belirteçleri) kullanarak yapan bir şey üretmekten başka seçenek kalmamıştı.
+
+## Daha Önce Geliştirilen Araçlar
+
+### Django
+
+Django geniş çapta güvenilen, Python ekosistemindeki en popüler web framework'üdür. Instagram gibi sistemleri geliştirmede kullanılmıştır.
+
+MySQL ve PostgreSQL gibi ilişkisel veritabanlarıyla nispeten sıkı bir şekilde bağlantılıdır. Bu nedenle Couchbase, MongoDB ve Cassandra gibi NoSQL veritabanlarını ana veritabanı motoru olarak kullanmak pek de kolay değil.
+
+Modern ön uçlarda (React, Vue.js ve Angular gibi) veya diğer sistemler (örneğin nesnelerin interneti cihazları) tarafından kullanılan API'lar yerine arka uçta HTML üretmek için oluşturuldu.
+
+### Django REST Framework
+
+Django REST framework'ü, Django'nun API kabiliyetlerini arttırmak için arka planda Django kullanan esnek bir araç grubu olarak oluşturuldu.
+
+Üstelik Mozilla, Red Hat ve Eventbrite gibi pek çok şirket tarafından kullanılıyor.
+
+**Otomatik API dökümantasyonu**nun ilk örneklerinden biri olduğu için, **FastAPI** arayışına ilham veren ilk fikirlerden biri oldu.
+
+!!! note "Not"
+ Django REST Framework'ü, aynı zamanda **FastAPI**'ın dayandığı Starlette ve Uvicorn'un da yaratıcısı olan Tom Christie tarafından geliştirildi.
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ Kullanıcılar için otomatik API dökümantasyonu sunan bir web arayüzüne sahip olmalı.
+
+### Flask
+
+Flask bir mikro framework olduğundan Django gibi framework'lerin aksine veritabanı entegrasyonu gibi Django ile gelen pek çok özelliği direkt barındırmaz.
+
+Sağladığı basitlik ve esneklik NoSQL veritabanlarını ana veritabanı sistemi olarak kullanmak gibi şeyler yapmaya olanak sağlar.
+
+Yapısı oldukça basit olduğundan öğrenmesi de nispeten basittir, tabii dökümantasyonu bazı noktalarda biraz teknik hale geliyor.
+
+Ayrıca Django ile birlikte gelen veritabanı, kullanıcı yönetimi ve diğer pek çok özelliğe ihtiyaç duymayan uygulamalarda da yaygın olarak kullanılıyor. Ancak bu tür özelliklerin pek çoğu eklentiler ile eklenebiliyor.
+
+Uygulama parçalarının böyle ayrılıyor oluşu ve istenilen özelliklerle genişletilebilecek bir mikro framework olmak tam da benim istediğim bir özellikti.
+
+Flask'ın basitliği göz önünde bulundurulduğu zaman, API geliştirmek için iyi bir seçim gibi görünüyordu. Sıradaki şey ise Flask için bir "Django REST Framework"!
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ Gereken araçları ve parçaları birleştirip eşleştirmeyi kolaylaştıracak bir mikro framework olmalı.
+
+ Basit ve kullanması kolay bir yönlendirme sistemine sahip olmalı.
+
+### Requests
+
+**FastAPI** aslında **Requests**'in bir alternatifi değil. İkisininde kapsamı oldukça farklı.
+
+Aslında Requests'i bir FastAPI uygulamasının *içinde* kullanmak daha olağan olurdu.
+
+Ama yine de, FastAPI, Requests'ten oldukça ilham aldı.
+
+**Requests**, API'lar ile bir istemci olarak *etkileşime geçmeyi* sağlayan bir kütüphaneyken **FastAPI** bir sunucu olarak API'lar oluşturmaya yarar.
+
+Öyle ya da böyle zıt uçlarda olmalarına rağmen birbirlerini tamamlıyorlar.
+
+Requests oldukça basit ve sezgisel bir tasarıma sahip, kullanması da mantıklı varsayılan değerlerle oldukça kolay. Ama aynı zamanda çok güçlü ve gayet özelleştirilebilir.
+
+Bu yüzden resmi web sitede de söylendiği gibi:
+
+> Requests, tüm zamanların en çok indirilen Python paketlerinden biridir.
+
+Kullanım şekli oldukça basit. Örneğin bir `GET` isteği yapmak için aşağıdaki yeterli:
+
+```Python
+response = requests.get("http://example.com/some/url")
+```
+
+Bunun FastAPI'deki API *yol işlemi* şöyle görünür:
+
+```Python hl_lines="1"
+@app.get("/some/url")
+def read_url():
+ return {"message": "Hello World!"}
+```
+
+`requests.get(...)` ile `@app.get(...)` arasındaki benzerliklere bakın.
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ * Basit ve sezgisel bir API'ya sahip olmalı.
+ * HTTP metot isimlerini (işlemlerini) anlaşılır olacak bir şekilde, direkt kullanmalı.
+ * Mantıklı varsayılan değerlere ve buna rağmen güçlü bir özelleştirme desteğine sahip olmalı.
+
+### Swagger / OpenAPI
+
+Benim Django REST Framework'ünden istediğim ana özellik otomatik API dökümantasyonuydu.
+
+Daha sonra API'ları dökümanlamak için Swagger adında JSON (veya JSON'un bir uzantısı olan YAML'ı) kullanan bir standart olduğunu buldum.
+
+Üstelik Swagger API'ları için zaten halihazırda oluşturulmuş bir web arayüzü vardı. Yani, bir API için Swagger dökümantasyonu oluşturmak bu arayüzü otomatik olarak kullanabilmek demekti.
+
+Swagger bir noktada Linux Foundation'a verildi ve adı OpenAPI olarak değiştirildi.
+
+İşte bu yüzden versiyon 2.0 hakkında konuşurken "Swagger", versiyon 3 ve üzeri için ise "OpenAPI" adını kullanmak daha yaygın.
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ API spesifikasyonları için özel bir şema yerine bir açık standart benimseyip kullanmalı.
+
+ Ayrıca standarda bağlı kullanıcı arayüzü araçlarını entegre etmeli:
+
+ * Swagger UI
+ * ReDoc
+
+ Yukarıdaki ikisi oldukça popüler ve istikrarlı olduğu için seçildi, ancak hızlı bir araştırma yaparak **FastAPI** ile kullanabileceğiniz pek çok OpenAPI alternatifi arayüz bulabilirsiniz.
+
+### Flask REST framework'leri
+
+Pek çok Flask REST framework'ü var, fakat bunları biraz araştırdıktan sonra pek çoğunun artık geliştirilmediğini ve göze batan bazı sorunlarının olduğunu gördüm.
+
+### Marshmallow
+
+API sistemlerine gereken ana özelliklerden biri de koddan veriyi alıp ağ üzerinde gönderilebilecek bir şeye çevirmek, yani veri dönüşümü. Bu işleme veritabanındaki veriyi içeren bir objeyi JSON objesine çevirmek, `datetime` objelerini metinlere çevirmek gibi örnekler verilebilir.
+
+API'lara gereken bir diğer büyük özellik ise veri doğrulamadır, yani verinin çeşitli parametrelere bağlı olarak doğru ve tutarlı olduğundan emin olmaktır. Örneğin bir alanın `int` olmasına karar verdiniz, daha sonra rastgele bir metin değeri almasını istemezsiniz. Bu özellikle sisteme dışarıdan gelen veri için kullanışlı bir özellik oluyor.
+
+Bir veri doğrulama sistemi olmazsa bütün bu kontrolleri koda dökerek kendiniz yapmak zorunda kalırdınız.
+
+Marshmallow bu özellikleri sağlamak için geliştirilmişti. Benim de geçmişte oldukça sık kullandığım harika bir kütüphanedir.
+
+Ama... Python'un tip belirteçleri gelmeden önce oluşturulmuştu. Yani her şemayı tanımlamak için Marshmallow'un sunduğu spesifik araçları ve sınıfları kullanmanız gerekiyordu.
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ Kod kullanarak otomatik olarak veri tipini ve veri doğrulamayı belirten "şemalar" tanımlamalı.
+
+### Webargs
+
+API'ların ihtiyacı olan bir diğer önemli özellik ise gelen isteklerdeki verileri Python objelerine ayrıştırabilmektir.
+
+Webargs, Flask gibi bir kaç framework'ün üzerinde bunu sağlamak için geliştirilen bir araçtır.
+
+Veri doğrulama için arka planda Marshmallow kullanıyor, hatta aynı geliştiriciler tarafından oluşturuldu.
+
+Webargs da harika bir araç ve onu da geçmişte henüz **FastAPI** yokken çok kullandım.
+
+!!! info "Bilgi"
+ Webargs aynı Marshmallow geliştirileri tarafından oluşturuldu.
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ Gelen istek verisi için otomatik veri doğrulamaya sahip olmalı.
+
+### APISpec
+
+Marshmallow ve Webargs eklentiler olarak; veri doğrulama, ayrıştırma ve dönüştürmeyi sağlıyor.
+
+Ancak dökümantasyondan hala ses seda yok. Daha sonrasında ise APISpec geldi.
+
+APISpec pek çok framework için bir eklenti olarak kullanılıyor (Starlette için de bir eklentisi var).
+
+Şemanın tanımını yol'a istek geldiğinde çalışan her bir fonksiyonun döküman dizesinin içine YAML formatında olacak şekilde yazıyorsunuz o da OpenAPI şemaları üretiyor.
+
+Flask, Starlette, Responder ve benzerlerinde bu şekilde çalışıyor.
+
+Fakat sonrasında yine mikro sözdizimi problemiyle karşılaşıyoruz. Python metinlerinin içinde koskoca bir YAML oluyor.
+
+Editör bu konuda pek yardımcı olamaz. Üstelik eğer parametreleri ya da Marshmallow şemalarını değiştirip YAML kodunu güncellemeyi unutursak artık döküman geçerliliğini yitiriyor.
+
+!!! info "Bilgi"
+ APISpec de aynı Marshmallow geliştiricileri tarafından oluşturuldu.
+
+!!! check "**FastAPI**'a nasıl ilham verdi?"
+ API'lar için açık standart desteği olmalı (OpenAPI gibi).
+
+### Flask-apispec
+
+Flask-apispec ise Webargs, Marshmallow ve APISpec'i birbirine bağlayan bir Flask eklentisi.
+
+Webargs ve Marshmallow'daki bilgiyi APISpec ile otomatik OpenAPI şemaları üretmek için kullanıyor.
+
+Hak ettiği değeri görmeyen, harika bir araç. Piyasadaki çoğu Flask eklentisinden çok daha popüler olmalı. Hak ettiği değeri görmüyor oluşunun sebebi ise dökümantasyonun çok kısa ve soyut olması olabilir.
+
+Böylece Flask-apispec, Python döküman dizilerine YAML gibi farklı bir syntax yazma sorununu çözmüş oldu.
+
+**FastAPI**'ı geliştirene dek benim favori arka uç kombinasyonum Flask'in yanında Marshmallow ve Webargs ile birlikte Flask-apispec idi.
+
+Bunu kullanmak, bir kaç full-stack Flask projesi oluşturucusunun yaratılmasına yol açtı. Bunlar benim (ve bir kaç harici ekibin de) şimdiye kadar kullandığı asıl stackler:
+
+* https://github.com/tiangolo/full-stack
+* https://github.com/tiangolo/full-stack-flask-couchbase
+* https://github.com/tiangolo/full-stack-flask-couchdb
+
+Aynı full-stack üreticiler [**FastAPI** Proje Üreticileri](project-generation.md){.internal-link target=_blank}'nin de temelini oluşturdu.
+
+!!! info "Bilgi"
+ Flask-apispec de aynı Marshmallow geliştiricileri tarafından üretildi.
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Veri dönüşümü ve veri doğrulamayı tanımlayan kodu kullanarak otomatik olarak OpenAPI şeması oluşturmalı.
+
+### NestJS (and Angular)
+
+Bu Python teknolojisi bile değil. NestJS, Angulardan ilham almış olan bir JavaScript (TypeScript) NodeJS framework'ü.
+
+Flask-apispec ile yapılabileceklere nispeten benzeyen bir şey elde ediyor.
+
+Angular 2'den ilham alan, içine gömülü bir bağımlılık enjeksiyonu sistemi var. Bildiğim diğer tüm bağımlılık enjeksiyonu sistemlerinde olduğu gibi"bağımlılık"ları önceden kaydetmenizi gerektiriyor. Böylece projeyi daha detaylı hale getiriyor ve kod tekrarını da arttırıyor.
+
+Parametreler TypeScript tipleri (Python tip belirteçlerine benzer) ile açıklandığından editör desteği oldukça iyi.
+
+Ama TypeScript verileri kod JavaScript'e derlendikten sonra korunmadığından, bunlara dayanarak aynı anda veri doğrulaması, veri dönüşümü ve dökümantasyon tanımlanamıyor. Bundan ve bazı tasarım tercihlerinden dolayı veri doğrulaması, dönüşümü ve otomatik şema üretimi için pek çok yere dekorator eklemek gerekiyor. Bu da projeyi oldukça detaylandırıyor.
+
+İç içe geçen derin modelleri pek iyi işleyemiyor. Yani eğer istekteki JSON gövdesi derin bir JSON objesiyse düzgün bir şekilde dökümante edilip doğrulanamıyor.
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Güzel bir editör desteği için Python tiplerini kullanmalı.
+
+ Güçlü bir bağımlılık enjeksiyon sistemine sahip olmalı. Kod tekrarını minimuma indirecek bir yol bulmalı.
+
+### Sanic
+
+Sanic, `asyncio`'ya dayanan son derece hızlı Python kütüphanelerinden biriydi. Flask'a epey benzeyecek şekilde geliştirilmişti.
+
+!!! note "Teknik detaylar"
+ İçerisinde standart Python `asyncio` döngüsü yerine `uvloop` kullanıldı. Hızının asıl kaynağı buydu.
+
+ Uvicorn ve Starlette'e ilham kaynağı olduğu oldukça açık, şu anda ikisi de açık karşılaştırmalarda Sanicten daha hızlı gözüküyor.
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Uçuk performans sağlayacak bir yol bulmalı.
+
+ Tam da bu yüzden **FastAPI** Starlette'e dayanıyor, çünkü Starlette şu anda kullanılabilir en hızlı framework. (üçüncü parti karşılaştırmalı testlerine göre)
+
+### Falcon
+
+Falcon ise bir diğer yüksek performanslı Python framework'ü. Minimal olacak şekilde Hug gibi diğer framework'lerin temeli olabilmek için tasarlandı.
+
+İki parametre kabul eden fonksiyonlar şeklinde tasarlandı, biri "istek" ve diğeri ise "cevap". Sonra isteğin çeşitli kısımlarını **okuyor**, cevaba ise bir şeyler **yazıyorsunuz**. Bu tasarımdan dolayı istek parametrelerini ve gövdelerini standart Python tip belirteçlerini kullanarak fonksiyon parametreleriyle belirtmek mümkün değil.
+
+Yani veri doğrulama, veri dönüştürme ve dökümantasyonun hepsi kodda yer almalı, otomatik halledemiyoruz. Ya da Falcon üzerine bir framework olarak uygulanmaları gerekiyor, aynı Hug'da olduğu gibi. Bu ayrım Falcon'un tasarımından esinlenen, istek ve cevap objelerini parametre olarak işleyen diğer kütüphanelerde de yer alıyor.
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Harika bir performans'a sahip olmanın yollarını bulmalı.
+
+ Hug ile birlikte (Hug zaten Falcon'a dayandığından) **FastAPI**'ın fonksiyonlarda `cevap` parametresi belirtmesinde ilham kaynağı oldu.
+
+ FastAPI'da opsiyonel olmasına rağmen, daha çok header'lar, çerezler ve alternatif durum kodları belirlemede kullanılıyor.
+
+### Molten
+
+**FastAPI**'ı geliştirmenin ilk aşamalarında Molten'ı keşfettim. Pek çok ortak fikrimiz vardı:
+
+* Python'daki tip belirteçlerini baz alıyordu.
+* Bunlara bağlı olarak veri doğrulaması ve dökümantasyon sağlıyordu.
+* Bir bağımlılık enjeksiyonu sistemi vardı.
+
+Veri doğrulama, veri dönüştürme ve dökümantasyon için Pydantic gibi bir üçüncü parti kütüphane kullanmıyor, kendi içerisinde bunlara sahip. Yani bu veri tipi tanımlarını tekrar kullanmak pek de kolay değil.
+
+Biraz daha detaylı ayarlamalara gerek duyuyor. Ayrıca ASGI yerine WSGI'a dayanıyor. Yani Uvicorn, Starlette ve Sanic gibi araçların yüksek performansından faydalanacak şekilde tasarlanmamış.
+
+Bağımlılık enjeksiyonu sistemi bağımlılıkların önceden kaydedilmesini ve sonrasında belirlenen veri tiplerine göre çözülmesini gerektiriyor. Yani spesifik bir tip, birden fazla bileşen ile belirlenemiyor.
+
+Yol'lar fonksiyonun üstünde endpoint'i işleyen dekoratörler yerine farklı yerlerde tanımlanan fonksiyonlarla belirlenir. Bu Flask (ve Starlette) yerine daha çok Django'nun yaklaşımına daha yakın bir metot. Bu, kodda nispeten birbiriyle sıkı ilişkili olan şeyleri ayırmaya sebep oluyor.
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Model özelliklerinin "standart" değerlerini kullanarak veri tipleri için ekstra veri doğrulama koşulları tanımlamalı. Bu editör desteğini geliştiriyor ve daha önceden Pydantic'te yoktu.
+
+ Bu aslında Pydantic'in de aynı doğrulama stiline geçmesinde ilham kaynağı oldu. Şu anda bütün bu özellikler Pydantic'in yapısında yer alıyor.
+
+### Hug
+
+Hug, Python tip belirteçlerini kullanarak API parametrelerinin tipini belirlemeyi uygulayan ilk framework'lerdendi. Bu, diğer araçlara da ilham kaynağı olan harika bir fikirdi.
+
+Tip belirlerken standart Python veri tipleri yerine kendi özel tiplerini kullandı, yine de bu ileriye dönük devasa bir adımdı.
+
+Hug ayrıca tüm API'ı JSON ile ifade eden özel bir şema oluşturan ilk framework'lerdendir.
+
+OpenAPI veya JSON Şeması gibi bir standarda bağlı değildi. Yani Swagger UI gibi diğer araçlarla entegre etmek kolay olmazdı. Ama yine de, bu oldukça yenilikçi bir fikirdi.
+
+Ayrıca ilginç ve çok rastlanmayan bir özelliği vardı: aynı framework'ü kullanarak hem API'lar hem de CLI'lar oluşturmak mümkündü.
+
+Senkron çalışan Python web framework'lerinin standardına (WSGI) dayandığından dolayı Websocket'leri ve diğer şeyleri işleyemiyor, ancak yine de yüksek performansa sahip.
+
+!!! info "Bilgi"
+ Hug, Python dosyalarında bulunan dahil etme satırlarını otomatik olarak sıralayan harika bir araç olan `isort`'un geliştiricisi Timothy Crosley tarafından geliştirildi.
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Hug, APIStar'ın çeşitli kısımlarında esin kaynağı oldu ve APIStar'la birlikte en umut verici bulduğum araçlardan biriydi.
+
+ **FastAPI**, Python tip belirteçlerini kullanarak parametre belirlemede ve API'ı otomatık tanımlayan bir şema üretmede de Hug'a esinlendi.
+
+ **FastAPI**'ın header ve çerez tanımlamak için fonksiyonlarda `response` parametresini belirtmesinde de Hug'dan ilham alındı.
+
+### APIStar (<= 0.5)
+
+**FastAPI**'ı geliştirmeye başlamadan hemen önce **APIStar** sunucusunu buldum. Benim aradığım şeylerin neredeyse hepsine sahipti ve harika bir tasarımı vardı.
+
+Benim şimdiye kadar gördüğüm Python tip belirteçlerini kullanarak parametre ve istekler belirlemeyi uygulayan ilk framework'lerdendi (Molten ve NestJS'den önce). APIStar'ı da aşağı yukarı Hug ile aynı zamanlarda buldum. Fakat APIStar OpenAPI standardını kullanıyordu.
+
+Farklı yerlerdeki tip belirteçlerine bağlı olarak otomatik veri doğrulama, veri dönüştürme ve OpenAPI şeması oluşturma desteği sunuyordu.
+
+Gövde şema tanımları Pydantic ile aynı Python tip belirteçlerini kullanmıyordu, biraz daha Marsmallow'a benziyordu. Dolayısıyla editör desteği de o kadar iyi olmazdı ama APIStar eldeki en iyi seçenekti.
+
+O dönemlerde karşılaştırmalarda en iyi performansa sahipti (yalnızca Starlette'e kaybediyordu).
+
+Başlangıçta otomatik API dökümantasyonu sunan bir web arayüzü yoktu, ama ben ona Swagger UI ekleyebileceğimi biliyordum.
+
+Bağımlılık enjeksiyon sistemi vardı. Yukarıda bahsettiğim diğer araçlar gibi bundaki sistem de bileşenlerin önceden kaydedilmesini gerektiriyordu. Yine de harika bir özellikti.
+
+Güvenlik entegrasyonu olmadığından dolayı APIStar'ı hiç bir zaman tam bir projede kullanamadım. Bu yüzden Flask-apispec'e bağlı full-stack proje üreticilerde sahip olduğum özellikleri tamamen değiştiremedim. Bu güvenlik entegrasyonunu ekleyen bir PR oluşturmak da projelerim arasında yer alıyordu.
+
+Sonrasında ise projenin odağı değişti.
+
+Geliştiricinin Starlette'e odaklanması gerekince proje de artık bir API web framework'ü olmayı bıraktı.
+
+Artık APIStar, OpenAPI özelliklerini doğrulamak için bir dizi araç sunan bir proje haline geldi.
+
+!!! info "Bilgi"
+ APIStar, aşağıdaki projeleri de üreten Tom Christie tarafından geliştirildi:
+
+ * Django REST Framework
+ * **FastAPI**'ın da dayandığı Starlette
+ * Starlette ve **FastAPI** tarafından da kullanılan Uvicorn
+
+!!! check "**FastAPI**'a nasıl ilham oldu?"
+ Var oldu.
+
+ Aynı Python veri tipleriyle birden fazla şeyi belirleme (veri doğrulama, veri dönüştürme ve dökümantasyon), bir yandan da harika bir editör desteği sunma, benim muhteşem bulduğum bir fikirdi.
+
+ Uzunca bir süre boyunca benzer bir framework arayıp pek çok farklı alternatifi denedikten sonra, APIStar en iyi seçenekti.
+
+ Sonra APIStar bir sunucu olmayı bıraktı ve Starlette oluşturuldu. Starlette, böyle bir sunucu sistemi için daha iyi bir temel sunuyordu. Bu da **FastAPI**'ın son esin kaynağıydı.
+
+ Ben bu önceki araçlardan öğrendiklerime dayanarak **FastAPI**'ın özelliklerini arttırıp geliştiriyor, tip desteği sistemi ve diğer kısımları iyileştiriyorum ancak yine de **FastAPI**'ı APIStar'ın "ruhani varisi" olarak görüyorum.
+
+## **FastAPI** Tarafından Kullanılanlar
+
+### Pydantic
+
+Pydantic Python tip belirteçlerine dayanan; veri doğrulama, veri dönüştürme ve dökümantasyon tanımlamak (JSON Şema kullanarak) için bir kütüphanedir.
+
+Tip belirteçleri kullanıyor olması onu aşırı sezgisel yapıyor.
+
+Marshmallow ile karşılaştırılabilir. Ancak karşılaştırmalarda Marshmallowdan daha hızlı görünüyor. Aynı Python tip belirteçlerine dayanıyor ve editör desteği de harika.
+
+!!! check "**FastAPI** nerede kullanıyor?"
+ Bütün veri doğrulama, veri dönüştürme ve JSON Şemasına bağlı otomatik model dökümantasyonunu halletmek için!
+
+ **FastAPI** yaptığı her şeyin yanı sıra bu JSON Şema verisini alıp daha sonra OpenAPI'ya yerleştiriyor.
+
+### Starlette
+
+Starlette hafif bir ASGI framework'ü ve yüksek performanslı asyncio servisleri oluşturmak için ideal.
+
+Kullanımı çok kolay ve sezgisel, kolaylıkla genişletilebilecek ve modüler bileşenlere sahip olacak şekilde tasarlandı.
+
+Sahip olduğu bir kaç özellik:
+
+* Cidden etkileyici bir performans.
+* WebSocket desteği.
+* İşlem-içi arka plan görevleri.
+* Başlatma ve kapatma olayları.
+* HTTPX ile geliştirilmiş bir test istemcisi.
+* CORS, GZip, Static Files ve Streaming cevapları desteği.
+* Session ve çerez desteği.
+* Kodun %100'ü test kapsamında.
+* Kodun %100'ü tip belirteçleriyle desteklenmiştir.
+* Yalnızca bir kaç zorunlu bağımlılığa sahip.
+
+Starlette şu anda test edilen en hızlı Python framework'ü. Yalnızca bir sunucu olan Uvicorn'a yeniliyor, o da zaten bir framework değil.
+
+Starlette bütün temel web mikro framework işlevselliğini sağlıyor.
+
+Ancak otomatik veri doğrulama, veri dönüştürme ve dökümantasyon sağlamyor.
+
+Bu, **FastAPI**'ın onun üzerine tamamen Python tip belirteçlerine bağlı olarak eklediği (Pydantic ile) ana şeylerden biri. **FastAPI** bunun yanında artı olarak bağımlılık enjeksiyonu sistemi, güvenlik araçları, OpenAPI şema üretimi ve benzeri özellikler de ekliyor.
+
+!!! note "Teknik Detaylar"
+ ASGI, Django'nun ana ekibi tarafından geliştirilen yeni bir "standart". Bir "Python standardı" (PEP) olma sürecinde fakat henüz bir standart değil.
+
+ Bununla birlikte, halihazırda birçok araç tarafından bir "standart" olarak kullanılmakta. Bu, Uvicorn'u farklı ASGI sunucularıyla (Daphne veya Hypercorn gibi) değiştirebileceğiniz veya `python-socketio` gibi ASGI ile uyumlu araçları ekleyebileciğiniz için birlikte çalışılabilirliği büyük ölçüde arttırıyor.
+
+!!! check "**FastAPI** nerede kullanıyor?"
+
+ Tüm temel web kısımlarında üzerine özellikler eklenerek kullanılmakta.
+
+ `FastAPI` sınıfının kendisi direkt olarak `Starlette` sınıfını miras alıyor!
+
+ Yani, Starlette ile yapabileceğiniz her şeyi, Starlette'in bir nevi güçlendirilmiş hali olan **FastAPI** ile doğrudan yapabilirsiniz.
+
+### Uvicorn
+
+Uvicorn, uvlook ile httptools üzerine kurulu ışık hzında bir ASGI sunucusudur.
+
+Bir web framework'ünden ziyade bir sunucudur, yani yollara bağlı yönlendirme yapmanızı sağlayan araçları yoktur. Bu daha çok Starlette (ya da **FastAPI**) gibi bir framework'ün sunucuya ek olarak sağladığı bir şeydir.
+
+Starlette ve **FastAPI** için tavsiye edilen sunucu Uvicorndur.
+
+!!! check "**FastAPI** neden tavsiye ediyor?"
+ **FastAPI** uygulamalarını çalıştırmak için ana web sunucusu Uvicorn!
+
+ Gunicorn ile birleştirdiğinizde asenkron ve çoklu işlem destekleyen bir sunucu elde ediyorsunuz!
+
+ Daha fazla detay için [Deployment](deployment/index.md){.internal-link target=_blank} bölümünü inceleyebilirsiniz.
+
+## Karşılaştırma ve Hız
+
+Uvicorn, Starlette ve FastAPI arasındakı farkı daha iyi anlamak ve karşılaştırma yapmak için [Kıyaslamalar](benchmarks.md){.internal-link target=_blank} bölümüne bakın!
diff --git a/docs/tr/docs/async.md b/docs/tr/docs/async.md
new file mode 100644
index 000000000..c7bedffd1
--- /dev/null
+++ b/docs/tr/docs/async.md
@@ -0,0 +1,401 @@
+# Concurrency ve async / await
+
+*path operasyon fonksiyonu* için `async def `sözdizimi, asenkron kod, eşzamanlılık ve paralellik hakkında bazı ayrıntılar.
+
+## Aceleniz mi var?
+
+TL;DR:
+
+Eğer `await` ile çağrılması gerektiğini belirten üçüncü taraf kütüphaneleri kullanıyorsanız, örneğin:
+
+```Python
+results = await some_library()
+```
+
+O zaman *path operasyon fonksiyonunu* `async def` ile tanımlayın örneğin:
+
+```Python hl_lines="2"
+@app.get('/')
+async def read_results():
+ results = await some_library()
+ return results
+```
+
+!!! note "Not"
+ Sadece `async def` ile tanımlanan fonksiyonlar içinde `await` kullanabilirsiniz.
+
+---
+
+Eğer bir veritabanı, bir API, dosya sistemi vb. ile iletişim kuran bir üçüncü taraf bir kütüphane kullanıyorsanız ve `await` kullanımını desteklemiyorsa, (bu şu anda çoğu veritabanı kütüphanesi için geçerli bir durumdur), o zaman *path operasyon fonksiyonunuzu* `def` kullanarak normal bir şekilde tanımlayın, örneğin:
+
+```Python hl_lines="2"
+@app.get('/')
+def results():
+ results = some_library()
+ return results
+```
+
+---
+
+Eğer uygulamanız (bir şekilde) başka bir şeyle iletişim kurmak ve onun cevap vermesini beklemek zorunda değilse, `async def` kullanın.
+
+---
+
+Sadece bilmiyorsanız, normal `def` kullanın.
+
+---
+
+**Not**: *path operasyon fonksiyonlarınızda* `def` ve `async def`'i ihtiyaç duyduğunuz gibi karıştırabilir ve her birini sizin için en iyi seçeneği kullanarak tanımlayabilirsiniz. FastAPI onlarla doğru olanı yapacaktır.
+
+Her neyse, yukarıdaki durumlardan herhangi birinde, FastAPI yine de asenkron olarak çalışacak ve son derece hızlı olacaktır.
+
+Ancak yukarıdaki adımları takip ederek, bazı performans optimizasyonları yapılabilecektir.
+
+## Teknik Detaylar
+
+Python'un modern versiyonlarında **`async` ve `await`** sözdizimi ile **"coroutines"** kullanan **"asenkron kod"** desteğine sahiptir.
+
+Bu ifadeyi aşağıdaki bölümlerde daha da ayrıntılı açıklayalım:
+
+* **Asenkron kod**
+* **`async` ve `await`**
+* **Coroutines**
+
+## Asenkron kod
+
+Asenkron kod programlama dilinin 💬 bilgisayara / programa 🤖 kodun bir noktasında, *başka bir kodun* bir yerde bitmesini 🤖 beklemesi gerektiğini söylemenin bir yoludur. Bu *başka koda* "slow-file" denir 📝.
+
+Böylece, bu süreçte bilgisayar "slow-file" 📝 tamamlanırken gidip başka işler yapabilir.
+
+Sonra bilgisayar / program 🤖 her fırsatı olduğunda o noktada yaptığı tüm işleri 🤖 bitirene kadar geri dönücek. Ve 🤖 yapması gerekeni yaparak, beklediği görevlerden herhangi birinin bitip bitmediğini görecek.
+
+Ardından, 🤖 bitirmek için ilk görevi alır ("slow-file" 📝) ve onunla ne yapması gerekiyorsa onu devam ettirir.
+
+Bu "başka bir şey için bekle" normalde, aşağıdakileri beklemek gibi (işlemcinin ve RAM belleğinin hızına kıyasla) nispeten "yavaş" olan I/O işlemlerine atıfta bulunur:
+
+* istemci tarafından ağ üzerinden veri göndermek
+* ağ üzerinden istemciye gönderilen veriler
+* sistem tarafından okunacak ve programınıza verilecek bir dosya içeriği
+* programınızın diske yazılmak üzere sisteme verdiği dosya içerikleri
+* uzak bir API işlemi
+* bir veritabanı bitirme işlemi
+* sonuçları döndürmek için bir veritabanı sorgusu
+* vb.
+
+Yürütme süresi çoğunlukla I/O işlemleri beklenerek tüketildiğinden bunlara "I/O bağlantılı" işlemler denir.
+
+Buna "asenkron" denir, çünkü bilgisayar/program yavaş görevle "senkronize" olmak zorunda değildir, görevin tam olarak biteceği anı bekler, hiçbir şey yapmadan, görev sonucunu alabilmek ve çalışmaya devam edebilmek için .
+
+Bunun yerine, "asenkron" bir sistem olarak, bir kez bittiğinde, bilgisayarın / programın yapması gerekeni bitirmesi için biraz (birkaç mikrosaniye) sırada bekleyebilir ve ardından sonuçları almak için geri gelebilir ve onlarla çalışmaya devam edebilir.
+
+"Senkron" ("asenkron"un aksine) için genellikle "sıralı" terimini de kullanırlar, çünkü bilgisayar/program, bu adımlar beklemeyi içerse bile, farklı bir göreve geçmeden önce tüm adımları sırayla izler.
+
+
+### Eşzamanlılık (Concurrency) ve Burgerler
+
+
+Yukarıda açıklanan bu **asenkron** kod fikrine bazen **"eşzamanlılık"** da denir. **"Paralellikten"** farklıdır.
+
+**Eşzamanlılık** ve **paralellik**, "aynı anda az ya da çok olan farklı işler" ile ilgilidir.
+
+Ancak *eşzamanlılık* ve *paralellik* arasındaki ayrıntılar oldukça farklıdır.
+
+
+Farkı görmek için burgerlerle ilgili aşağıdaki hikayeyi hayal edin:
+
+### Eşzamanlı Burgerler
+
+
+
+Aşkınla beraber 😍 dışarı hamburger yemeye çıktınız 🍔, kasiyer 💁 öndeki insanlardan sipariş alırken siz sıraya girdiniz.
+
+Sıra sizde ve sen aşkın 😍 ve kendin için 2 çılgın hamburger 🍔 söylüyorsun.
+
+Ödemeyi yaptın 💸.
+
+Kasiyer 💁 mutfakdaki aşçıya 👨🍳 hamburgerleri 🍔 hazırlaması gerektiğini söyler ve aşçı bunu bilir (o an önceki müşterilerin siparişlerini hazırlıyor olsa bile).
+
+Kasiyer 💁 size bir sıra numarası verir.
+
+Beklerken askınla 😍 bir masaya oturur ve uzun bir süre konuşursunuz(Burgerleriniz çok çılgın olduğundan ve hazırlanması biraz zaman alıyor ✨🍔✨).
+
+Hamburgeri beklerkenki zamanı 🍔, aşkının ne kadar zeki ve tatlı olduğuna hayran kalarak harcayabilirsin ✨😍✨.
+
+Aşkınla 😍 konuşurken arada sıranın size gelip gelmediğini kontrol ediyorsun.
+
+Nihayet sıra size geldi. Tezgaha gidip hamburgerleri 🍔kapıp masaya geri dönüyorsun.
+
+Aşkınla hamburgerlerinizi yiyor 🍔 ve iyi vakit geçiriyorsunuz ✨.
+
+---
+
+Bu hikayedeki bilgisayar / program 🤖 olduğunuzu hayal edin.
+
+Sırada beklerken boştasın 😴, sıranı beklerken herhangi bir "üretim" yapmıyorsun. Ama bu sıra hızlı çünkü kasiyer sadece siparişleri alıyor (onları hazırlamıyor), burada bir sıknıtı yok.
+
+Sonra sıra size geldiğinde gerçekten "üretken" işler yapabilirsiniz 🤓, menüyü oku, ne istediğine larar ver, aşkının seçimini al 😍, öde 💸, doğru kartı çıkart, ödemeyi kontrol et, faturayı kontrol et, siparişin doğru olup olmadığını kontrol et, vb.
+
+Ama hamburgerler 🍔 hazır olmamasına rağmen Kasiyer 💁 ile işiniz "duraklıyor" ⏸, çünkü hamburgerlerin hazır olmasını bekliyoruz 🕙.
+
+Ama tezgahtan uzaklaşıp sıranız gelene kadarmasanıza dönebilir 🔀 ve dikkatinizi aşkınıza 😍 verebilirsiniz vr bunun üzerine "çalışabilirsiniz" ⏯ 🤓. Artık "üretken" birşey yapıyorsunuz 🤓, sevgilinle 😍 flört eder gibi.
+
+Kasiyer 💁 "Hamburgerler hazır !" 🍔 dediğinde ve görüntülenen numara sizin numaranız olduğunda hemen koşup hamburgerlerinizi almaya çalışmıyorsunuz. Biliyorsunuzki kimse sizin hamburgerlerinizi 🍔 çalmayacak çünkü sıra sizin.
+
+Yani Aşkınızın😍 hikayeyi bitirmesini bekliyorsunuz (çalışmayı bitir ⏯ / görev işleniyor.. 🤓), nazikçe gülümseyin ve hamburger yemeye gittiğinizi söyleyin ⏸.
+
+Ardından tezgaha 🔀, şimdi biten ilk göreve ⏯ gidin, Hamburgerleri 🍔 alın, teşekkür edin ve masaya götürün. sayacın bu adımı tamamlanır ⏹. Bu da yeni bir görev olan "hamburgerleri ye" 🔀 ⏯ görevini başlatırken "hamburgerleri al" ⏹ görevini bitirir.
+
+### Parallel Hamburgerler
+
+Şimdi bunların "Eşzamanlı Hamburger" değil, "Paralel Hamburger" olduğunu düşünelim.
+
+Hamburger 🍔 almak için 😍 aşkınla Paralel fast food'a gidiyorsun.
+
+Birden fazla kasiyer varken (varsayalım 8) sıraya girdiniz👩🍳👨🍳👩🍳👨🍳👩🍳👨🍳👩🍳👨🍳 ve sıranız gelene kadar bekliyorsunuz.
+
+Sizden önceki herkez ayrılmadan önce hamburgerlerinin 🍔 hazır olmasını bekliyor 🕙. Çünkü kasiyerlerin her biri bir hamburger hazırlanmadan önce bir sonraki siparişe geçmiiyor.
+
+Sonunda senin sıran, aşkın 😍 ve kendin için 2 hamburger 🍔 siparişi verdiniz.
+
+Ödemeyi yaptınız 💸.
+
+Kasiyer mutfağa gider 👨🍳.
+
+Sırada bekliyorsunuz 🕙, kimse sizin burgerinizi 🍔 almaya çalışmıyor çünkü sıra sizin.
+
+Sen ve aşkın 😍 sıranızı korumak ve hamburgerleri almakla o kadar meşgulsünüz ki birbirinize vakit 🕙 ayıramıyorsunuz 😞.
+
+İşte bu "senkron" çalışmadır. Kasiyer/aşçı 👨🍳ile senkron hareket ediyorsunuz. Bu yüzden beklemek 🕙 ve kasiyer/aşçı burgeri 🍔bitirip size getirdiğinde orda olmak zorundasınız yoksa başka biri alabilir.
+
+Sonra kasiyeri/aşçı 👨🍳 nihayet hamburgerlerinizle 🍔, uzun bir süre sonra 🕙 tezgaha geri geliyor.
+
+Burgerlerinizi 🍔 al ve aşkınla masanıza doğru ilerle 😍.
+
+Sadece burgerini yiyorsun 🍔 ve bitti ⏹.
+
+Bekleyerek çok fazla zaman geçtiğinden 🕙 konuşmaya çok fazla vakit kalmadı 😞.
+
+---
+
+Paralel burger senaryosunda ise, siz iki işlemcili birer robotsunuz 🤖 (sen ve sevgilin 😍), Beklıyorsunuz 🕙 hem konuşarak güzel vakit geçirirken ⏯ hem de sıranızı bekliyorsunuz 🕙.
+
+Mağazada ise 8 işlemci bulunuyor (Kasiyer/aşçı) 👩🍳👨🍳👩🍳👨🍳👩🍳👨🍳👩🍳👨🍳. Eşzamanlı burgerde yalnızca 2 kişi olabiliyordu (bir kasiyer ve bir aşçı) 💁 👨🍳.
+
+Ama yine de bu en iyisi değil 😞.
+
+---
+
+Bu hikaye burgerler 🍔 için paralel.
+
+Bir gerçek hayat örneği verelim. Bir banka hayal edin.
+
+Bankaların çoğunda birkaç kasiyer 👨💼👨💼👨💼👨💼 ve uzun bir sıra var 🕙🕙🕙🕙🕙🕙🕙🕙.
+
+Tüm işi sırayla bir müşteri ile yapan tüm kasiyerler 👨💼⏯.
+
+Ve uzun süre kuyrukta beklemek 🕙 zorundasın yoksa sıranı kaybedersin.
+
+Muhtemelen ayak işlerı yaparken sevgilini 😍 bankaya 🏦 getirmezsin.
+
+### Burger Sonucu
+
+Bu "aşkınla fast food burgerleri" senaryosunda, çok fazla bekleme olduğu için 🕙, eşzamanlı bir sisteme sahip olmak çok daha mantıklı ⏸🔀⏯.
+
+Web uygulamalarının çoğu için durum böyledir.
+
+Pek çok kullanıcı var, ama sunucunuz pek de iyi olmayan bir bağlantı ile istek atmalarını bekliyor.
+
+Ve sonra yanıtların geri gelmesi için tekrar 🕙 bekliyor
+
+Bu "bekleme" 🕙 mikrosaniye cinsinden ölçülür, yine de, hepsini toplarsak çok fazla bekleme var.
+
+Bu nedenle, web API'leri için asenkron ⏸🔀⏯ kod kullanmak çok daha mantıklı.
+
+Mevcut popüler Python frameworklerinin çoğu (Flask ve Django gibi), Python'daki yeni asenkron özellikler mevcut olmadan önce yazıldı. Bu nedenle, dağıtılma biçimleri paralel yürütmeyi ve yenisi kadar güçlü olmayan eski bir eşzamansız yürütme biçimini destekler.
+
+Asenkron web (ASGI) özelliği, WebSockets için destek eklemek için Django'ya eklenmiş olsa da.
+
+Asenkron çalışabilme NodeJS in popüler olmasının sebebi (paralel olamasa bile) ve Go dilini güçlü yapan özelliktir.
+
+Ve bu **FastAPI** ile elde ettiğiniz performans düzeyiyle aynıdır.
+
+Aynı anda paralellik ve asenkronluğa sahip olabildiğiniz için, test edilen NodeJS çerçevelerinin çoğundan daha yüksek performans elde edersiniz ve C'ye daha yakın derlenmiş bir dil olan Go ile eşit bir performans elde edersiniz (bütün teşekkürler Starlette'e ).
+
+### Eşzamanlılık paralellikten daha mı iyi?
+
+Hayır! Hikayenin ahlakı bu değil.
+
+Eşzamanlılık paralellikten farklıdır. Ve çok fazla bekleme içeren **belirli** senaryolarda daha iyidir. Bu nedenle, genellikle web uygulamaları için paralellikten çok daha iyidir. Ama her şey için değil.
+
+Yanı, bunu aklınızda oturtmak için aşağıdaki kısa hikayeyi hayal edin:
+
+> Büyük, kirli bir evi temizlemelisin.
+
+*Evet, tüm hikaye bu*.
+
+---
+
+Beklemek yok 🕙. Hiçbir yerde. Sadece evin birden fazla yerinde yapılacak fazlasıyla iş var.
+
+You could have turns as in the burgers example, first the living room, then the kitchen, but as you are not waiting 🕙 for anything, just cleaning and cleaning, the turns wouldn't affect anything.
+Hamburger örneğindeki gibi dönüşleriniz olabilir, önce oturma odası, sonra mutfak, ama hiçbir şey için 🕙 beklemediğinizden, sadece temizlik, temizlik ve temizlik, dönüşler hiçbir şeyi etkilemez.
+
+Sıralı veya sırasız (eşzamanlılık) bitirmek aynı zaman alır ve aynı miktarda işi yaparsınız.
+
+Ama bu durumda, 8 eski kasiyer/aşçı - yeni temizlikçiyi getirebilseydiniz 👩🍳👨🍳👩🍳👨🍳👩🍳👨🍳👩🍳👨🍳 ve her birini (artı siz) evin bir bölgesini temizlemek için görevlendirseydiniz, ekstra yardımla tüm işleri **paralel** olarak yapabilir ve çok daha erken bitirebilirdiniz.
+
+Bu senaryoda, temizlikçilerin her biri (siz dahil) birer işlemci olacak ve üzerine düşeni yapacaktır.
+
+Yürütme süresinin çoğu (beklemek yerine) iş yapıldığından ve bilgisayardaki iş bir CPU tarafından yapıldığından, bu sorunlara "CPU bound" diyorlar".
+
+---
+
+CPU'ya bağlı işlemlerin yaygın örnekleri, karmaşık matematik işlemleri gerektiren işlerdir.
+
+Örneğin:
+
+* **Ses** veya **görüntü işleme**.
+* **Bilgisayar görüsü**: bir görüntü milyonlarca pikselden oluşur, her pikselin 3 değeri / rengi vardır, bu pikseller üzerinde aynı anda bir şeyler hesaplamayı gerektiren işleme.
+* **Makine Öğrenimi**: Çok sayıda "matris" ve "vektör" çarpımı gerektirir. Sayıları olan ve hepsini aynı anda çarpan büyük bir elektronik tablo düşünün.
+* **Derin Öğrenme**: Bu, Makine Öğreniminin bir alt alanıdır, dolayısıyla aynısı geçerlidir. Sadece çarpılacak tek bir sayı tablosu değil, büyük bir sayı kümesi vardır ve çoğu durumda bu modelleri oluşturmak ve/veya kullanmak için özel işlemciler kullanırsınız.
+
+### Eşzamanlılık + Paralellik: Web + Makine Öğrenimi
+
+**FastAPI** ile web geliştirme için çok yaygın olan eşzamanlılıktan yararlanabilirsiniz (NodeJS'in aynı çekiciliği).
+
+Ancak, Makine Öğrenimi sistemlerindekile gibi **CPU'ya bağlı** iş yükleri için paralellik ve çoklu işlemenin (birden çok işlemin paralel olarak çalışması) avantajlarından da yararlanabilirsiniz.
+
+Buna ek olarak Python'un **Veri Bilimi**, Makine Öğrenimi ve özellikle Derin Öğrenme için ana dil olduğu gerçeği, FastAPI'yi Veri Bilimi / Makine Öğrenimi web API'leri ve uygulamaları için çok iyi bir seçenek haline getirir.
+
+Production'da nasıl oldugunu görmek için şu bölüme bakın [Deployment](deployment/index.md){.internal-link target=_blank}.
+
+## `async` ve `await`
+
+Python'un modern sürümleri, asenkron kodu tanımlamanın çok sezgisel bir yoluna sahiptir. Bu, normal "sequentıal" (sıralı) kod gibi görünmesini ve doğru anlarda sizin için "awaıt" ile bekleme yapmasını sağlar.
+
+Sonuçları vermeden önce beklemeyi gerektirecek ve yeni Python özelliklerini destekleyen bir işlem olduğunda aşağıdaki gibi kodlayabilirsiniz:
+
+```Python
+burgers = await get_burgers(2)
+```
+
+Buradaki `await` anahtari Python'a, sonuçları `burgers` degiskenine atamadan önce `get_burgers(2)` kodunun işini bitirmesini 🕙 beklemesi gerektiğini söyler. Bununla Python, bu ara zamanda başka bir şey 🔀 ⏯ yapabileceğini bilecektir (başka bir istek almak gibi).
+
+ `await`kodunun çalışması için, eşzamansızlığı destekleyen bir fonksiyonun içinde olması gerekir. Bunu da yapmak için fonksiyonu `async def` ile tanımlamamız yeterlidir:
+
+```Python hl_lines="1"
+async def get_burgers(number: int):
+ # burgerleri oluşturmak için asenkron birkaç iş
+ return burgers
+```
+
+...`def` yerine:
+
+```Python hl_lines="2"
+# bu kod asenkron değil
+def get_sequential_burgers(number: int):
+ # burgerleri oluşturmak için senkron bırkaç iş
+ return burgers
+```
+
+`async def` ile Python, bu fonksıyonun içinde, `await` ifadelerinin farkında olması gerektiğini ve çalışma zamanı gelmeden önce bu işlevin yürütülmesini "duraklatabileceğini" ve başka bir şey yapabileceğini 🔀 bilir.
+
+`async def` fonksiyonunu çağırmak istediğinizde, onu "awaıt" ıle kullanmanız gerekir. Yani, bu işe yaramaz:
+
+```Python
+# Bu işe yaramaz, çünkü get_burgers, şu şekilde tanımlandı: async def
+burgers = get_burgers(2)
+```
+
+---
+
+Bu nedenle, size onu `await` ile çağırabileceğinizi söyleyen bir kitaplık kullanıyorsanız, onu `async def` ile tanımlanan *path fonksiyonu* içerisinde kullanmanız gerekir, örneğin:
+
+```Python hl_lines="2-3"
+@app.get('/burgers')
+async def read_burgers():
+ burgers = await get_burgers(2)
+ return burgers
+```
+
+### Daha fazla teknik detay
+
+`await` in yalnızca `async def` ile tanımlanan fonksıyonların içinde kullanılabileceğini fark etmişsinizdir.
+
+Ama aynı zamanda, `async def` ile tanımlanan fonksiyonların "await" ile beklenmesi gerekir. Bu nedenle, "`async def` içeren fonksiyonlar yalnızca "`async def` ile tanımlanan fonksiyonların içinde çağrılabilir.
+
+
+Yani yumurta mı tavukdan, tavuk mu yumurtadan gibi ilk `async` fonksiyonu nasıl çağırılır?
+
+**FastAPI** ile çalışıyorsanız bunun için endişelenmenize gerek yok, çünkü bu "ilk" fonksiyon sizin *path fonksiyonunuz* olacak ve FastAPI doğru olanı nasıl yapacağını bilecek.
+
+Ancak FastAPI olmadan `async` / `await` kullanmak istiyorsanız, resmi Python belgelerini kontrol edin.
+
+### Asenkron kodun diğer biçimleri
+
+Bu `async` ve `await` kullanimi oldukça yenidir.
+
+Ancak asenkron kodla çalışmayı çok daha kolay hale getirir.
+
+Aynı sözdizimi (hemen hemen aynı) son zamanlarda JavaScript'in modern sürümlerine de dahil edildi (Tarayıcı ve NodeJS'de).
+
+Ancak bundan önce, asenkron kodu işlemek oldukça karmaşık ve zordu.
+
+Python'un önceki sürümlerinde, threadlerı veya Gevent kullanıyor olabilirdin. Ancak kodu anlamak, hata ayıklamak ve düşünmek çok daha karmaşık olurdu.
+
+NodeJS / Browser JavaScript'in önceki sürümlerinde, "callback" kullanırdınız. Bu da callbacks cehennemine yol açar.
+
+## Coroutine'ler
+
+**Coroutine**, bir `async def` fonksiyonu tarafından döndürülen değer için çok süslü bir terimdir. Python bunun bir fonksiyon gibi bir noktada başlayıp biteceğini bilir, ancak içinde bir `await` olduğunda dahili olarak da duraklatılabilir ⏸.
+
+Ancak, `async` ve `await` ile asenkron kod kullanmanın tüm bu işlevselliği, çoğu zaman "Coroutine" kullanmak olarak adlandırılır. Go'nun ana özelliği olan "Goroutines" ile karşılaştırılabilir.
+
+## Sonuç
+
+Aynı ifadeyi yukarıdan görelim:
+
+> Python'ın modern sürümleri, **"async" ve "await"** sözdizimi ile birlikte **"coroutines"** adlı bir özelliği kullanan **"asenkron kod"** desteğine sahiptir.
+
+Şimdi daha mantıklı gelmeli. ✨
+
+FastAPI'ye (Starlette aracılığıyla) güç veren ve bu kadar etkileyici bir performansa sahip olmasını sağlayan şey budur.
+
+## Çok Teknik Detaylar
+
+!!! warning
+ Muhtemelen burayı atlayabilirsiniz.
+
+ Bunlar, **FastAPI**'nin altta nasıl çalıştığına dair çok teknik ayrıntılardır.
+
+ Biraz teknik bilginiz varsa (co-routines, threads, blocking, vb)ve FastAPI'nin "async def" ile normal "def" arasındaki farkı nasıl işlediğini merak ediyorsanız, devam edin.
+
+### Path fonksiyonu
+
+"async def" yerine normal "def" ile bir *yol işlem işlevi* bildirdiğinizde, doğrudan çağrılmak yerine (sunucuyu bloke edeceğinden) daha sonra beklenen harici bir iş parçacığı havuzunda çalıştırılır.
+
+Yukarıda açıklanan şekilde çalışmayan başka bir asenkron framework'den geliyorsanız ve küçük bir performans kazancı (yaklaşık 100 nanosaniye) için "def" ile *path fonksiyonu* tanımlamaya alışkınsanız, **FastAPI**'de tam tersi olacağını unutmayın. Bu durumlarda, *path fonksiyonu* G/Ç engelleyen durum oluşturmadıkça "async def" kullanmak daha iyidir.
+
+Yine de, her iki durumda da, **FastAPI**'nin önceki frameworkden [hala daha hızlı](index.md#performans){.internal-link target=_blank} (veya en azından karşılaştırılabilir) olma olasılığı vardır.
+
+### Bagımlılıklar
+
+Aynısı bağımlılıklar için de geçerlidir. Bir bağımlılık, "async def" yerine standart bir "def" işleviyse, harici iş parçacığı havuzunda çalıştırılır.
+
+### Alt-bağımlıklar
+
+Birbirini gerektiren (fonksiyonlarin parametreleri olarak) birden fazla bağımlılık ve alt bağımlılıklarınız olabilir, bazıları 'async def' ve bazıları normal 'def' ile oluşturulabilir. Yine de normal 'def' ile oluşturulanlar, "await" kulanilmadan harici bir iş parçacığında (iş parçacığı havuzundan) çağrılır.
+
+### Diğer yardımcı fonksiyonlar
+
+Doğrudan çağırdığınız diğer herhangi bir yardımcı fonksiyonu, normal "def" veya "async def" ile tanimlayabilirsiniz. FastAPI onu çağırma şeklinizi etkilemez.
+
+Bu, FastAPI'nin sizin için çağırdığı fonksiyonlarin tam tersidir: *path fonksiyonu* ve bağımlılıklar.
+
+Yardımcı program fonksiyonunuz 'def' ile normal bir işlevse, bir iş parçacığı havuzunda değil doğrudan (kodunuzda yazdığınız gibi) çağrılır, işlev 'async def' ile oluşturulmuşsa çağırıldığı yerde 'await' ile beklemelisiniz.
+
+---
+
+Yeniden, bunlar, onları aramaya geldiğinizde muhtemelen işinize yarayacak çok teknik ayrıntılardır.
+
+Aksi takdirde, yukarıdaki bölümdeki yönergeleri iyi bilmelisiniz: Aceleniz mi var?.
diff --git a/docs/tr/docs/benchmarks.md b/docs/tr/docs/benchmarks.md
index 1ce3c758f..eb5472869 100644
--- a/docs/tr/docs/benchmarks.md
+++ b/docs/tr/docs/benchmarks.md
@@ -1,34 +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). (*)
+Bağımsız TechEmpower kıyaslamaları gösteriyor ki en hızlı Python frameworklerinden birisi olan Uvicorn ile çalıştırılan **FastAPI** uygulamaları, sadece Starlette ve Uvicorn'dan daha düşük sıralamada (FastAPI bu frameworklerin üzerine kurulu) yer alıyor. (*)
Fakat kıyaslamaları ve karşılaştırmaları incelerken şunları aklınızda bulundurmalısınız.
-## Kıyaslamalar ve hı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.
+Kıyaslamaları incelediğinizde, farklı özelliklere sahip araçların eşdeğer olarak karşılaştırıldığını yaygın bir şekilde görebilirsiniz.
-Özellikle, Uvicorn, Starlette ve FastAPI'ın birlikte karşılaştırıldığını görmek için (diğer birçok araç arasında).
+Özellikle, (diğer birçok araç arasında) Uvicorn, Starlette ve FastAPI'ın birlikte karşılaştırıldığını görebilirsiniz.
-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.
+Aracın çözdüğü problem ne kadar basitse, performansı o kadar iyi olacaktır. Ancak kıyaslamaların çoğu, aracın sağladığı 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ü
+ * **Starlette**: (Uvicorn'u kullanır) bir web mikroframeworkü
+ * **FastAPI**: (Starlette'i kullanır) veri doğrulama vb. çeşitli ek özelliklere sahip, API oluşturmak için kullanılan bir API mikroframeworkü
* **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.
+ * Sunucunun kendisi dışında ekstra bir kod içermediği için en iyi performansa sahip olacaktır.
+ * Doğrudan Uvicorn ile bir uygulama yazmazsınız. Bu, yazdığınız kodun en azından Starlette tarafından sağlanan tüm kodu (veya **FastAPI**) az çok içermesi gerektiği anlamına gelir. Eğer bunu yaptıysanız, son uygulamanız bir framework kullanmak ve uygulama kodlarını ve hataları 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.
+ * Uvicorn'dan sonraki en iyi performansa sahip olacaktır. İşin aslı, Starlette çalışmak için Uvicorn'u kullanıyor. Dolayısıyla, daha fazla kod çalıştırmaası gerektiğinden muhtemelen Uvicorn'dan sadece "daha yavaş" olabilir.
+ * Ancak yol bazlı yönlendirme 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 mikroframeworkler) 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.
+ * Starlette'in Uvicorn'u kullandığı ve ondan daha hızlı olamayacağı gibi, **FastAPI**'da Starlette'i kullanır, dolayısıyla ondan daha hızlı olamaz.
+ * FastAPI, Starlette'e ek olarak daha fazla özellik sunar. Bunlar veri doğrulama ve dönüşümü gibi API'lar oluştururken neredeyse ve her zaman ihtiyaç duyduğunuz özelliklerdir. 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 veri doğrulama ve dönüştürme araçlarını kendiniz geliştirmeniz 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 bir kısmını veri doğrulama ve dönüştürme kodları oluşturur.
+ * Dolayısıyla, FastAPI'ı kullanarak geliştirme süresinden, hatalardan, kod satırlarından tasarruf edersiniz ve kullanmadığınız durumda (birçok özelliği geliştirmek zorunda kalmakla birlikte) muhtemelen aynı performansı (veya daha iyisini) elde ederdiniz.
+ * Eğer FastAPI'ı karşılaştırıyorsanız, Flask-apispec, NestJS, Molten, vb. gibi veri doğrulama, dönüştürme ve dokümantasyon sağlayan bir web uygulaması frameworkü ile (veya araç setiyle) karşılaştırın.
diff --git a/docs/tr/docs/fastapi-people.md b/docs/tr/docs/fastapi-people.md
index 3e459036a..6dd4ec061 100644
--- a/docs/tr/docs/fastapi-people.md
+++ b/docs/tr/docs/fastapi-people.md
@@ -1,10 +1,15 @@
+---
+hide:
+ - navigation
+---
+
# FastAPI Topluluğu
FastAPI, her kökenden insanı ağırlayan harika bir topluluğa sahip.
## Yazan - Geliştiren
-Hey! 👋
+Merhaba! 👋
İşte bu benim:
@@ -12,38 +17,37 @@ Hey! 👋
+ +Başkalarının daha önceki çalışmaları olmasaydı, **FastAPI** var olmazdı. + +Geçmişte oluşturulan pek çok araç **FastAPI**'a ilham kaynağı olmuştur. + +Yıllardır yeni bir framework oluşturmaktan kaçınıyordum. Başlangıçta **FastAPI**'ın çözdüğü sorunları çözebilmek için pek çok farklı framework, eklenti ve araç kullanmayı denedim. + +Ancak bir noktada, geçmişteki diğer araçlardan en iyi fikirleri alarak bütün bu çözümleri kapsayan, ayrıca bütün bunları Python'ın daha önce mevcut olmayan özelliklerini (Python 3.6+ ile gelen tip belirteçleri) kullanarak yapan bir şey üretmekten başka bir seçenek kalmamıştı. + ++ +## Araştırma + +Önceki alternatifleri kullanarak hepsinden bir şeyler öğrenip, fikirler alıp, bunları kendim ve çalıştığım geliştirici ekipler için en iyi şekilde birleştirebilme şansım oldu. + +Mesela, ideal olarak standart Python tip belirteçlerine dayanması gerektiği açıktı. + +Ayrıca, en iyi yaklaşım zaten mevcut olan standartları kullanmaktı. + +Sonuç olarak, **FastAPI**'ı kodlamaya başlamadan önce, birkaç ay boyunca OpenAPI, JSON Schema, OAuth2 ve benzerlerinin tanımlamalarını inceledim. İlişkilerini, örtüştükleri noktaları ve farklılıklarını anlamaya çalıştım. + +## Tasarım + +Sonrasında, (**FastAPI** kullanan bir geliştirici olarak) sahip olmak istediğim "API"ı tasarlamak için biraz zaman harcadım. + +Çeşitli fikirleri en popüler Python editörlerinde test ettim: PyCharm, VS Code, Jedi tabanlı editörler. + +Bu test, en son Python Developer Survey'ine göre, kullanıcıların yaklaşık %80'inin kullandığı editörleri kapsıyor. + +Bu da demek oluyor ki **FastAPI**, Python geliştiricilerinin %80'inin kullandığı editörlerle test edildi. Ve diğer editörlerin çoğu benzer şekilde çalıştığından, avantajları neredeyse tüm editörlerde çalışacaktır. + +Bu şekilde, kod tekrarını mümkün olduğunca azaltmak, her yerde otomatik tamamlama, tip ve hata kontrollerine sahip olmak için en iyi yolları bulabildim. + +Hepsi, tüm geliştiriciler için en iyi geliştirme deneyimini sağlayacak şekilde. + +## Gereksinimler + +Çeşitli alternatifleri test ettikten sonra, avantajlarından dolayı **Pydantic**'i kullanmaya karar verdim. + +Sonra, JSON Schema ile tamamen uyumlu olmasını sağlamak, kısıtlama bildirimlerini tanımlamanın farklı yollarını desteklemek ve birkaç editördeki testlere dayanarak editör desteğini (tip kontrolleri, otomatik tamamlama) geliştirmek için katkıda bulundum. + +Geliştirme sırasında, diğer ana gereksinim olan **Starlette**'e de katkıda bulundum. + +## Geliştirme + +**FastAPI**'ı oluşturmaya başladığımda, parçaların çoğu zaten yerindeydi, tasarım tanımlanmıştı, gereksinimler ve araçlar hazırdı, standartlar ve tanımlamalar hakkındaki bilgi net ve tazeydi. + +## Gelecek + +Şimdiye kadar, **FastAPI**'ın fikirleriyle birçok kişiye faydalı olduğu apaçık ortada. + +Birçok kullanım durumuna daha iyi uyduğu için, önceki alternatiflerin yerine seçiliyor. + +Ben ve ekibim dahil, birçok geliştirici ve ekip projelerinde **FastAPI**'ya bağlı. + +Tabi, geliştirilecek birçok özellik ve iyileştirme mevcut. + +**FastAPI**'ın önünde harika bir gelecek var. + +[Yardımlarınız](help-fastapi.md){.internal-link target=_blank} çok değerlidir. diff --git a/docs/tr/docs/how-to/index.md b/docs/tr/docs/how-to/index.md new file mode 100644 index 000000000..8ece29515 --- /dev/null +++ b/docs/tr/docs/how-to/index.md @@ -0,0 +1,11 @@ +# Nasıl Yapılır - Tarifler + +Burada çeşitli konular hakkında farklı tarifler veya "nasıl yapılır" kılavuzları yer alıyor. + +Bu fikirlerin büyük bir kısmı aşağı yukarı **bağımsız** olacaktır, çoğu durumda bunları sadece **projenize** hitap ediyorsa incelemelisiniz. + +Projeniz için ilginç ve yararlı görünen bir şey varsa devam edin ve inceleyin, aksi halde bunları atlayabilirsiniz. + +!!! tip "İpucu" + + **FastAPI**'ı düzgün (ve önerilen) şekilde öğrenmek istiyorsanız [Öğretici - Kullanıcı Rehberi](../tutorial/index.md){.internal-link target=_blank}'ni bölüm bölüm okuyun. diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md index ac8830880..67a9b4462 100644 --- a/docs/tr/docs/index.md +++ b/docs/tr/docs/index.md @@ -1,3 +1,12 @@ +--- +hide: + - navigation +--- + + + @@ -120,7 +129,7 @@ Python 3.8+ FastAPI iki devin omuzları üstünde duruyor: * Web tarafı için Starlette. -* Data tarafı için Pydantic. +* Data tarafı için Pydantic. ## Kurulum @@ -453,15 +462,15 @@ Starlette tarafında kullanılan: *
httpx - Eğer `TestClient` yapısını kullanacaksanız gereklidir.
* jinja2 - Eğer varsayılan template konfigürasyonunu kullanacaksanız gereklidir.
-* python-multipart - Eğer `request.form()` ile form dönüşümü desteğini kullanacaksanız gereklidir.
+* python-multipart - Eğer `request.form()` ile form dönüşümü desteğini kullanacaksanız gereklidir.
* itsdangerous - `SessionMiddleware` desteği için gerekli.
* pyyaml - `SchemaGenerator` desteği için gerekli (Muhtemelen FastAPI kullanırken ihtiyacınız olmaz).
-* ujson - `UJSONResponse` kullanacaksanız gerekli.
Hem FastAPI hem de Starlette tarafından kullanılan:
* uvicorn - oluşturduğumuz uygulamayı servis edecek web sunucusu görevini üstlenir.
* orjson - `ORJSONResponse` kullanacaksanız gereklidir.
+* ujson - `UJSONResponse` kullanacaksanız gerekli.
Bunların hepsini `pip install fastapi[all]` ile yükleyebilirsin.
diff --git a/docs/tr/docs/learn/index.md b/docs/tr/docs/learn/index.md
new file mode 100644
index 000000000..52e3aa54d
--- /dev/null
+++ b/docs/tr/docs/learn/index.md
@@ -0,0 +1,5 @@
+# Öğren
+
+**FastAPI** öğrenmek için giriş bölümleri ve öğreticiler burada yer alıyor.
+
+Burayı, bir **kitap**, bir **kurs**, ve FastAPI öğrenmenin **resmi** ve önerilen yolu olarak düşünülebilirsiniz. 😎
diff --git a/docs/tr/docs/project-generation.md b/docs/tr/docs/project-generation.md
new file mode 100644
index 000000000..75e3ae339
--- /dev/null
+++ b/docs/tr/docs/project-generation.md
@@ -0,0 +1,84 @@
+# Proje oluşturma - Şablonlar
+
+Başlamak için bir proje oluşturucu kullanabilirsiniz, çünkü sizin için önceden yapılmış birçok başlangıç kurulumu, güvenlik, veritabanı ve temel API endpoinlerini içerir.
+
+Bir proje oluşturucu, her zaman kendi ihtiyaçlarınıza göre güncellemeniz ve uyarlamanız gereken esnek bir kuruluma sahip olacaktır, ancak bu, projeniz için iyi bir başlangıç noktası olabilir.
+
+## Full Stack FastAPI PostgreSQL
+
+GitHub: https://github.com/tiangolo/full-stack-fastapi-postgresql
+
+### Full Stack FastAPI PostgreSQL - Özellikler
+
+* Full **Docker** entegrasyonu (Docker based).
+* Docker Swarm Mode ile deployment.
+* **Docker Compose** entegrasyonu ve lokal geliştirme için optimizasyon.
+* Uvicorn ve Gunicorn ile **Production ready** Python web server'ı.
+* Python **FastAPI** backend:
+ * **Hızlı**: **NodeJS** ve **Go** ile eşit, çok yüksek performans (Starlette ve Pydantic'e teşekkürler).
+ * **Sezgisel**: Editor desteğı. Otomatik tamamlama. Daha az debugging.
+ * **Kolay**: Kolay öğrenip kolay kullanmak için tasarlandı. Daha az döküman okuma daha çok iş.
+ * **Kısa**: Minimum kod tekrarı. Her parametre bildiriminde birden çok özellik.
+ * **Güçlü**: Production-ready. Otomatik interaktif dökümantasyon.
+ * **Standartlara dayalı**: API'ler için açık standartlara dayanır (ve tamamen uyumludur): OpenAPI ve JSON Şeması.
+ * **Birçok diger özelliği** dahili otomatik doğrulama, serialization, interaktif dokümantasyon, OAuth2 JWT token ile authentication, vb.
+* **Güvenli şifreleme** .
+* **JWT token** kimlik doğrulama.
+* **SQLAlchemy** models (Flask dan bağımsızdır. Celery worker'ları ile kullanılabilir).
+* Kullanıcılar için temel başlangıç modeli (gerektiği gibi değiştirin ve kaldırın).
+* **Alembic** migration.
+* **CORS** (Cross Origin Resource Sharing).
+* **Celery** worker'ları ile backend içerisinden seçilen işleri çalıştırabilirsiniz.
+* **Pytest**'e dayalı, Docker ile entegre REST backend testleri ile veritabanından bağımsız olarak tam API etkileşimini test edebilirsiniz. Docker'da çalıştığı için her seferinde sıfırdan yeni bir veri deposu oluşturabilir (böylece ElasticSearch, MongoDB, CouchDB veya ne istersen kullanabilirsin ve sadece API'nin çalışıp çalışmadığını test edebilirsin).
+* Atom Hydrogen veya Visual Studio Code Jupyter gibi uzantılarla uzaktan veya Docker içi geliştirme için **Jupyter Çekirdekleri** ile kolay Python entegrasyonu.
+* **Vue** ile frontend:
+ * Vue CLI ile oluşturulmuş.
+ * Dahili **JWT kimlik doğrulama**.
+ * Dahili Login.
+ * Login sonrası, Kontrol paneli.
+ * Kullanıcı oluşturma ve düzenleme kontrol paneli
+ * Kendi kendine kullanıcı sürümü.
+ * **Vuex**.
+ * **Vue-router**.
+ * **Vuetify** güzel material design kompanentleri için.
+ * **TypeScript**.
+ * **Nginx** tabanlı Docker sunucusu (Vue-router için yapılandırılmış).
+ * Docker ile multi-stage yapı, böylece kodu derlemeniz, kaydetmeniz veya işlemeniz gerekmez.
+ * Derleme zamanında Frontend testi (devre dışı bırakılabilir).
+ * Mümkün olduğu kadar modüler yapılmıştır, bu nedenle kutudan çıktığı gibi çalışır, ancak Vue CLI ile yeniden oluşturabilir veya ihtiyaç duyduğunuz şekilde oluşturabilir ve istediğinizi yeniden kullanabilirsiniz.
+* **PGAdmin** PostgreSQL database admin tool'u, PHPMyAdmin ve MySQL ile kolayca değiştirilebilir.
+* **Flower** ile Celery job'larını monitörleme.
+* **Traefik** ile backend ve frontend arasında yük dengeleme, böylece her ikisini de aynı domain altında, path ile ayrılmış, ancak farklı kapsayıcılar tarafından sunulabilirsiniz.
+* Let's Encrypt **HTTPS** sertifikalarının otomatik oluşturulması dahil olmak üzere Traefik entegrasyonu.
+* GitLab **CI** (sürekli entegrasyon), backend ve frontend testi dahil.
+
+## Full Stack FastAPI Couchbase
+
+GitHub: https://github.com/tiangolo/full-stack-fastapi-couchbase
+
+⚠️ **UYARI** ⚠️
+
+Sıfırdan bir projeye başlıyorsanız alternatiflerine bakın.
+
+Örneğin, Full Stack FastAPI PostgreSQL daha iyi bir alternatif olabilir, aktif olarak geliştiriliyor ve kullanılıyor. Ve yeni özellik ve ilerlemelere sahip.
+
+İsterseniz Couchbase tabanlı generator'ı kullanmakta özgürsünüz, hala iyi çalışıyor olmalı ve onunla oluşturulmuş bir projeniz varsa bu da sorun değil (ve muhtemelen zaten ihtiyaçlarınıza göre güncellediniz).
+
+Bununla ilgili daha fazla bilgiyi repo belgelerinde okuyabilirsiniz.
+
+## Full Stack FastAPI MongoDB
+
+... müsaitliğime ve diğer faktörlere bağlı olarak daha sonra gelebilir. 😅 🎉
+
+## Machine Learning modelleri, spaCy ve FastAPI
+
+GitHub: https://github.com/microsoft/cookiecutter-spacy-fastapi
+
+### Machine Learning modelleri, spaCy ve FastAPI - Features
+
+* **spaCy** NER model entegrasyonu.
+* **Azure Cognitive Search** yerleşik istek biçimi.
+* Uvicorn ve Gunicorn ile **Production ready** Python web server'ı.
+* Dahili **Azure DevOps** Kubernetes (AKS) CI/CD deployment.
+* **Multilingual**, Proje kurulumu sırasında spaCy'nin yerleşik dillerinden birini kolayca seçin.
+* **Esnetilebilir** diğer frameworkler (Pytorch, Tensorflow) ile de çalışır sadece spaCy değil.
diff --git a/docs/tr/docs/python-types.md b/docs/tr/docs/python-types.md
index 3b9ab9050..ac3111136 100644
--- a/docs/tr/docs/python-types.md
+++ b/docs/tr/docs/python-types.md
@@ -12,7 +12,7 @@ Bu pythonda tip belirteçleri için **hızlı bir başlangıç / bilgi tazeleme
**FastAPI** kullanmayacak olsanız bile tür belirteçleri hakkında bilgi edinmenizde fayda var.
-!!! not
+!!! note "Not"
Python uzmanıysanız ve tip belirteçleri ilgili her şeyi zaten biliyorsanız, sonraki bölüme geçin.
## Motivasyon
@@ -172,7 +172,7 @@ Liste, bazı dahili tipleri içeren bir tür olduğundan, bunları köşeli para
{!../../../docs_src/python_types/tutorial006.py!}
```
-!!! ipucu
+!!! tip "Ipucu"
Köşeli parantez içindeki bu dahili tiplere "tip parametreleri" denir.
Bu durumda `str`, `List`e iletilen tür parametresidir.
@@ -265,7 +265,7 @@ Ve yine bütün editör desteğini alırsınız:
## Pydantic modelleri
-Pydantic veri doğrulaması yapmak için bir Python kütüphanesidir.
+Pydantic veri doğrulaması yapmak için bir Python kütüphanesidir.
Verilerin "biçimini" niteliklere sahip sınıflar olarak düzenlersiniz.
@@ -282,7 +282,7 @@ Resmi Pydantic dokümanlarından alınmıştır:
```
!!! info
- Daha fazla şey öğrenmek için Pydantic'i takip edin.
+ Daha fazla şey öğrenmek için Pydantic'i takip edin.
**FastAPI** tamamen Pydantic'e dayanmaktadır.
diff --git a/docs/tr/docs/resources/index.md b/docs/tr/docs/resources/index.md
new file mode 100644
index 000000000..fc71a9ca1
--- /dev/null
+++ b/docs/tr/docs/resources/index.md
@@ -0,0 +1,3 @@
+# Kaynaklar
+
+Ek kaynaklar, dış bağlantılar, makaleler ve daha fazlası. ✈️
diff --git a/docs/tr/docs/tutorial/first-steps.md b/docs/tr/docs/tutorial/first-steps.md
new file mode 100644
index 000000000..e66f73034
--- /dev/null
+++ b/docs/tr/docs/tutorial/first-steps.md
@@ -0,0 +1,333 @@
+# İlk Adımlar
+
+En sade FastAPI dosyası şu şekilde görünür:
+
+```Python
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Yukarıdaki içeriği bir `main.py` dosyasına kopyalayalım.
+
+Uygulamayı çalıştıralım:
+
+get operasyonu ile
+* `/` yoluna gelen istekler
+
+!!! info "`@decorator` Bilgisi"
+ Python'da `@something` sözdizimi "dekoratör" olarak adlandırılır.
+
+ Dekoratörler, dekoratif bir şapka gibi (sanırım terim buradan geliyor) fonksiyonların üzerlerine yerleştirilirler.
+
+ Bir "dekoratör" hemen altında bulunan fonksiyonu alır ve o fonksiyon ile bazı işlemler gerçekleştirir.
+
+ Bizim durumumuzda, kullandığımız dekoratör, **FastAPI**'a altındaki fonksiyonun `/` yoluna gelen `get` metodlu isteklerden sorumlu olduğunu söyler.
+
+ Bu bir **yol operasyonu dekoratörüdür**.
+
+Ayrıca diğer operasyonları da kullanabilirsiniz:
+
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+
+Daha az kullanılanları da kullanabilirsiniz:
+
+* `@app.options()`
+* `@app.head()`
+* `@app.patch()`
+* `@app.trace()`
+
+!!! tip "İpucu"
+ Her işlemi (HTTP metod) istediğiniz gibi kullanmakta özgürsünüz.
+
+ **FastAPI** herhangi bir özel amacı veya anlamı olması konusunda ısrarcı olmaz.
+
+ Buradaki bilgiler bir gereklilik değil, bir kılavuz olarak sunulmaktadır.
+
+ Mesela GraphQL kullanırkan genelde tüm işlemleri yalnızca `POST` operasyonunu kullanarak gerçekleştirirsiniz.
+
+### Adım 4: **Yol Operasyonu Fonksiyonunu** Tanımlayın
+
+Aşağıdaki, bizim **yol operasyonu fonksiyonumuzdur**:
+
+* **yol**: `/`
+* **operasyon**: `get`
+* **fonksiyon**: "dekoratör"ün (`@app.get("/")`'in) altındaki fonksiyondur.
+
+```Python hl_lines="7"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Bu bir Python fonksiyonudur.
+
+Bu fonksiyon bir `GET` işlemi kullanılarak "`/`" bağlantısına bir istek geldiğinde **FastAPI** tarafından çağrılır.
+
+Bu durumda bu fonksiyon bir `async` fonksiyondur.
+
+---
+
+Bu fonksiyonu `async def` yerine normal bir fonksiyon olarak da tanımlayabilirsiniz.
+
+```Python hl_lines="7"
+{!../../../docs_src/first_steps/tutorial003.py!}
+```
+
+!!! note "Not"
+ Eğer farkı bilmiyorsanız, [Async: *"Aceleniz mi var?"*](../async.md#in-a-hurry){.internal-link target=_blank} sayfasını kontrol edebilirsiniz.
+
+### Adım 5: İçeriği Geri Döndürün
+
+```Python hl_lines="8"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Bir `dict`, `list` veya `str`, `int` gibi tekil değerler döndürebilirsiniz.
+
+Ayrıca, Pydantic modelleri de döndürebilirsiniz (bu konu ileriki aşamalarda irdelenecektir).
+
+Otomatik olarak JSON'a dönüştürülecek (ORM'ler vb. dahil) başka birçok nesne ve model vardır. En beğendiklerinizi kullanmayı deneyin, yüksek ihtimalle destekleniyordur.
+
+## Özet
+
+* `FastAPI`'yı projemize dahil ettik.
+* Bir `app` örneği oluşturduk.
+* Bir **yol operasyonu dekoratörü** (`@app.get("/")` gibi) yazdık.
+* Bir **yol operasyonu fonksiyonu** (`def root(): ...` gibi) yazdık.
+* Geliştirme sunucumuzu (`uvicorn main:app --reload` gibi) çalıştırdık.
diff --git a/docs/tr/docs/tutorial/first_steps.md b/docs/tr/docs/tutorial/first_steps.md
deleted file mode 100644
index b39802f5d..000000000
--- a/docs/tr/docs/tutorial/first_steps.md
+++ /dev/null
@@ -1,336 +0,0 @@
-# İlk Adımlar
-
-En basit FastAPI dosyası şu şekildedir:
-
-```Python
-{!../../../docs_src/first_steps/tutorial001.py!}
-```
-
-Bunu bir `main.py` dosyasına kopyalayın.
-
-Projeyi çalıştırın:
-
-get işlemi kullanılarak
-
-
-!!! info "`@decorator` Bilgisi"
- Python `@something` şeklinde ifadeleri "decorator" olarak adlandırır.
-
- Decoratoru bir fonksiyonun üzerine koyarsınız. Dekoratif bir şapka gibi (Sanırım terim buradan gelmektedir).
-
- Bir "decorator" fonksiyonu alır ve bazı işlemler gerçekleştir.
-
- Bizim durumumzda decarator **FastAPI'ye** fonksiyonun bir `get` işlemi ile `/` pathine geldiğini söyler.
-
- Bu **path işlem decoratordür**
-
-Ayrıca diğer işlemleri de kullanabilirsiniz:
-
-* `@app.post()`
-* `@app.put()`
-* `@app.delete()`
-
-Ve daha egzotik olanları:
-
-* `@app.options()`
-* `@app.head()`
-* `@app.patch()`
-* `@app.trace()`
-
-!!! tip
- Her işlemi (HTTP method) istediğiniz gibi kullanmakta özgürsünüz.
-
- **FastAPI** herhangi bir özel anlamı zorlamaz.
-
- Buradaki bilgiler bir gereklilik değil, bir kılavuz olarak sunulmaktadır.
-
- Örneğin, GraphQL kullanırkan normalde tüm işlemleri yalnızca `POST` işlemini kullanarak gerçekleştirirsiniz.
-
-### Adım 4: **path işlem fonksiyonunu** tanımlayın
-
-Aşağıdakiler bizim **path işlem fonksiyonlarımızdır**:
-
-* **path**: `/`
-* **işlem**: `get`
-* **function**: "decorator"ün altındaki fonksiyondur (`@app.get("/")` altında).
-
-```Python hl_lines="7"
-{!../../../docs_src/first_steps/tutorial001.py!}
-```
-
-Bu bir Python fonksiyonudur.
-
-Bir `GET` işlemi kullanarak "`/`" URL'sine bir istek geldiğinde **FastAPI** tarafından çağrılır.
-
-Bu durumda bir `async` fonksiyonudur.
-
----
-
-Bunu `async def` yerine normal bir fonksiyon olarakta tanımlayabilirsiniz.
-
-```Python hl_lines="7"
-{!../../../docs_src/first_steps/tutorial003.py!}
-```
-
-!!! note
-
- Eğer farkı bilmiyorsanız, [Async: *"Acelesi var?"*](../async.md#in-a-hurry){.internal-link target=_blank} kontrol edebilirsiniz.
-
-### Adım 5: İçeriği geri döndürün
-
-
-```Python hl_lines="8"
-{!../../../docs_src/first_steps/tutorial001.py!}
-```
-
-Bir `dict`, `list` döndürebilir veya `str`, `int` gibi tekil değerler döndürebilirsiniz.
-
-Ayrıca, Pydantic modellerini de döndürebilirsiniz. (Bununla ilgili daha sonra ayrıntılı bilgi göreceksiniz.)
-
-Otomatik olarak JSON'a dönüştürülecek(ORM'ler vb. dahil) başka birçok nesne ve model vardır. En beğendiklerinizi kullanmayı deneyin, yüksek ihtimalle destekleniyordur.
-
-## Özet
-
-* `FastAPI`'yi içe aktarın.
-* Bir `app` örneği oluşturun.
-* **path işlem decorator** yazın. (`@app.get("/")` gibi)
-* **path işlem fonksiyonu** yazın. (`def root(): ...` gibi)
-* Development sunucunuzu çalıştırın. (`uvicorn main:app --reload` gibi)
diff --git a/docs/tr/docs/tutorial/path-params.md b/docs/tr/docs/tutorial/path-params.md
new file mode 100644
index 000000000..c19023645
--- /dev/null
+++ b/docs/tr/docs/tutorial/path-params.md
@@ -0,0 +1,254 @@
+# Yol Parametreleri
+
+Yol "parametrelerini" veya "değişkenlerini" Python string biçimlemede kullanılan sözdizimi ile tanımlayabilirsiniz.
+
+```Python hl_lines="6-7"
+{!../../../docs_src/path_params/tutorial001.py!}
+```
+
+Yol parametresi olan `item_id`'nin değeri, fonksiyonunuza `item_id` argümanı olarak aktarılacaktır.
+
+Eğer bu örneği çalıştırıp http://127.0.0.1:8000/items/foo sayfasına giderseniz, şöyle bir çıktı ile karşılaşırsınız:
+
+```JSON
+{"item_id":"foo"}
+```
+
+## Tip İçeren Yol Parametreleri
+
+Standart Python tip belirteçlerini kullanarak yol parametresinin tipini fonksiyonun içerisinde tanımlayabilirsiniz.
+
+```Python hl_lines="7"
+{!../../../docs_src/path_params/tutorial002.py!}
+```
+
+Bu durumda, `item_id` bir `int` olarak tanımlanacaktır.
+
+!!! check "Ek bilgi"
+ Bu sayede, fonksiyon içerisinde hata denetimi, kod tamamlama gibi konularda editör desteğine kavuşacaksınız.
+
+## Veri Dönüşümü
+
+Eğer bu örneği çalıştırıp tarayıcınızda http://127.0.0.1:8000/items/3 sayfasını açarsanız, şöyle bir yanıt ile karşılaşırsınız:
+
+```JSON
+{"item_id":3}
+```
+
+!!! check "Ek bilgi"
+ Dikkatinizi çekerim ki, fonksiyonunuzun aldığı (ve döndürdüğü) değer olan `3` bir string `"3"` değil aksine bir Python `int`'idir.
+
+ Bu tanımlamayla birlikte, **FastAPI** size otomatik istek "ayrıştırma" özelliği sağlar.
+
+## Veri Doğrulama
+
+Eğer tarayıcınızda http://127.0.0.1:8000/items/foo sayfasını açarsanız, şuna benzer güzel bir HTTP hatası ile karşılaşırsınız:
+
+```JSON
+{
+ "detail": [
+ {
+ "type": "int_parsing",
+ "loc": [
+ "path",
+ "item_id"
+ ],
+ "msg": "Input should be a valid integer, unable to parse string as an integer",
+ "input": "foo",
+ "url": "https://errors.pydantic.dev/2.1/v/int_parsing"
+ }
+ ]
+}
+```
+
+Çünkü burada `item_id` yol parametresi `int` tipinde bir değer beklerken `"foo"` yani `string` tipinde bir değer almıştı.
+
+Aynı hata http://127.0.0.1:8000/items/4.2 sayfasında olduğu gibi `int` yerine `float` bir değer verseydik de ortaya çıkardı.
+
+!!! check "Ek bilgi"
+ Böylece, aynı Python tip tanımlaması ile birlikte, **FastAPI** veri doğrulama özelliği sağlar.
+
+ Dikkatinizi çekerim ki, karşılaştığınız hata, doğrulamanın geçersiz olduğu mutlak noktayı da açık bir şekilde belirtiyor.
+
+ Bu özellik, API'ınızla iletişime geçen kodu geliştirirken ve ayıklarken inanılmaz derecede yararlı olacaktır.
+
+## Dokümantasyon
+
+Ayrıca, tarayıcınızı http://127.0.0.1:8000/docs adresinde açarsanız, aşağıdaki gibi otomatik ve interaktif bir API dökümantasyonu ile karşılaşırsınız:
+
+
+
+!!! check "Ek bilgi"
+ Üstelik, sadece aynı Python tip tanımlaması ile, **FastAPI** size otomatik ve interaktif (Swagger UI ile entegre) bir dokümantasyon sağlar.
+
+ Dikkatinizi çekerim ki, yol parametresi integer olarak tanımlanmıştır.
+
+## Standartlara Dayalı Avantajlar, Alternatif Dokümantasyon
+
+Oluşturulan şema OpenAPI standardına uygun olduğu için birçok uyumlu araç mevcuttur.
+
+Bu sayede, **FastAPI**'ın bizzat kendisi http://127.0.0.1:8000/redoc sayfasından erişebileceğiniz alternatif (ReDoc kullanan) bir API dokümantasyonu sağlar:
+
+
+
+Aynı şekilde, farklı diller için kod türetme araçları da dahil olmak üzere çok sayıda uyumlu araç bulunur.
+
+## Pydantic
+
+Tüm veri doğrulamaları Pydantic tarafından arka planda gerçekleştirilir, bu sayede tüm avantajlardan faydalanabilirsiniz. Böylece, emin ellerde olduğunuzu hissedebilirsiniz.
+
+Aynı tip tanımlamalarını `str`, `float`, `bool` ve diğer karmaşık veri tipleri ile kullanma imkanınız vardır.
+
+Bunlardan birkaçı, bu eğitimin ileriki bölümlerinde irdelenmiştir.
+
+## Sıralama Önem Arz Eder
+
+*Yol operasyonları* tasarlarken sabit yol barındıran durumlar ile karşılaşabilirsiniz.
+
+Farz edelim ki `/users/me` yolu geçerli kullanıcı hakkında bilgi almak için kullanılıyor olsun.
+
+Benzer şekilde `/users/{user_id}` gibi tanımlanmış ve belirli bir kullanıcı hakkında veri almak için kullanıcının ID bilgisini kullanan bir yolunuz da mevcut olabilir.
+
+*Yol operasyonları* sıralı bir şekilde gözden geçirildiğinden dolayı `/users/me` yolunun `/users/{user_id}` yolundan önce tanımlanmış olmasından emin olmanız gerekmektedir:
+
+```Python hl_lines="6 11"
+{!../../../docs_src/path_params/tutorial003.py!}
+```
+
+Aksi halde, `/users/{user_id}` yolu `"me"` değerinin `user_id` parametresi için gönderildiğini "düşünerek" `/users/me` ile de eşleşir.
+
+Benzer şekilde, bir yol operasyonunu yeniden tanımlamanız mümkün değildir:
+
+```Python hl_lines="6 11"
+{!../../../docs_src/path_params/tutorial003b.py!}
+```
+
+Yol, ilk kısım ile eşleştiğinden dolayı her koşulda ilk yol operasyonu kullanılacaktır.
+
+## Ön Tanımlı Değerler
+
+Eğer *yol parametresi* alan bir *yol operasyonunuz* varsa ve alabileceği *yol parametresi* değerlerinin ön tanımlı olmasını istiyorsanız, standart Python `Enum` tipini kullanabilirsiniz.
+
+### Bir `Enum` Sınıfı Oluşturalım
+
+`Enum` sınıfını projemize dahil edip `str` ile `Enum` sınıflarını miras alan bir alt sınıf yaratalım.
+
+`str` sınıfı miras alındığından dolayı, API dokümanı, değerlerin `string` tipinde olması gerektiğini anlayabilecek ve doğru bir şekilde işlenecektir.
+
+Sonrasında, sınıf içerisinde, mevcut ve geçerli değerler olacak olan sabit değerli özelliklerini oluşturalım:
+
+```Python hl_lines="1 6-9"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+!!! info "Bilgi"
+ 3.4 sürümünden beri enumerationlar (ya da enumlar) Python'da mevcuttur.
+
+!!! tip "İpucu"
+ Merak ediyorsanız söyleyeyim, "AlexNet", "ResNet" ve "LeNet" isimleri Makine Öğrenmesi modellerini temsil eder.
+
+### Bir *Yol Parametresi* Tanımlayalım
+
+Sonrasında, yarattığımız enum sınıfını (`ModelName`) kullanarak tip belirteci aracılığıyla bir *yol parametresi* oluşturalım:
+
+```Python hl_lines="16"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+### Dokümana Göz Atalım
+
+*Yol parametresi* için mevcut değerler ön tanımlı olduğundan dolayı, interaktif döküman onları güzel bir şekilde gösterebilir:
+
+
+
+### Python *Enumerationları* ile Çalışmak
+
+*Yol parametresinin* değeri bir *enumeration üyesi* olacaktır.
+
+#### *Enumeration Üyelerini* Karşılaştıralım
+
+Parametreyi, yarattığınız enum olan `ModelName` içerisindeki *enumeration üyesi* ile karşılaştırabilirsiniz:
+
+```Python hl_lines="17"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+#### *Enumeration Değerini* Edinelim
+
+`model_name.value` veya genel olarak `your_enum_member.value` tanımlarını kullanarak (bu durumda bir `str` olan) gerçek değere ulaşabilirsiniz:
+
+```Python hl_lines="20"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+!!! tip "İpucu"
+ `"lenet"` değerine `ModelName.lenet.value` tanımı ile de ulaşabilirsiniz.
+
+#### *Enumeration Üyelerini* Döndürelim
+
+JSON gövdesine (örneğin bir `dict`) gömülü olsalar bile *yol operasyonundaki* *enum üyelerini* döndürebilirsiniz.
+
+Bu üyeler istemciye iletilmeden önce kendilerine karşılık gelen değerlerine (bu durumda string) dönüştürüleceklerdir:
+
+```Python hl_lines="18 21 23"
+{!../../../docs_src/path_params/tutorial005.py!}
+```
+
+İstemci tarafında şuna benzer bir JSON yanıtı ile karşılaşırsınız:
+
+```JSON
+{
+ "model_name": "alexnet",
+ "message": "Deep Learning FTW!"
+}
+```
+
+## Yol İçeren Yol Parametreleri
+
+Farz edelim ki elinizde `/files/{file_path}` isminde bir *yol operasyonu* var.
+
+Fakat `file_path` değerinin `home/johndoe/myfile.txt` gibi bir *yol* barındırmasını istiyorsunuz.
+
+Sonuç olarak, oluşturmak istediğin URL `/files/home/johndoe/myfile.txt` gibi bir şey olacaktır.
+
+### OpenAPI Desteği
+
+Test etmesi ve tanımlaması zor senaryolara sebebiyet vereceğinden dolayı OpenAPI, *yol* barındıran *yol parametrelerini* tanımlayacak bir çözüm sunmuyor.
+
+Ancak bunu, Starlette kütüphanesinin dahili araçlarından birini kullanarak **FastAPI**'da gerçekleştirebilirsiniz.
+
+Parametrenin bir yol içermesi gerektiğini belirten herhangi bir doküman eklemememize rağmen dokümanlar yine de çalışacaktır.
+
+### Yol Dönüştürücü
+
+Direkt olarak Starlette kütüphanesinden gelen bir opsiyon sayesinde aşağıdaki gibi *yol* içeren bir *yol parametresi* bağlantısı tanımlayabilirsiniz:
+
+```
+/files/{file_path:path}
+```
+
+Bu durumda, parametrenin adı `file_path` olacaktır ve son kısım olan `:path` kısmı, parametrenin herhangi bir *yol* ile eşleşmesi gerektiğini belirtecektir.
+
+Böylece şunun gibi bir kullanım yapabilirsiniz:
+
+```Python hl_lines="6"
+{!../../../docs_src/path_params/tutorial004.py!}
+```
+
+!!! tip "İpucu"
+ Parametrenin başında `/home/johndoe/myfile.txt` yolunda olduğu gibi (`/`) işareti ile birlikte kullanmanız gerektiği durumlar olabilir.
+
+ Bu durumda, URL, `files` ile `home` arasında iki eğik çizgiye (`//`) sahip olup `/files//home/johndoe/myfile.txt` gibi gözükecektir.
+
+## Özet
+
+**FastAPI** ile kısa, sezgisel ve standart Python tip tanımlamaları kullanarak şunları elde edersiniz:
+
+* Editör desteği: hata denetimi, otomatik tamamlama, vb.
+* Veri "dönüştürme"
+* Veri doğrulama
+* API tanımlamaları ve otomatik dokümantasyon
+
+Ve sadece, bunları bir kez tanımlamanız yeterli.
+
+Diğer frameworkler ile karşılaştırıldığında (ham performans dışında), üstte anlatılan durum muhtemelen **FastAPI**'ın göze çarpan başlıca avantajıdır.
diff --git a/docs/tr/docs/tutorial/query-params.md b/docs/tr/docs/tutorial/query-params.md
new file mode 100644
index 000000000..682f8332c
--- /dev/null
+++ b/docs/tr/docs/tutorial/query-params.md
@@ -0,0 +1,227 @@
+# Sorgu Parametreleri
+
+Fonksiyonda yol parametrelerinin parçası olmayan diğer tanımlamalar otomatik olarak "sorgu" parametresi olarak yorumlanır.
+
+```Python hl_lines="9"
+{!../../../docs_src/query_params/tutorial001.py!}
+```
+
+Sorgu, bağlantıdaki `?` kısmından sonra gelen ve `&` işareti ile ayrılan anahtar-değer çiftlerinin oluşturduğu bir kümedir.
+
+Örneğin, aşağıdaki bağlantıda:
+
+```
+http://127.0.0.1:8000/items/?skip=0&limit=10
+```
+
+...sorgu parametreleri şunlardır:
+
+* `skip`: değeri `0`'dır
+* `limit`: değeri `10`'dır
+
+Parametreler bağlantının bir parçası oldukları için doğal olarak string olarak değerlendirilirler.
+
+Fakat, Python tipleri ile tanımlandıkları zaman (yukarıdaki örnekte `int` oldukları gibi), parametreler o tiplere dönüştürülür ve o tipler çerçevesinde doğrulanırlar.
+
+Yol parametreleri için geçerli olan her türlü işlem aynı şekilde sorgu parametreleri için de geçerlidir:
+
+* Editör desteği (şüphesiz)
+* Veri "ayrıştırma"
+* Veri doğrulama
+* Otomatik dokümantasyon
+
+## Varsayılanlar
+
+Sorgu parametreleri, adres yolunun sabit bir parçası olmadıklarından dolayı isteğe bağlı ve varsayılan değere sahip olabilirler.
+
+Yukarıdaki örnekte `skip=0` ve `limit=10` varsayılan değere sahiplerdir.
+
+Yani, aşağıdaki bağlantıya gitmek:
+
+```
+http://127.0.0.1:8000/items/
+```
+
+şu adrese gitmek ile aynı etkiye sahiptir:
+
+```
+http://127.0.0.1:8000/items/?skip=0&limit=10
+```
+
+Ancak, mesela şöyle bir adresi ziyaret ederseniz:
+
+```
+http://127.0.0.1:8000/items/?skip=20
+```
+
+Fonksiyonunuzdaki parametre değerleri aşağıdaki gibi olacaktır:
+
+* `skip=20`: çünkü bağlantıda böyle tanımlandı.
+* `limit=10`: çünkü varsayılan değer buydu.
+
+## İsteğe Bağlı Parametreler
+
+Aynı şekilde, varsayılan değerlerini `None` olarak atayarak isteğe bağlı parametreler tanımlayabilirsiniz:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params/tutorial002_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params/tutorial002.py!}
+ ```
+
+Bu durumda, `q` fonksiyon parametresi isteğe bağlı olacak ve varsayılan değer olarak `None` alacaktır.
+
+!!! check "Ek bilgi"
+ Ayrıca, dikkatinizi çekerim ki; **FastAPI**, `item_id` parametresinin bir yol parametresi olduğunu ve `q` parametresinin yol değil bir sorgu parametresi olduğunu fark edecek kadar beceriklidir.
+
+## Sorgu Parametresi Tip Dönüşümü
+
+Aşağıda görüldüğü gibi dönüştürülmek üzere `bool` tipleri de tanımlayabilirsiniz:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params/tutorial003_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params/tutorial003.py!}
+ ```
+
+Bu durumda, eğer şu adrese giderseniz:
+
+```
+http://127.0.0.1:8000/items/foo?short=1
+```
+
+veya
+
+```
+http://127.0.0.1:8000/items/foo?short=True
+```
+
+veya
+
+```
+http://127.0.0.1:8000/items/foo?short=true
+```
+
+veya
+
+```
+http://127.0.0.1:8000/items/foo?short=on
+```
+
+veya
+
+```
+http://127.0.0.1:8000/items/foo?short=yes
+```
+
+veya adres, herhangi farklı bir harf varyasyonu içermesi durumuna rağmen (büyük harf, sadece baş harfi büyük kelime, vb.) fonksiyonunuz, `bool` tipli `short` parametresini `True` olarak algılayacaktır. Aksi halde `False` olarak algılanacaktır.
+
+
+## Çoklu Yol ve Sorgu Parametreleri
+
+**FastAPI** neyin ne olduğunu ayırt edebileceğinden dolayı aynı anda birden fazla yol ve sorgu parametresi tanımlayabilirsiniz.
+
+Ve parametreleri, herhangi bir sıraya koymanıza da gerek yoktur.
+
+İsimlerine göre belirleneceklerdir:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="6 8"
+ {!> ../../../docs_src/query_params/tutorial004_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="8 10"
+ {!> ../../../docs_src/query_params/tutorial004.py!}
+ ```
+
+## Zorunlu Sorgu Parametreleri
+
+Türü yol olmayan bir parametre (şu ana kadar sadece sorgu parametrelerini gördük) için varsayılan değer tanımlarsanız o parametre zorunlu olmayacaktır.
+
+Parametre için belirli bir değer atamak istemeyip parametrenin sadece isteğe bağlı olmasını istiyorsanız değerini `None` olarak atayabilirsiniz.
+
+Fakat, bir sorgu parametresini zorunlu yapmak istiyorsanız varsayılan bir değer atamamanız yeterli olacaktır:
+
+```Python hl_lines="6-7"
+{!../../../docs_src/query_params/tutorial005.py!}
+```
+
+Burada `needy` parametresi `str` tipinden oluşan zorunlu bir sorgu parametresidir.
+
+Eğer tarayıcınızda şu bağlantıyı:
+
+```
+http://127.0.0.1:8000/items/foo-item
+```
+
+...`needy` parametresini eklemeden açarsanız şuna benzer bir hata ile karşılaşırsınız:
+
+```JSON
+{
+ "detail": [
+ {
+ "type": "missing",
+ "loc": [
+ "query",
+ "needy"
+ ],
+ "msg": "Field required",
+ "input": null,
+ "url": "https://errors.pydantic.dev/2.1/v/missing"
+ }
+ ]
+}
+```
+
+`needy` zorunlu bir parametre olduğundan dolayı bağlantıda tanımlanması gerekir:
+
+```
+http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
+```
+
+...bu iş görür:
+
+```JSON
+{
+ "item_id": "foo-item",
+ "needy": "sooooneedy"
+}
+```
+
+Ve elbette, bazı parametreleri zorunlu, bazılarını varsayılan değerli ve bazılarını tamamen opsiyonel olarak tanımlayabilirsiniz:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/query_params/tutorial006_py310.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="10"
+ {!> ../../../docs_src/query_params/tutorial006.py!}
+ ```
+
+Bu durumda, 3 tane sorgu parametresi var olacaktır:
+
+* `needy`, zorunlu bir `str`.
+* `skip`, varsayılan değeri `0` olan bir `int`.
+* `limit`, isteğe bağlı bir `int`.
+
+!!! tip "İpucu"
+ Ayrıca, [Yol Parametrelerinde](path-params.md#on-tanml-degerler){.internal-link target=_blank} de kullanıldığı şekilde `Enum` sınıfından faydalanabilirsiniz.
diff --git a/docs/uk/docs/alternatives.md b/docs/uk/docs/alternatives.md
index e71257976..16cc0d875 100644
--- a/docs/uk/docs/alternatives.md
+++ b/docs/uk/docs/alternatives.md
@@ -30,11 +30,11 @@
Це був один із перших прикладів **автоматичної документації API**, і саме це була одна з перших ідей, яка надихнула на «пошук» **FastAPI**.
-!!! Примітка
+!!! note "Примітка"
Django REST Framework створив Том Крісті. Той самий творець Starlette і Uvicorn, на яких базується **FastAPI**.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Мати автоматичний веб-інтерфейс документації API.
### Flask
@@ -51,7 +51,7 @@ Flask — це «мікрофреймворк», він не включає ін
Враховуючи простоту Flask, він здавався хорошим підходом для створення API. Наступним, що знайшов, був «Django REST Framework» для Flask.
-!!! Переглянте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Бути мікрофреймоворком. Зробити легким комбінування та поєднання необхідних інструментів та частин.
Мати просту та легку у використанні систему маршрутизації.
@@ -91,7 +91,7 @@ def read_url():
Зверніть увагу на схожість у `requests.get(...)` і `@app.get(...)`.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
* Майте простий та інтуїтивно зрозумілий API.
* Використовуйте імена (операції) методів HTTP безпосередньо, простим та інтуїтивно зрозумілим способом.
* Розумні параметри за замовчуванням, але потужні налаштування.
@@ -109,7 +109,7 @@ def read_url():
Тому, коли говорять про версію 2.0, прийнято говорити «Swagger», а про версію 3+ «OpenAPI».
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Прийняти і використовувати відкритий стандарт для специфікацій API замість спеціальної схеми.
Інтегрувати інструменти інтерфейсу на основі стандартів:
@@ -135,7 +135,7 @@ Marshmallow створено для забезпечення цих функці
Але він був створений до того, як існували підказки типу Python. Отже, щоб визначити кожну схему, вам потрібно використовувати спеціальні утиліти та класи, надані Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Використовувати код для автоматичного визначення "схем", які надають типи даних і перевірку.
### Webargs
@@ -148,10 +148,10 @@ Webargs — це інструмент, створений, щоб забезпе
Це чудовий інструмент, і я також часто використовував його, перш ніж створити **FastAPI**.
-!!! Інформація
+!!! info "Інформація"
Webargs був створений тими ж розробниками Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Мати автоматичну перевірку даних вхідного запиту.
### APISpec
@@ -172,11 +172,11 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
Редактор тут нічим не може допомогти. І якщо ми змінимо параметри чи схеми Marshmallow і забудемо також змінити цю строку документа YAML, згенерована схема буде застарілою.
-!!! Інформація
+!!! info "Інформація"
APISpec був створений тими ж розробниками Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Підтримувати відкритий стандарт API, OpenAPI.
### Flask-apispec
@@ -199,10 +199,10 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
І ці самі генератори повного стеку були основою [**FastAPI** генераторів проектів](project-generation.md){.internal-link target=_blank}.
-!!! Інформація
+!!! info "Інформація"
Flask-apispec був створений тими ж розробниками Marshmallow.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Створення схеми OpenAPI автоматично з того самого коду, який визначає серіалізацію та перевірку.
### NestJS (та Angular)
@@ -219,7 +219,7 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
Він не дуже добре обробляє вкладені моделі. Отже, якщо тіло JSON у запиті є об’єктом JSON із внутрішніми полями, які, у свою чергу, є вкладеними об’єктами JSON, його неможливо належним чином задокументувати та перевірити.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Використовувати типи Python, щоб мати чудову підтримку редактора.
Мати потужну систему впровадження залежностей. Знайдіть спосіб звести до мінімуму повторення коду.
@@ -228,12 +228,12 @@ Marshmallow і Webargs забезпечують перевірку, аналіз
Це був один із перших надзвичайно швидких фреймворків Python на основі `asyncio`. Він був дуже схожий на Flask.
-!!! Примітка "Технічні деталі"
+!!! note "Технічні деталі"
Він використовував `uvloop` замість стандартного циклу Python `asyncio`. Ось що зробило його таким швидким.
Це явно надихнуло Uvicorn і Starlette, які зараз швидші за Sanic у відкритих тестах.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Знайти спосіб отримати божевільну продуктивність.
Ось чому **FastAPI** базується на Starlette, оскільки це найшвидша доступна структура (перевірена тестами сторонніх розробників).
@@ -246,7 +246,7 @@ Falcon — ще один високопродуктивний фреймворк
Таким чином, перевірка даних, серіалізація та документація повинні виконуватися в коді, а не автоматично. Або вони повинні бути реалізовані як фреймворк поверх Falcon, як Hug. Така сама відмінність спостерігається в інших фреймворках, натхненних дизайном Falcon, що мають один об’єкт запиту та один об’єкт відповіді як параметри.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Знайти способи отримати чудову продуктивність.
Разом із Hug (оскільки Hug базується на Falcon) надихнув **FastAPI** оголосити параметр `response` у функціях.
@@ -269,7 +269,7 @@ Falcon — ще один високопродуктивний фреймворк
Маршрути оголошуються в одному місці з використанням функцій, оголошених в інших місцях (замість використання декораторів, які можна розмістити безпосередньо поверх функції, яка обробляє кінцеву точку). Це ближче до того, як це робить Django, ніж до Flask (і Starlette). Він розділяє в коді речі, які відносно тісно пов’язані.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Визначити додаткові перевірки для типів даних, використовуючи значення "за замовчуванням" атрибутів моделі. Це покращує підтримку редактора, а раніше вона була недоступна в Pydantic.
Це фактично надихнуло оновити частини Pydantic, щоб підтримувати той самий стиль оголошення перевірки (всі ці функції вже доступні в Pydantic).
@@ -288,10 +288,10 @@ Hug був одним із перших фреймворків, який реа
Оскільки він заснований на попередньому стандарті для синхронних веб-фреймворків Python (WSGI), він не може працювати з Websockets та іншими речами, хоча він також має високу продуктивність.
-!!! Інформація
+!!! info "Інформація"
Hug створив Тімоті Крослі, той самий творець `isort`, чудовий інструмент для автоматичного сортування імпорту у файлах Python.
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Hug надихнув частину APIStar і був одним із найбільш перспективних інструментів, поряд із APIStar.
Hug надихнув **FastAPI** на використання підказок типу Python для оголошення параметрів і автоматичного створення схеми, що визначає API.
@@ -322,14 +322,14 @@ Hug був одним із перших фреймворків, який реа
Тепер APIStar — це набір інструментів для перевірки специфікацій OpenAPI, а не веб-фреймворк.
-!!! Інформація
+!!! info "Інформація"
APIStar створив Том Крісті. Той самий хлопець, який створив:
* Django REST Framework
* Starlette (на якому базується **FastAPI**)
* Uvicorn (використовується Starlette і **FastAPI**)
-!!! Перегляньте "Надихнуло **FastAPI** на"
+!!! check "Надихнуло **FastAPI** на"
Існувати.
Ідею оголошення кількох речей (перевірки даних, серіалізації та документації) за допомогою тих самих типів Python, які в той же час забезпечували чудову підтримку редактора, я вважав геніальною ідеєю.
@@ -340,7 +340,7 @@ Hug був одним із перших фреймворків, який реа
## Використовується **FastAPI**
-### Pydantic
+### Pydantic
Pydantic — це бібліотека для визначення перевірки даних, серіалізації та документації (за допомогою схеми JSON) на основі підказок типу Python.
@@ -348,7 +348,7 @@ Pydantic — це бібліотека для визначення переві
Його можна порівняти з Marshmallow. Хоча він швидший за Marshmallow у тестах. Оскільки він базується на тих самих підказках типу Python, підтримка редактора чудова.
-!!! Перегляньте "**FastAPI** використовує його для"
+!!! check "**FastAPI** використовує його для"
Виконання перевірки всіх даних, серіалізації даних і автоматичної документацію моделі (на основі схеми JSON).
Потім **FastAPI** бере ці дані схеми JSON і розміщує їх у OpenAPI, окремо від усіх інших речей, які він робить.
@@ -380,12 +380,12 @@ Starlette надає всі основні функції веб-мікрофр
Це одна з головних речей, які **FastAPI** додає зверху, все на основі підказок типу Python (з використанням Pydantic). Це, а також система впровадження залежностей, утиліти безпеки, створення схеми OpenAPI тощо.
-!!! Примітка "Технічні деталі"
+!!! note "Технічні деталі"
ASGI — це новий «стандарт», який розробляється членами основної команди Django. Це ще не «стандарт Python» (PEP), хоча вони в процесі цього.
Тим не менш, він уже використовується як «стандарт» кількома інструментами. Це значно покращує сумісність, оскільки ви можете переключити Uvicorn на будь-який інший сервер ASGI (наприклад, Daphne або Hypercorn), або ви можете додати інструменти, сумісні з ASGI, як-от `python-socketio`.
-!!! Перегляньте "**FastAPI** використовує його для"
+!!! check "**FastAPI** використовує його для"
Керування всіма основними веб-частинами. Додавання функцій зверху.
Сам клас `FastAPI` безпосередньо успадковує клас `Starlette`.
@@ -400,7 +400,7 @@ Uvicorn — це блискавичний сервер ASGI, побудован
Це рекомендований сервер для Starlette і **FastAPI**.
-!!! Перегляньте "**FastAPI** рекомендує це як"
+!!! check "**FastAPI** рекомендує це як"
Основний веб-сервер для запуску програм **FastAPI**.
Ви можете поєднати його з Gunicorn, щоб мати асинхронний багатопроцесний сервер.
diff --git a/docs/uk/docs/fastapi-people.md b/docs/uk/docs/fastapi-people.md
index b32f0e5ce..152a7b098 100644
--- a/docs/uk/docs/fastapi-people.md
+++ b/docs/uk/docs/fastapi-people.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Люди FastAPI
FastAPI має дивовижну спільноту, яка вітає людей різного походження.
@@ -28,7 +33,7 @@ FastAPI має дивовижну спільноту, яка вітає люде
Це люди, які:
-* [Допомагають іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}.
+* [Допомагають іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank}.
* [Створюють пул реквести](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
* Переглядають пул реквести, [особливо важливо для перекладів](contributing.md#translations){.internal-link target=_blank}.
@@ -36,11 +41,11 @@ FastAPI має дивовижну спільноту, яка вітає люде
## Найбільш активні користувачі минулого місяця
-Це користувачі, які [найбільше допомагали іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank} протягом минулого місяця. ☕
+Це користувачі, які [найбільше допомагали іншим із проблемами (запитаннями) у GitHub](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} протягом минулого місяця. ☕
{% if people %}
httpx - Необхідно, якщо Ви хочете використовувати `TestClient`.
* jinja2 - Необхідно, якщо Ви хочете використовувати шаблони як конфігурацію за замовчуванням.
-* python-multipart - Необхідно, якщо Ви хочете підтримувати "розбір" форми за допомогою `request.form()`.
+* python-multipart - Необхідно, якщо Ви хочете підтримувати "розбір" форми за допомогою `request.form()`.
* itsdangerous - Необхідно для підтримки `SessionMiddleware`.
* pyyaml - Необхідно для підтримки Starlette `SchemaGenerator` (ймовірно, вам це не потрібно з FastAPI).
-* ujson - Необхідно, якщо Ви хочете використовувати `UJSONResponse`.
FastAPI / Starlette використовують:
* uvicorn - для сервера, який завантажує та обслуговує вашу програму.
* orjson - Необхідно, якщо Ви хочете використовувати `ORJSONResponse`.
+* ujson - Необхідно, якщо Ви хочете використовувати `UJSONResponse`.
Ви можете встановити все це за допомогою `pip install fastapi[all]`.
diff --git a/docs/uk/docs/python-types.md b/docs/uk/docs/python-types.md
index 6c8e29016..d0adadff3 100644
--- a/docs/uk/docs/python-types.md
+++ b/docs/uk/docs/python-types.md
@@ -168,7 +168,7 @@ John Doe
З модуля `typing`, імпортуємо `List` (з великої літери `L`):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
@@ -385,7 +385,7 @@ John Doe
## Pydantic моделі
-Pydantic це бібліотека Python для валідації даних.
+Pydantic це бібліотека Python для валідації даних.
Ви оголошуєте «форму» даних як класи з атрибутами.
@@ -416,7 +416,7 @@ John Doe
```
!!! info
- Щоб дізнатись більше про Pydantic, перегляньте його документацію.
+ Щоб дізнатись більше про Pydantic, перегляньте його документацію.
**FastAPI** повністю базується на Pydantic.
diff --git a/docs/uk/docs/tutorial/body.md b/docs/uk/docs/tutorial/body.md
index 9759e7f45..11e94e929 100644
--- a/docs/uk/docs/tutorial/body.md
+++ b/docs/uk/docs/tutorial/body.md
@@ -6,7 +6,7 @@
Ваш API майже завжди має надсилати тіло **відповіді**. Але клієнтам не обов’язково потрібно постійно надсилати тіла **запитів**.
-Щоб оголосити тіло **запиту**, ви використовуєте Pydantic моделі з усією їх потужністю та перевагами.
+Щоб оголосити тіло **запиту**, ви використовуєте Pydantic моделі з усією їх потужністю та перевагами.
!!! info
Щоб надіслати дані, ви повинні використовувати один із: `POST` (більш поширений), `PUT`, `DELETE` або `PATCH`.
diff --git a/docs/uk/docs/tutorial/encoder.md b/docs/uk/docs/tutorial/encoder.md
index b6583341f..49321ff11 100644
--- a/docs/uk/docs/tutorial/encoder.md
+++ b/docs/uk/docs/tutorial/encoder.md
@@ -38,5 +38,5 @@
Вона не повертає велику строку `str`, яка містить дані у форматі JSON (як строка). Вона повертає стандартну структуру даних Python (наприклад `dict`) із значеннями та підзначеннями, які є сумісними з JSON.
-!!! Примітка
+!!! note "Примітка"
`jsonable_encoder` фактично використовується **FastAPI** внутрішньо для перетворення даних. Проте вона корисна в багатьох інших сценаріях.
diff --git a/docs/uk/docs/tutorial/extra-data-types.md b/docs/uk/docs/tutorial/extra-data-types.md
index ec5ec0d18..01852803a 100644
--- a/docs/uk/docs/tutorial/extra-data-types.md
+++ b/docs/uk/docs/tutorial/extra-data-types.md
@@ -36,7 +36,7 @@
* `datetime.timedelta`:
* Пайтонівський `datetime.timedelta`.
* У запитах та відповідях буде представлений як `float` загальної кількості секунд.
- * Pydantic також дозволяє представляти це як "ISO 8601 time diff encoding", більше інформації дивись у документації.
+ * Pydantic також дозволяє представляти це як "ISO 8601 time diff encoding", більше інформації дивись у документації.
* `frozenset`:
* У запитах і відповідях це буде оброблено так само, як і `set`:
* У запитах список буде зчитано, дублікати будуть видалені та він буде перетворений на `set`.
@@ -49,7 +49,7 @@
* `Decimal`:
* Стандартний Пайтонівський `Decimal`.
* У запитах і відповідях це буде оброблено так само, як і `float`.
-* Ви можете перевірити всі дійсні типи даних Pydantic тут: типи даних Pydantic.
+* Ви можете перевірити всі дійсні типи даних Pydantic тут: типи даних Pydantic.
## Приклад
diff --git a/docs/vi/docs/features.md b/docs/vi/docs/features.md
index 306aeb359..fe75591dc 100644
--- a/docs/vi/docs/features.md
+++ b/docs/vi/docs/features.md
@@ -1,3 +1,8 @@
+---
+hide:
+ - navigation
+---
+
# Tính năng
## Tính năng của FastAPI
@@ -172,7 +177,7 @@ Với **FastAPI**, bạn có được tất cả những tính năng của **Sta
## Tính năng của Pydantic
-**FastAPI** tương thích đầy đủ với (và dựa trên) Pydantic. Do đó, bất kì code Pydantic nào bạn thêm vào cũng sẽ hoạt động.
+**FastAPI** tương thích đầy đủ với (và dựa trên) Pydantic. Do đó, bất kì code Pydantic nào bạn thêm vào cũng sẽ hoạt động.
Bao gồm các thư viện bên ngoài cũng dựa trên Pydantic, như ORMs, ODMs cho cơ sở dữ liệu.
diff --git a/docs/vi/docs/index.md b/docs/vi/docs/index.md
index 3f416dbec..652218afa 100644
--- a/docs/vi/docs/index.md
+++ b/docs/vi/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI là một web framework hiện đại, hiệu năng cao để xây dựn
Những tính năng như:
-* **Nhanh**: Hiệu năng rất cao khi so sánh với **NodeJS** và **Go** (cảm ơn Starlette và Pydantic). [Một trong những Python framework nhanh nhất](#performance).
+* **Nhanh**: Hiệu năng rất cao khi so sánh với **NodeJS** và **Go** (cảm ơn Starlette và Pydantic). [Một trong những Python framework nhanh nhất](#hieu-nang).
* **Code nhanh**: Tăng tốc độ phát triển tính năng từ 200% tới 300%. *
* **Ít lỗi hơn**: Giảm khoảng 40% những lỗi phát sinh bởi con người (nhà phát triển). *
* **Trực giác tốt hơn**: Được các trình soạn thảo hỗ tuyệt vời. Completion mọi nơi. Ít thời gian gỡ lỗi.
@@ -121,7 +130,7 @@ Python 3.8+
FastAPI đứng trên vai những người khổng lồ:
* Starlette cho phần web.
-* Pydantic cho phần data.
+* Pydantic cho phần data.
## Cài đặt
@@ -448,22 +457,21 @@ Independent TechEmpower benchmarks cho thấy các ứng dụng **FastAPI** ch
Sử dụng bởi Pydantic:
-* ujson - "Parse" JSON nhanh hơn.
* email_validator - cho email validation.
Sử dụng Starlette:
* httpx - Bắt buộc nếu bạn muốn sử dụng `TestClient`.
* jinja2 - Bắt buộc nếu bạn muốn sử dụng cấu hình template engine mặc định.
-* python-multipart - Bắt buộc nếu bạn muốn hỗ trợ "parsing", form với `request.form()`.
+* python-multipart - Bắt buộc nếu bạn muốn hỗ trợ "parsing", form với `request.form()`.
* itsdangerous - Bắt buộc để hỗ trợ `SessionMiddleware`.
* pyyaml - Bắt buộc để hỗ trợ `SchemaGenerator` cho Starlette (bạn có thể không cần nó trong FastAPI).
-* ujson - Bắt buộc nếu bạn muốn sử dụng `UJSONResponse`.
Sử dụng bởi FastAPI / Starlette:
* uvicorn - Server để chạy ứng dụng của bạn.
* orjson - Bắt buộc nếu bạn muốn sử dụng `ORJSONResponse`.
+* ujson - Bắt buộc nếu bạn muốn sử dụng `UJSONResponse`.
Bạn có thể cài đặt tất cả những dependency trên với `pip install "fastapi[all]"`.
diff --git a/docs/vi/docs/python-types.md b/docs/vi/docs/python-types.md
index 4999caac3..84d14de55 100644
--- a/docs/vi/docs/python-types.md
+++ b/docs/vi/docs/python-types.md
@@ -186,7 +186,7 @@ Ví dụ, hãy định nghĩa một biến là `list` các `str`.
Từ `typing`, import `List` (với chữ cái `L` viết hoa):
- ``` Python hl_lines="1"
+ ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!}
```
@@ -440,7 +440,7 @@ Nó không có nghĩa "`one_person`" là một **lớp** gọi là `Person`.
## Pydantic models
-Pydantic là một thư viện Python để validate dữ liệu hiệu năng cao.
+Pydantic là một thư viện Python để validate dữ liệu hiệu năng cao.
Bạn có thể khai báo "hình dạng" của dữa liệu như là các lớp với các thuộc tính.
@@ -471,14 +471,14 @@ Một ví dụ từ tài liệu chính thức của Pydantic:
```
!!! info
- Để học nhiều hơn về Pydantic, tham khảo tài liệu của nó.
+ Để học nhiều hơn về Pydantic, tham khảo tài liệu của nó.
**FastAPI** được dựa hoàn toàn trên Pydantic.
Bạn sẽ thấy nhiều ví dụ thực tế hơn trong [Hướng dẫn sử dụng](tutorial/index.md){.internal-link target=_blank}.
!!! tip
- Pydantic có một hành vi đặc biệt khi bạn sử dụng `Optional` hoặc `Union[Something, None]` mà không có giá trị mặc dịnh, bạn có thể đọc nhiều hơn về nó trong tài liệu của Pydantic về Required Optional fields.
+ Pydantic có một hành vi đặc biệt khi bạn sử dụng `Optional` hoặc `Union[Something, None]` mà không có giá trị mặc dịnh, bạn có thể đọc nhiều hơn về nó trong tài liệu của Pydantic về Required Optional fields.
## Type Hints với Metadata Annotations
diff --git a/docs/yo/docs/index.md b/docs/yo/docs/index.md
index 101e13b6b..352bf4df8 100644
--- a/docs/yo/docs/index.md
+++ b/docs/yo/docs/index.md
@@ -1,3 +1,12 @@
+---
+hide:
+ - navigation
+---
+
+
+
@@ -31,7 +40,7 @@ FastAPI jẹ́ ìgbàlódé, tí ó yára (iṣẹ-giga), ìlànà wẹ́ẹ́b
Àwọn ẹya pàtàkì ni:
-* **Ó yára**: Iṣẹ tí ó ga púpọ̀, tí ó wa ni ibamu pẹ̀lú **NodeJS** àti **Go** (ọpẹ si Starlette àti Pydantic). [Ọkan nínú àwọn ìlànà Python ti o yára jùlọ ti o wa](#performance).
+* **Ó yára**: Iṣẹ tí ó ga púpọ̀, tí ó wa ni ibamu pẹ̀lú **NodeJS** àti **Go** (ọpẹ si Starlette àti Pydantic). [Ọkan nínú àwọn ìlànà Python ti o yára jùlọ ti o wa](#isesi).
* **Ó yára láti kóòdù**: O mu iyara pọ si láti kọ àwọn ẹya tuntun kóòdù nipasẹ "Igba ìdá ọgọ́rùn-ún" (i.e. 200%) si "ọ̀ọ́dúrún ìdá ọgọ́rùn-ún" (i.e. 300%).
* **Àìtọ́ kékeré**: O n din aṣiṣe ku bi ọgbon ìdá ọgọ́rùn-ún (i.e. 40%) ti eda eniyan (oṣiṣẹ kóòdù) fa. *
* **Ọgbọ́n àti ìmọ̀**: Atilẹyin olootu nla. Ìparí nibi gbogbo. Àkókò díẹ̀ nipa wíwá ibi tí ìṣòro kóòdù wà.
@@ -120,7 +129,7 @@ Python 3.8+
FastAPI dúró lórí àwọn èjìká tí àwọn òmíràn:
* Starlette fún àwọn ẹ̀yà ayélujára.
-* Pydantic fún àwọn ẹ̀yà àkójọf'áyẹ̀wò.
+* Pydantic fún àwọn ẹ̀yà àkójọf'áyẹ̀wò.
## Fifi sórí ẹrọ
@@ -453,15 +462,15 @@ Láti ní òye síi nípa rẹ̀, wo abala àwọn httpx - Nílò tí ó bá fẹ́ láti lọ `TestClient`.
* jinja2 - Nílò tí ó bá fẹ́ láti lọ iṣeto awoṣe aiyipada.
-* python-multipart - Nílò tí ó bá fẹ́ láti ṣe àtìlẹ́yìn fún "àyẹ̀wò" fọọmu, pẹ̀lú `request.form()`.
+* python-multipart - Nílò tí ó bá fẹ́ láti ṣe àtìlẹ́yìn fún "àyẹ̀wò" fọọmu, pẹ̀lú `request.form()`.
* itsdangerous - Nílò fún àtìlẹ́yìn `SessionMiddleware`.
* pyyaml - Nílò fún àtìlẹ́yìn Starlette's `SchemaGenerator` (ó ṣe ṣe kí ó má nílò rẹ̀ fún FastAPI).
-* ujson - Nílò tí ó bá fẹ́ láti lọ `UJSONResponse`.
Èyí tí FastAPI / Starlette ń lò:
* uvicorn - Fún olupin tí yóò sẹ́ àmúyẹ àti tí yóò ṣe ìpèsè fún iṣẹ́ rẹ tàbí ohun èlò rẹ.
* orjson - Nílò tí ó bá fẹ́ láti lọ `ORJSONResponse`.
+* ujson - Nílò tí ó bá fẹ́ láti lọ `UJSONResponse`.
Ó lè fi gbogbo àwọn wọ̀nyí sórí ẹrọ pẹ̀lú `pip install "fastapi[all]"`.
diff --git a/docs/zh-hant/docs/index.md b/docs/zh-hant/docs/index.md
new file mode 100644
index 000000000..f90eb2177
--- /dev/null
+++ b/docs/zh-hant/docs/index.md
@@ -0,0 +1,470 @@
+
++ FastAPI 框架,高效能,易於學習,快速開發,適用於生產環境 +
+ + +--- + +**文件**: https://fastapi.tiangolo.com + +**程式碼**: https://github.com/tiangolo/fastapi + +--- + +FastAPI 是一個現代、快速(高效能)的 web 框架,用於 Python 3.8+ 並採用標準 Python 型別提示。 + +主要特點包含: + +- **快速**: 非常高的效能,可與 **NodeJS** 和 **Go** 效能相當 (歸功於 Starlette and Pydantic)。 [FastAPI 是最快的 Python web 框架之一](#performance)。 +- **極速開發**: 提高開發功能的速度約 200% 至 300%。 \* +- **更少的 Bug**: 減少約 40% 的人為(開發者)導致的錯誤。 \* +- **直覺**: 具有出色的編輯器支援,處處都有自動補全以減少偵錯時間。 +- **簡單**: 設計上易於使用和學習,大幅減少閱讀文件的時間。 +- **簡潔**: 最小化程式碼重複性。可以通過不同的參數聲明來實現更豐富的功能,和更少的錯誤。 +- **穩健**: 立即獲得生產級可用的程式碼,還有自動生成互動式文件。 +- **標準化**: 基於 (且完全相容於) OpenAPIs 的相關標準:OpenAPI(之前被稱為 Swagger)和JSON Schema。 + +\* 基於內部開發團隊在建立生產應用程式時的測試預估。 + +## 贊助 + + + +{% if sponsors %} +{% for sponsor in sponsors.gold -%} +async def...uvicorn main:app --reload...email_validator - 用於電子郵件驗證。
+- pydantic-settings - 用於設定管理。
+- pydantic-extra-types - 用於與 Pydantic 一起使用的額外型別。
+
+用於 Starlette:
+
+- httpx - 使用 `TestClient`時必須安裝。
+- jinja2 - 使用預設的模板配置時必須安裝。
+- python-multipart - 需要使用 `request.form()` 對表單進行 "解析" 時安裝。
+- itsdangerous - 需要使用 `SessionMiddleware` 支援時安裝。
+- pyyaml - 用於支援 Starlette 的 `SchemaGenerator` (如果你使用 FastAPI,可能不需要它)。
+
+用於 FastAPI / Starlette:
+
+- uvicorn - 用於加載和運行應用程式的服務器。
+- orjson - 使用 `ORJSONResponse`時必須安裝。
+- ujson - 使用 `UJSONResponse` 時必須安裝。
+
+你可以使用 `pip install "fastapi[all]"` 來安裝這些所有依賴套件。
+
+## 授權
+
+該項目遵循 MIT 許可協議。
diff --git a/docs/zh-hant/docs/learn/index.md b/docs/zh-hant/docs/learn/index.md
new file mode 100644
index 000000000..eb7d7096a
--- /dev/null
+++ b/docs/zh-hant/docs/learn/index.md
@@ -0,0 +1,5 @@
+# 學習
+
+以下是學習 FastAPI 的入門介紹和教學。
+
+你可以將其視為一本**書籍**或一門**課程**,這是**官方**認可並推薦的 FastAPI 學習方式。 😎
diff --git a/docs/zh-hant/mkdocs.yml b/docs/zh-hant/mkdocs.yml
new file mode 100644
index 000000000..de18856f4
--- /dev/null
+++ b/docs/zh-hant/mkdocs.yml
@@ -0,0 +1 @@
+INHERIT: ../en/mkdocs.yml
diff --git a/docs/zh/docs/advanced/advanced-dependencies.md b/docs/zh/docs/advanced/advanced-dependencies.md
new file mode 100644
index 000000000..b2f6e3559
--- /dev/null
+++ b/docs/zh/docs/advanced/advanced-dependencies.md
@@ -0,0 +1,71 @@
+# 高级依赖项
+
+## 参数化的依赖项
+
+我们之前看到的所有依赖项都是写死的函数或类。
+
+但也可以为依赖项设置参数,避免声明多个不同的函数或类。
+
+假设要创建校验查询参数 `q` 是否包含固定内容的依赖项。
+
+但此处要把待检验的固定内容定义为参数。
+
+## **可调用**实例
+
+Python 可以把类实例变为**可调用项**。
+
+这里说的不是类本身(类本就是可调用项),而是类实例。
+
+为此,需要声明 `__call__` 方法:
+
+```Python hl_lines="10"
+{!../../../docs_src/dependencies/tutorial011.py!}
+```
+
+本例中,**FastAPI** 使用 `__call__` 检查附加参数及子依赖项,稍后,还要调用它向*路径操作函数*传递值。
+
+## 参数化实例
+
+接下来,使用 `__init__` 声明用于**参数化**依赖项的实例参数:
+
+```Python hl_lines="7"
+{!../../../docs_src/dependencies/tutorial011.py!}
+```
+
+本例中,**FastAPI** 不使用 `__init__`,我们要直接在代码中使用。
+
+## 创建实例
+
+使用以下代码创建类实例:
+
+```Python hl_lines="16"
+{!../../../docs_src/dependencies/tutorial011.py!}
+```
+
+这样就可以**参数化**依赖项,它包含 `checker.fixed_content` 的属性 - `"bar"`。
+
+## 把实例作为依赖项
+
+然后,不要再在 `Depends(checker)` 中使用 `Depends(FixedContentQueryChecker)`, 而是要使用 `checker`,因为依赖项是类实例 - `checker`,不是类。
+
+处理依赖项时,**FastAPI** 以如下方式调用 `checker`:
+
+```Python
+checker(q="somequery")
+```
+
+……并用*路径操作函数*的参数 `fixed_content_included` 返回依赖项的值:
+
+```Python hl_lines="20"
+{!../../../docs_src/dependencies/tutorial011.py!}
+```
+
+!!! tip "提示"
+
+ 本章示例有些刻意,也看不出有什么用处。
+
+ 这个简例只是为了说明高级依赖项的运作机制。
+
+ 在有关安全的章节中,工具函数将以这种方式实现。
+
+ 只要能理解本章内容,就能理解安全工具背后的运行机制。
diff --git a/docs/zh/docs/advanced/behind-a-proxy.md b/docs/zh/docs/advanced/behind-a-proxy.md
new file mode 100644
index 000000000..17fc2830a
--- /dev/null
+++ b/docs/zh/docs/advanced/behind-a-proxy.md
@@ -0,0 +1,351 @@
+# 使用代理
+
+有些情况下,您可能要使用 Traefik 或 Nginx 等**代理**服务器,并添加应用不能识别的附加路径前缀配置。
+
+此时,要使用 `root_path` 配置应用。
+
+`root_path` 是 ASGI 规范提供的机制,FastAPI 就是基于此规范开发的(通过 Starlette)。
+
+`root_path` 用于处理这些特定情况。
+
+在挂载子应用时,也可以在内部使用。
+
+## 移除路径前缀的代理
+
+本例中,移除路径前缀的代理是指在代码中声明路径 `/app`,然后在应用顶层添加代理,把 **FastAPI** 应用放在 `/api/v1` 路径下。
+
+本例的原始路径 `/app` 实际上是在 `/api/v1/app` 提供服务。
+
+哪怕所有代码都假设只有 `/app`。
+
+代理只在把请求传送给 Uvicorn 之前才会**移除路径前缀**,让应用以为它是在 `/app` 提供服务,因此不必在代码中加入前缀 `/api/v1`。
+
+但之后,在(前端)打开 API 文档时,代理会要求在 `/openapi.json`,而不是 `/api/v1/openapi.json` 中提取 OpenAPI 概图。
+
+因此, (运行在浏览器中的)前端会尝试访问 `/openapi.json`,但没有办法获取 OpenAPI 概图。
+
+这是因为应用使用了以 `/api/v1` 为路径前缀的代理,前端要从 `/api/v1/openapi.json` 中提取 OpenAPI 概图。
+
+```mermaid
+graph LR
+
+browser("Browser")
+proxy["Proxy on http://0.0.0.0:9999/api/v1/app"]
+server["Server on http://127.0.0.1:8000/app"]
+
+browser --> proxy
+proxy --> server
+```
+
+!!! tip "提示"
+
+ IP `0.0.0.0` 常用于指程序监听本机或服务器上的所有有效 IP。
+
+API 文档还需要 OpenAPI 概图声明 API `server` 位于 `/api/v1`(使用代理时的 URL)。例如:
+
+```JSON hl_lines="4-8"
+{
+ "openapi": "3.0.2",
+ // More stuff here
+ "servers": [
+ {
+ "url": "/api/v1"
+ }
+ ],
+ "paths": {
+ // More stuff here
+ }
+}
+```
+
+本例中的 `Proxy` 是 **Traefik**,`server` 是运行 FastAPI 应用的 **Uvicorn**。
+
+### 提供 `root_path`
+
+为此,要以如下方式使用命令行选项 `--root-path`:
+
+
+
+但输入**官方**链接 `/api/v1/docs`,并使用端口 `9999` 访问 API 文档,就能正常运行了!🎉
+
+输入 http://127.0.0.1:9999/api/v1/docs 查看文档:
+
+
+
+一切正常。 ✔️
+
+这是因为 FastAPI 在 OpenAPI 里使用 `root_path` 提供的 URL 创建默认 `server`。
+
+## 附加的服务器
+
+!!! warning "警告"
+
+ 此用例较难,可以跳过。
+
+默认情况下,**FastAPI** 使用 `root_path` 的链接在 OpenAPI 概图中创建 `server`。
+
+但也可以使用其它备选 `servers`,例如,需要同一个 API 文档与 staging 和生产环境交互。
+
+如果传递自定义 `servers` 列表,并有 `root_path`( 因为 API 使用了代理),**FastAPI** 会在列表开头使用这个 `root_path` 插入**服务器**。
+
+例如:
+
+```Python hl_lines="4-7"
+{!../../../docs_src/behind_a_proxy/tutorial003.py!}
+```
+
+这段代码生产如下 OpenAPI 概图:
+
+```JSON hl_lines="5-7"
+{
+ "openapi": "3.0.2",
+ // More stuff here
+ "servers": [
+ {
+ "url": "/api/v1"
+ },
+ {
+ "url": "https://stag.example.com",
+ "description": "Staging environment"
+ },
+ {
+ "url": "https://prod.example.com",
+ "description": "Production environment"
+ }
+ ],
+ "paths": {
+ // More stuff here
+ }
+}
+```
+
+!!! tip "提示"
+
+ 注意,自动生成服务器时,`url` 的值 `/api/v1` 提取自 `roog_path`。
+
+http://127.0.0.1:9999/api/v1/docs 的 API 文档所示如下:
+
+
+
+!!! tip "提示"
+
+ API 文档与所选的服务器进行交互。
+
+### 从 `root_path` 禁用自动服务器
+
+如果不想让 **FastAPI** 包含使用 `root_path` 的自动服务器,则要使用参数 `root_path_in_servers=False`:
+
+```Python hl_lines="9"
+{!../../../docs_src/behind_a_proxy/tutorial004.py!}
+```
+
+这样,就不会在 OpenAPI 概图中包含服务器了。
+
+## 挂载子应用
+
+如需挂载子应用(详见 [子应用 - 挂载](sub-applications.md){.internal-link target=_blank}),也要通过 `root_path` 使用代理,这与正常应用一样,别无二致。
+
+FastAPI 在内部使用 `root_path`,因此子应用也可以正常运行。✨
diff --git a/docs/zh/docs/advanced/dataclasses.md b/docs/zh/docs/advanced/dataclasses.md
new file mode 100644
index 000000000..5a93877cc
--- /dev/null
+++ b/docs/zh/docs/advanced/dataclasses.md
@@ -0,0 +1,99 @@
+# 使用数据类
+
+FastAPI 基于 **Pydantic** 构建,前文已经介绍过如何使用 Pydantic 模型声明请求与响应。
+
+但 FastAPI 还可以使用数据类(`dataclasses`):
+
+```Python hl_lines="1 7-12 19-20"
+{!../../../docs_src/dataclasses/tutorial001.py!}
+```
+
+这还是借助于 **Pydantic** 及其内置的 `dataclasses`。
+
+因此,即便上述代码没有显式使用 Pydantic,FastAPI 仍会使用 Pydantic 把标准数据类转换为 Pydantic 数据类(`dataclasses`)。
+
+并且,它仍然支持以下功能:
+
+* 数据验证
+* 数据序列化
+* 数据存档等
+
+数据类的和运作方式与 Pydantic 模型相同。实际上,它的底层使用的也是 Pydantic。
+
+!!! info "说明"
+
+ 注意,数据类不支持 Pydantic 模型的所有功能。
+
+ 因此,开发时仍需要使用 Pydantic 模型。
+
+ 但如果数据类很多,这一技巧能给 FastAPI 开发 Web API 增添不少助力。🤓
+
+## `response_model` 使用数据类
+
+在 `response_model` 参数中使用 `dataclasses`:
+
+```Python hl_lines="1 7-13 19"
+{!../../../docs_src/dataclasses/tutorial002.py!}
+```
+
+本例把数据类自动转换为 Pydantic 数据类。
+
+API 文档中也会显示相关概图:
+
+
+
+## 在嵌套数据结构中使用数据类
+
+您还可以把 `dataclasses` 与其它类型注解组合在一起,创建嵌套数据结构。
+
+还有一些情况也可以使用 Pydantic 的 `dataclasses`。例如,在 API 文档中显示错误。
+
+本例把标准的 `dataclasses` 直接替换为 `pydantic.dataclasses`:
+
+```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" }
+{!../../../docs_src/dataclasses/tutorial003.py!}
+```
+
+1. 本例依然要从标准的 `dataclasses` 中导入 `field`;
+
+2. 使用 `pydantic.dataclasses` 直接替换 `dataclasses`;
+
+3. `Author` 数据类包含 `Item` 数据类列表;
+
+4. `Author` 数据类用于 `response_model` 参数;
+
+5. 其它带有数据类的标准类型注解也可以作为请求体;
+
+ 本例使用的是 `Item` 数据类列表;
+
+6. 这行代码返回的是包含 `items` 的字典,`items` 是数据类列表;
+
+ FastAPI 仍能把数据序列化为 JSON;
+
+7. 这行代码中,`response_model` 的类型注解是 `Author` 数据类列表;
+
+ 再一次,可以把 `dataclasses` 与标准类型注解一起使用;
+
+8. 注意,*路径操作函数*使用的是普通函数,不是异步函数;
+
+ 与往常一样,在 FastAPI 中,可以按需组合普通函数与异步函数;
+
+ 如果不清楚何时使用异步函数或普通函数,请参阅**急不可待?**一节中对 `async` 与 `await` 的说明;
+
+9. *路径操作函数*返回的不是数据类(虽然它可以返回数据类),而是返回内含数据的字典列表;
+
+ FastAPI 使用(包含数据类的) `response_model` 参数转换响应。
+
+把 `dataclasses` 与其它类型注解组合在一起,可以组成不同形式的复杂数据结构。
+
+更多内容详见上述代码内的注释。
+
+## 深入学习
+
+您还可以把 `dataclasses` 与其它 Pydantic 模型组合在一起,继承合并的模型,把它们包含在您自己的模型里。
+
+详见 Pydantic 官档 - 数据类。
+
+## 版本
+
+本章内容自 FastAPI `0.67.0` 版起生效。🔖
diff --git a/docs/zh/docs/advanced/events.md b/docs/zh/docs/advanced/events.md
new file mode 100644
index 000000000..8e5fa7d12
--- /dev/null
+++ b/docs/zh/docs/advanced/events.md
@@ -0,0 +1,51 @@
+# 事件:启动 - 关闭
+
+**FastAPI** 支持定义在应用启动前,或应用关闭后执行的事件处理器(函数)。
+
+事件函数既可以声明为异步函数(`async def`),也可以声明为普通函数(`def`)。
+
+!!! warning "警告"
+
+ **FastAPI** 只执行主应用中的事件处理器,不执行[子应用 - 挂载](sub-applications.md){.internal-link target=_blank}中的事件处理器。
+
+## `startup` 事件
+
+使用 `startup` 事件声明 `app` 启动前运行的函数:
+
+```Python hl_lines="8"
+{!../../../docs_src/events/tutorial001.py!}
+```
+
+本例中,`startup` 事件处理器函数为项目数据库(只是**字典**)提供了一些初始值。
+
+**FastAPI** 支持多个事件处理器函数。
+
+只有所有 `startup` 事件处理器运行完毕,**FastAPI** 应用才开始接收请求。
+
+## `shutdown` 事件
+
+使用 `shutdown` 事件声明 `app` 关闭时运行的函数:
+
+```Python hl_lines="6"
+{!../../../docs_src/events/tutorial002.py!}
+```
+
+此处,`shutdown` 事件处理器函数在 `log.txt` 中写入一行文本 `Application shutdown`。
+
+!!! info "说明"
+
+ `open()` 函数中,`mode="a"` 指的是**追加**。因此这行文本会添加在文件已有内容之后,不会覆盖之前的内容。
+
+!!! tip "提示"
+
+ 注意,本例使用 Python `open()` 标准函数与文件交互。
+
+ 这个函数执行 I/O(输入/输出)操作,需要等待内容写进磁盘。
+
+ 但 `open()` 函数不支持使用 `async` 与 `await`。
+
+ 因此,声明事件处理函数要使用 `def`,不能使用 `asnyc def`。
+
+!!! info "说明"
+
+ 有关事件处理器的详情,请参阅 Starlette 官档 - 事件。
diff --git a/docs/zh/docs/advanced/generate-clients.md b/docs/zh/docs/advanced/generate-clients.md
index e222e479c..c4ffcb46c 100644
--- a/docs/zh/docs/advanced/generate-clients.md
+++ b/docs/zh/docs/advanced/generate-clients.md
@@ -10,7 +10,7 @@
一个常见的工具是 OpenAPI Generator。
-如果您正在开发**前端**,一个非常有趣的替代方案是 openapi-typescript-codegen。
+如果您正在开发**前端**,一个非常有趣的替代方案是 openapi-ts。
## 生成一个 TypeScript 前端客户端
@@ -46,14 +46,14 @@ OpenAPI中所包含的模型里有相同的信息可以用于 **生成客户端
现在我们有了带有模型的应用,我们可以为前端生成客户端代码。
-#### 安装 `openapi-typescript-codegen`
+#### 安装 `openapi-ts`
-您可以使用以下工具在前端代码中安装 `openapi-typescript-codegen`:
+您可以使用以下工具在前端代码中安装 `openapi-ts`:
diff --git a/docs/zh/docs/advanced/response-headers.md b/docs/zh/docs/advanced/response-headers.md
index 85dab15ac..229efffcb 100644
--- a/docs/zh/docs/advanced/response-headers.md
+++ b/docs/zh/docs/advanced/response-headers.md
@@ -25,7 +25,7 @@
```
-!!! 注意 "技术细节"
+!!! note "技术细节"
你也可以使用`from starlette.responses import Response`或`from starlette.responses import JSONResponse`。
**FastAPI**提供了与`fastapi.responses`相同的`starlette.responses`,只是为了方便开发者。但是,大多数可用的响应都直接来自Starlette。
diff --git a/docs/zh/docs/advanced/security/http-basic-auth.md b/docs/zh/docs/advanced/security/http-basic-auth.md
new file mode 100644
index 000000000..1f251ca45
--- /dev/null
+++ b/docs/zh/docs/advanced/security/http-basic-auth.md
@@ -0,0 +1,107 @@
+# HTTP 基础授权
+
+最简单的用例是使用 HTTP 基础授权(HTTP Basic Auth)。
+
+在 HTTP 基础授权中,应用需要请求头包含用户名与密码。
+
+如果没有接收到 HTTP 基础授权,就返回 HTTP 401 `"Unauthorized"` 错误。
+
+并返回含 `Basic` 值的请求头 `WWW-Authenticate`以及可选的 `realm` 参数。
+
+HTTP 基础授权让浏览器显示内置的用户名与密码提示。
+
+输入用户名与密码后,浏览器会把它们自动发送至请求头。
+
+## 简单的 HTTP 基础授权
+
+* 导入 `HTTPBsic` 与 `HTTPBasicCredentials`
+* 使用 `HTTPBsic` 创建**安全概图**
+* 在*路径操作*的依赖项中使用 `security`
+* 返回类型为 `HTTPBasicCredentials` 的对象:
+ * 包含发送的 `username` 与 `password`
+
+```Python hl_lines="2 6 10"
+{!../../../docs_src/security/tutorial006.py!}
+```
+
+第一次打开 URL(或在 API 文档中点击 **Execute** 按钮)时,浏览器要求输入用户名与密码:
+
+
+
+## 检查用户名
+
+以下是更完整的示例。
+
+使用依赖项检查用户名与密码是否正确。
+
+为此要使用 Python 标准模块 `secrets` 检查用户名与密码:
+
+```Python hl_lines="1 11-13"
+{!../../../docs_src/security/tutorial007.py!}
+```
+
+这段代码确保 `credentials.username` 是 `"stanleyjobson"`,且 `credentials.password` 是`"swordfish"`。与以下代码类似:
+
+```Python
+if not (credentials.username == "stanleyjobson") or not (credentials.password == "swordfish"):
+ # Return some error
+ ...
+```
+
+但使用 `secrets.compare_digest()`,可以防御**时差攻击**,更加安全。
+
+### 时差攻击
+
+什么是**时差攻击**?
+
+假设攻击者试图猜出用户名与密码。
+
+他们发送用户名为 `johndoe`,密码为 `love123` 的请求。
+
+然后,Python 代码执行如下操作:
+
+```Python
+if "johndoe" == "stanleyjobson" and "love123" == "swordfish":
+ ...
+```
+
+但就在 Python 比较完 `johndoe` 的第一个字母 `j` 与 `stanleyjobson` 的 `s` 时,Python 就已经知道这两个字符串不相同了,它会这么想,**没必要浪费更多时间执行剩余字母的对比计算了**。应用立刻就会返回**错误的用户或密码**。
+
+但接下来,攻击者继续尝试 `stanleyjobsox` 和 密码 `love123`。
+
+应用代码会执行类似下面的操作:
+
+```Python
+if "stanleyjobsox" == "stanleyjobson" and "love123" == "swordfish":
+ ...
+```
+
+此时,Python 要对比 `stanleyjobsox` 与 `stanleyjobson` 中的 `stanleyjobso`,才能知道这两个字符串不一样。因此会多花费几微秒来返回**错误的用户或密码**。
+
+#### 反应时间对攻击者的帮助
+
+通过服务器花费了更多微秒才发送**错误的用户或密码**响应,攻击者会知道猜对了一些内容,起码开头字母是正确的。
+
+然后,他们就可以放弃 `johndoe`,再用类似 `stanleyjobsox` 的内容进行尝试。
+
+#### **专业**攻击
+
+当然,攻击者不用手动操作,而是编写每秒能执行成千上万次测试的攻击程序,每次都会找到更多正确字符。
+
+但是,在您的应用的**帮助**下,攻击者利用时间差,就能在几分钟或几小时内,以这种方式猜出正确的用户名和密码。
+
+#### 使用 `secrets.compare_digest()` 修补
+
+在此,代码中使用了 `secrets.compare_digest()`。
+
+简单的说,它使用相同的时间对比 `stanleyjobsox` 和 `stanleyjobson`,还有 `johndoe` 和 `stanleyjobson`。对比密码时也一样。
+
+在代码中使用 `secrets.compare_digest()` ,就可以安全地防御全面攻击了。
+
+### 返回错误
+
+检测到凭证不正确后,返回 `HTTPException` 及状态码 401(与无凭证时返回的内容一样),并添加请求头 `WWW-Authenticate`,让浏览器再次显示登录提示:
+
+```Python hl_lines="15-19"
+{!../../../docs_src/security/tutorial007.py!}
+```
diff --git a/docs/zh/docs/advanced/security/index.md b/docs/zh/docs/advanced/security/index.md
index fdc8075c7..e2bef4765 100644
--- a/docs/zh/docs/advanced/security/index.md
+++ b/docs/zh/docs/advanced/security/index.md
@@ -2,7 +2,7 @@
## 附加特性
-除 [教程 - 用户指南: 安全性](../../tutorial/security/){.internal-link target=_blank} 中涵盖的功能之外,还有一些额外的功能来处理安全性.
+除 [教程 - 用户指南: 安全性](../../tutorial/security/index.md){.internal-link target=_blank} 中涵盖的功能之外,还有一些额外的功能来处理安全性.
!!! tip "小贴士"
接下来的章节 **并不一定是 "高级的"**.
@@ -11,6 +11,6 @@
## 先阅读教程
-接下来的部分假设你已经阅读了主要的 [教程 - 用户指南: 安全性](../../tutorial/security/){.internal-link target=_blank}.
+接下来的部分假设你已经阅读了主要的 [教程 - 用户指南: 安全性](../../tutorial/security/index.md){.internal-link target=_blank}.
它们都基于相同的概念,但支持一些额外的功能.
diff --git a/docs/zh/docs/advanced/security/oauth2-scopes.md b/docs/zh/docs/advanced/security/oauth2-scopes.md
new file mode 100644
index 000000000..e5eeffb0a
--- /dev/null
+++ b/docs/zh/docs/advanced/security/oauth2-scopes.md
@@ -0,0 +1,276 @@
+# OAuth2 作用域
+
+**FastAPI** 无缝集成 OAuth2 作用域(`Scopes`),可以直接使用。
+
+作用域是更精密的权限系统,遵循 OAuth2 标准,与 OpenAPI 应用(和 API 自动文档)集成。
+
+OAuth2 也是脸书、谷歌、GitHub、微软、推特等第三方身份验证应用使用的机制。这些身份验证应用在用户登录应用时使用 OAuth2 提供指定权限。
+
+脸书、谷歌、GitHub、微软、推特就是 OAuth2 作用域登录。
+
+本章介绍如何在 **FastAPI** 应用中使用 OAuth2 作用域管理验证与授权。
+
+!!! warning "警告"
+
+ 本章内容较难,刚接触 FastAPI 的新手可以跳过。
+
+ OAuth2 作用域不是必需的,没有它,您也可以处理身份验证与授权。
+
+ 但 OAuth2 作用域与 API(通过 OpenAPI)及 API 文档集成地更好。
+
+ 不管怎么说,**FastAPI** 支持在代码中使用作用域或其它安全/授权需求项。
+
+ 很多情况下,OAuth2 作用域就像一把牛刀。
+
+ 但如果您确定要使用作用域,或对它有兴趣,请继续阅读。
+
+## OAuth2 作用域与 OpenAPI
+
+OAuth2 规范的**作用域**是由空格分割的字符串组成的列表。
+
+这些字符串支持任何格式,但不能包含空格。
+
+作用域表示的是**权限**。
+
+OpenAPI 中(例如 API 文档)可以定义**安全方案**。
+
+这些安全方案在使用 OAuth2 时,还可以声明和使用作用域。
+
+**作用域**只是(不带空格的)字符串。
+
+常用于声明特定安全权限,例如:
+
+* 常见用例为,`users:read` 或 `users:write`
+* 脸书和 Instagram 使用 `instagram_basic`
+* 谷歌使用 `https://www.googleapis.com/auth/drive`
+
+!!! info "说明"
+
+ OAuth2 中,**作用域**只是声明特定权限的字符串。
+
+ 是否使用冒号 `:` 等符号,或是不是 URL 并不重要。
+
+ 这些细节只是特定的实现方式。
+
+ 对 OAuth2 来说,它们都只是字符串而已。
+
+## 全局纵览
+
+首先,快速浏览一下以下代码与**用户指南**中 [OAuth2 实现密码哈希与 Bearer JWT 令牌验证](../../tutorial/security/oauth2-jwt.md){.internal-link target=_blank}一章中代码的区别。以下代码使用 OAuth2 作用域:
+
+```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 153"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+下面,我们逐步说明修改的代码内容。
+
+## OAuth2 安全方案
+
+第一个修改的地方是,使用两个作用域 `me` 和 `items ` 声明 OAuth2 安全方案。
+
+`scopes` 参数接收**字典**,键是作用域、值是作用域的描述:
+
+```Python hl_lines="62-65"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+因为声明了作用域,所以登录或授权时会在 API 文档中显示。
+
+此处,选择给予访问权限的作用域: `me` 和 `items`。
+
+这也是使用脸书、谷歌、GitHub 登录时的授权机制。
+
+
+
+## JWT 令牌作用域
+
+现在,修改令牌*路径操作*,返回请求的作用域。
+
+此处仍然使用 `OAuth2PasswordRequestForm`。它包含类型为**字符串列表**的 `scopes` 属性,且`scopes` 属性中包含要在请求里接收的每个作用域。
+
+这样,返回的 JWT 令牌中就包含了作用域。
+
+!!! danger "危险"
+
+ 为了简明起见,本例把接收的作用域直接添加到了令牌里。
+
+ 但在您的应用中,为了安全,应该只把作用域添加到确实需要作用域的用户,或预定义的用户。
+
+```Python hl_lines="153"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+## 在*路径操作*与依赖项中声明作用域
+
+接下来,为*路径操作* `/users/me/items/` 声明作用域 `items`。
+
+为此,要从 `fastapi` 中导入并使用 `Security` 。
+
+`Security` 声明依赖项的方式和 `Depends` 一样,但 `Security` 还能接收作用域(字符串)列表类型的参数 `scopes`。
+
+此处使用与 `Depends` 相同的方式,把依赖项函数 `get_current_active_user` 传递给 `Security`。
+
+同时,还传递了作用域**列表**,本例中只传递了一个作用域:`items`(此处支持传递更多作用域)。
+
+依赖项函数 `get_current_active_user` 还能声明子依赖项,不仅可以使用 `Depends`,也可以使用 `Security`。声明子依赖项函数(`get_current_user`)及更多作用域。
+
+本例要求使用作用域 `me`(还可以使用更多作用域)。
+
+!!! note "笔记"
+
+ 不必在不同位置添加不同的作用域。
+
+ 本例使用的这种方式只是为了展示 **FastAPI** 如何处理在不同层级声明的作用域。
+
+```Python hl_lines="4 139 166"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+!!! info "技术细节"
+
+ `Security` 实际上是 `Depends` 的子类,而且只比 `Depends` 多一个参数。
+
+ 但使用 `Security` 代替 `Depends`,**FastAPI** 可以声明安全作用域,并在内部使用这些作用域,同时,使用 OpenAPI 存档 API。
+
+ 但实际上,从 `fastapi` 导入的 `Query`、`Path`、`Depends`、`Security` 等对象,只是返回特殊类的函数。
+
+## 使用 `SecurityScopes`
+
+修改依赖项 `get_current_user`。
+
+这是上面的依赖项使用的依赖项。
+
+这里使用的也是之前创建的 OAuth2 方案,并把它声明为依赖项:`oauth2_scheme`。
+
+该依赖项函数本身不需要作用域,因此,可以使用 `Depends` 和 `oauth2_scheme`。不需要指定安全作用域时,不必使用 `Security`。
+
+此处还声明了从 `fastapin.security` 导入的 `SecurityScopes` 类型的特殊参数。
+
+`SecuriScopes` 类与 `Request` 类似(`Request` 用于直接提取请求对象)。
+
+```Python hl_lines="8 105"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+## 使用 `scopes`
+
+参数 `security_scopes` 的类型是 `SecurityScopes`。
+
+它的属性 `scopes` 是作用域列表,所有依赖项都把它作为子依赖项。也就是说所有**依赖**……这听起来有些绕,后文会有解释。
+
+(类 `SecurityScopes` 的)`security_scopes` 对象还提供了单字符串类型的属性 `scope_str`,该属性是(要在本例中使用的)用空格分割的作用域。
+
+此处还创建了后续代码中要复用(`raise`)的 `HTTPException` 。
+
+该异常包含了作用域所需的(如有),以空格分割的字符串(使用 `scope_str`)。该字符串要放到包含作用域的 `WWW-Authenticate` 请求头中(这也是规范的要求)。
+
+```Python hl_lines="105 107-115"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+## 校验 `username` 与数据形状
+
+我们可以校验是否获取了 `username`,并抽取作用域。
+
+然后,使用 Pydantic 模型校验数据(捕获 `ValidationError` 异常),如果读取 JWT 令牌或使用 Pydantic 模型验证数据时出错,就会触发之前创建的 `HTTPException` 异常。
+
+对此,要使用新的属性 `scopes` 更新 Pydantic 模型 `TokenData`。
+
+使用 Pydantic 验证数据可以确保数据中含有由作用域组成的**字符串列表**,以及 `username` 字符串等内容。
+
+反之,如果使用**字典**或其它数据结构,就有可能在后面某些位置破坏应用,形成安全隐患。
+
+还可以使用用户名验证用户,如果没有用户,也会触发之前创建的异常。
+
+```Python hl_lines="46 116-127"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+## 校验 `scopes`
+
+接下来,校验所有依赖项和依赖要素(包括*路径操作*)所需的作用域。这些作用域包含在令牌的 `scopes` 里,如果不在其中就会触发 `HTTPException` 异常。
+
+为此,要使用包含所有作用域**字符串列表**的 `security_scopes.scopes`, 。
+
+```Python hl_lines="128-134"
+{!../../../docs_src/security/tutorial005.py!}
+```
+
+## 依赖项树与作用域
+
+再次查看这个依赖项树与作用域。
+
+`get_current_active_user` 依赖项包含子依赖项 `get_current_user`,并在 `get_current_active_user`中声明了作用域 `"me"` 包含所需作用域列表 ,在 `security_scopes.scopes` 中传递给 `get_current_user`。
+
+*路径操作*自身也声明了作用域,`"items"`,这也是 `security_scopes.scopes` 列表传递给 `get_current_user` 的。
+
+依赖项与作用域的层级架构如下:
+
+* *路径操作* `read_own_items` 包含:
+ * 依赖项所需的作用域 `["items"]`:
+ * `get_current_active_user`:
+ * 依赖项函数 `get_current_active_user` 包含:
+ * 所需的作用域 `"me"` 包含依赖项:
+ * `get_current_user`:
+ * 依赖项函数 `get_current_user` 包含:
+ * 没有作用域需求其自身
+ * 依赖项使用 `oauth2_scheme`
+ * `security_scopes` 参数的类型是 `SecurityScopes`:
+ * `security_scopes` 参数的属性 `scopes` 是包含上述声明的所有作用域的**列表**,因此:
+ * `security_scopes.scopes` 包含用于*路径操作*的 `["me", "items"]`
+ * `security_scopes.scopes` 包含*路径操作* `read_users_me` 的 `["me"]`,因为它在依赖项里被声明
+ * `security_scopes.scopes` 包含用于*路径操作* `read_system_status` 的 `[]`(空列表),并且它的依赖项 `get_current_user` 也没有声明任何 `scope`
+
+!!! tip "提示"
+
+ 此处重要且**神奇**的事情是,`get_current_user` 检查每个*路径操作*时可以使用不同的 `scopes` 列表。
+
+ 所有这些都依赖于在每个*路径操作*和指定*路径操作*的依赖树中的每个依赖项。
+
+## `SecurityScopes` 的更多细节
+
+您可以任何位置或多个位置使用 `SecurityScopes`,不一定非得在**根**依赖项中使用。
+
+它总是在当前 `Security` 依赖项中和所有依赖因子对于**特定** *路径操作*和**特定**依赖树中安全作用域
+
+因为 `SecurityScopes` 包含所有由依赖项声明的作用域,可以在核心依赖函数中用它验证所需作用域的令牌,然后再在不同的*路径操作*中声明不同作用域需求。
+
+它们会为每个*路径操作*进行单独检查。
+
+## 查看文档
+
+打开 API 文档,进行身份验证,并指定要授权的作用域。
+
+
+
+没有选择任何作用域,也可以进行**身份验证**,但访问 `/uses/me` 或 `/users/me/items` 时,会显示没有足够的权限。但仍可以访问 `/status/`。
+
+如果选择了作用域 `me`,但没有选择作用域 `items`,则可以访问 `/users/me/`,但不能访问 `/users/me/items`。
+
+这就是通过用户提供的令牌使用第三方应用访问这些*路径操作*时会发生的情况,具体怎样取决于用户授予第三方应用的权限。
+
+## 关于第三方集成
+
+本例使用 OAuth2 **密码**流。
+
+这种方式适用于登录我们自己的应用,最好使用我们自己的前端。
+
+因为我们能控制自己的前端应用,可以信任它接收 `username` 与 `password`。
+
+但如果构建的是连接其它应用的 OAuth2 应用,比如具有与脸书、谷歌、GitHub 相同功能的第三方身份验证应用。那您就应该使用其它安全流。
+
+最常用的是隐式流。
+
+最安全的是代码流,但实现起来更复杂,而且需要更多步骤。因为它更复杂,很多第三方身份验证应用最终建议使用隐式流。
+
+!!! note "笔记"
+
+ 每个身份验证应用都会采用不同方式会命名流,以便融合入自己的品牌。
+
+ 但归根结底,它们使用的都是 OAuth2 标准。
+
+**FastAPI** 的 `fastapi.security.oauth2` 里包含了所有 OAuth2 身份验证流工具。
+
+## 装饰器 `dependencies` 中的 `Security`
+
+同样,您可以在装饰器的 `dependencies` 参数中定义 `Depends` 列表,(详见[路径操作装饰器依赖项](../../tutorial/dependencies/dependencies-in-path-operation-decorators.md){.internal-link target=_blank})),也可以把 `scopes` 与 `Security` 一起使用。
diff --git a/docs/zh/docs/advanced/settings.md b/docs/zh/docs/advanced/settings.md
index 76070fb7f..d793b9c7f 100644
--- a/docs/zh/docs/advanced/settings.md
+++ b/docs/zh/docs/advanced/settings.md
@@ -127,7 +127,7 @@ Hello World from Python
## Pydantic 的 `Settings`
-幸运的是,Pydantic 提供了一个很好的工具来处理来自环境变量的设置,即Pydantic: Settings management。
+幸运的是,Pydantic 提供了一个很好的工具来处理来自环境变量的设置,即Pydantic: Settings management。
### 创建 `Settings` 对象
@@ -314,7 +314,7 @@ APP_NAME="ChimichangApp"
在这里,我们在 Pydantic 的 `Settings` 类中创建了一个名为 `Config` 的类,并将 `env_file` 设置为我们想要使用的 dotenv 文件的文件名。
!!! tip
- `Config` 类仅用于 Pydantic 配置。您可以在Pydantic Model Config中阅读更多相关信息。
+ `Config` 类仅用于 Pydantic 配置。您可以在Pydantic Model Config中阅读更多相关信息。
### 使用 `lru_cache` 仅创建一次 `Settings`
diff --git a/docs/zh/docs/advanced/sub-applications.md b/docs/zh/docs/advanced/sub-applications.md
new file mode 100644
index 000000000..a26301b50
--- /dev/null
+++ b/docs/zh/docs/advanced/sub-applications.md
@@ -0,0 +1,73 @@
+# 子应用 - 挂载
+
+如果需要两个独立的 FastAPI 应用,拥有各自独立的 OpenAPI 与文档,则需设置一个主应用,并**挂载**一个(或多个)子应用。
+
+## 挂载 **FastAPI** 应用
+
+**挂载**是指在特定路径中添加完全**独立**的应用,然后在该路径下使用*路径操作*声明的子应用处理所有事务。
+
+### 顶层应用
+
+首先,创建主(顶层)**FastAPI** 应用及其*路径操作*:
+
+```Python hl_lines="3 6-8"
+{!../../../docs_src/sub_applications/tutorial001.py!}
+```
+
+### 子应用
+
+接下来,创建子应用及其*路径操作*。
+
+子应用只是另一个标准 FastAPI 应用,但这个应用是被**挂载**的应用:
+
+```Python hl_lines="11 14-16"
+{!../../../docs_src/sub_applications/tutorial001.py!}
+```
+
+### 挂载子应用
+
+在顶层应用 `app` 中,挂载子应用 `subapi`。
+
+本例的子应用挂载在 `/subapi` 路径下:
+
+```Python hl_lines="11 19"
+{!../../../docs_src/sub_applications/tutorial001.py!}
+```
+
+### 查看文档
+
+如果主文件是 `main.py`,则用以下 `uvicorn` 命令运行主应用:
+
+
+
+然后查看子应用文档 http://127.0.0.1:8000/subapi/docs。
+
+下图显示的是子应用的 API 文档,也是只包括其自有的*路径操作*,所有这些路径操作都在 `/subapi` 子路径前缀下。
+
+
+
+两个用户界面都可以正常运行,因为浏览器能够与每个指定的应用或子应用会话。
+
+### 技术细节:`root_path`
+
+以上述方式挂载子应用时,FastAPI 使用 ASGI 规范中的 `root_path` 机制处理挂载子应用路径之间的通信。
+
+这样,子应用就可以为自动文档使用路径前缀。
+
+并且子应用还可以再挂载子应用,一切都会正常运行,FastAPI 可以自动处理所有 `root_path`。
+
+关于 `root_path` 及如何显式使用 `root_path` 的内容,详见[使用代理](behind-a-proxy.md){.internal-link target=_blank}一章。
diff --git a/docs/zh/docs/advanced/templates.md b/docs/zh/docs/advanced/templates.md
new file mode 100644
index 000000000..d735f1697
--- /dev/null
+++ b/docs/zh/docs/advanced/templates.md
@@ -0,0 +1,94 @@
+# 模板
+
+**FastAPI** 支持多种模板引擎。
+
+Flask 等工具使用的 Jinja2 是最用的模板引擎。
+
+在 Starlette 的支持下,**FastAPI** 应用可以直接使用工具轻易地配置 Jinja2。
+
+## 安装依赖项
+
+安装 `jinja2`:
+
+
+
+---
+
+现在我们知道了术语“进程”和“程序”之间的区别,让我们继续讨论部署。
+
+## 启动时运行
+
+在大多数情况下,当您创建 Web API 时,您希望它**始终运行**、不间断,以便您的客户端始终可以访问它。 这是当然的,除非您有特定原因希望它仅在某些情况下运行,但大多数时候您希望它不断运行并且**可用**。
+
+### 在远程服务器中
+
+当您设置远程服务器(云服务器、虚拟机等)时,您可以做的最简单的事情就是手动运行 Uvicorn(或类似的),就像本地开发时一样。
+
+它将会在**开发过程中**发挥作用并发挥作用。
+
+但是,如果您与服务器的连接丢失,**正在运行的进程**可能会终止。
+
+如果服务器重新启动(例如更新后或从云提供商迁移后),您可能**不会注意到它**。 因此,您甚至不知道必须手动重新启动该进程。 所以,你的 API 将一直处于挂掉的状态。 😱
+
+
+### 启动时自动运行
+
+一般来说,您可能希望服务器程序(例如 Uvicorn)在服务器启动时自动启动,并且不需要任何**人为干预**,让进程始终与您的 API 一起运行(例如 Uvicorn 运行您的 FastAPI 应用程序) 。
+
+### 单独的程序
+
+为了实现这一点,您通常会有一个**单独的程序**来确保您的应用程序在启动时运行。 在许多情况下,它还可以确保其他组件或应用程序也运行,例如数据库。
+
+### 启动时运行的示例工具
+
+可以完成这项工作的工具的一些示例是:
+
+* Docker
+* Kubernetes
+* Docker Compose
+* Docker in Swarm Mode
+* Systemd
+* Supervisor
+* 作为其服务的一部分由云提供商内部处理
+* 其他的...
+
+我将在接下来的章节中为您提供更具体的示例。
+
+
+## 重新启动
+
+与确保应用程序在启动时运行类似,您可能还想确保它在挂掉后**重新启动**。
+
+### 我们会犯错误
+
+作为人类,我们总是会犯**错误**。 软件几乎*总是*在不同的地方隐藏着**bug**。 🐛
+
+作为开发人员,当我们发现这些bug并实现新功能(也可能添加新bug😅)时,我们会不断改进代码。
+
+### 自动处理小错误
+
+使用 FastAPI 构建 Web API 时,如果我们的代码中存在错误,FastAPI 通常会将其包含到触发错误的单个请求中。 🛡
+
+对于该请求,客户端将收到 **500 内部服务器错误**,但应用程序将继续处理下一个请求,而不是完全崩溃。
+
+### 更大的错误 - 崩溃
+
+尽管如此,在某些情况下,我们编写的一些代码可能会导致整个应用程序崩溃,从而导致 Uvicorn 和 Python 崩溃。 💥
+
+尽管如此,您可能不希望应用程序因为某个地方出现错误而保持死机状态,您可能希望它**继续运行**,至少对于未破坏的*路径操作*。
+
+### 崩溃后重新启动
+
+但在那些严重错误导致正在运行的**进程**崩溃的情况下,您需要一个外部组件来负责**重新启动**进程,至少尝试几次......
+
+!!! tip
+
+ ...尽管如果整个应用程序只是**立即崩溃**,那么永远重新启动它可能没有意义。 但在这些情况下,您可能会在开发过程中注意到它,或者至少在部署后立即注意到它。
+
+ 因此,让我们关注主要情况,在**未来**的某些特定情况下,它可能会完全崩溃,但重新启动它仍然有意义。
+
+您可能希望让这个东西作为 **外部组件** 负责重新启动您的应用程序,因为到那时,使用 Uvicorn 和 Python 的同一应用程序已经崩溃了,因此同一应用程序的相同代码中没有东西可以对此做出什么。
+
+### 自动重新启动的示例工具
+
+在大多数情况下,用于**启动时运行程序**的同一工具也用于处理自动**重新启动**。
+
+例如,可以通过以下方式处理:
+
+* Docker
+* Kubernetes
+* Docker Compose
+* Docker in Swarm mode
+* Systemd
+* Supervisor
+* 作为其服务的一部分由云提供商内部处理
+* 其他的...
+
+## 复制 - 进程和内存
+
+对于 FastAPI 应用程序,使用像 Uvicorn 这样的服务器程序,在**一个进程**中运行一次就可以同时为多个客户端提供服务。
+
+但在许多情况下,您会希望同时运行多个工作进程。
+
+### 多进程 - Workers
+
+如果您的客户端数量多于单个进程可以处理的数量(例如,如果虚拟机不是太大),并且服务器的 CPU 中有 **多个核心**,那么您可以让 **多个进程** 运行 同时处理同一个应用程序,并在它们之间分发所有请求。
+
+当您运行同一 API 程序的**多个进程**时,它们通常称为 **workers**。
+
+### 工作进程和端口
+
+还记得文档 [About HTTPS](https.md){.internal-link target=_blank} 中只有一个进程可以侦听服务器中的端口和 IP 地址的一种组合吗?
+
+现在仍然是对的。
+
+因此,为了能够同时拥有**多个进程**,必须有一个**单个进程侦听端口**,然后以某种方式将通信传输到每个工作进程。
+
+### 每个进程的内存
+
+现在,当程序将内容加载到内存中时,例如,将机器学习模型加载到变量中,或者将大文件的内容加载到变量中,所有这些都会消耗服务器的一点内存 (RAM) 。
+
+多个进程通常**不共享任何内存**。 这意味着每个正在运行的进程都有自己的东西、变量和内存。 如果您的代码消耗了大量内存,**每个进程**将消耗等量的内存。
+
+### 服务器内存
+
+例如,如果您的代码加载 **1 GB 大小**的机器学习模型,则当您使用 API 运行一个进程时,它将至少消耗 1 GB RAM。 如果您启动 **4 个进程**(4 个工作进程),每个进程将消耗 1 GB RAM。 因此,您的 API 总共将消耗 **4 GB RAM**。
+
+如果您的远程服务器或虚拟机只有 3 GB RAM,尝试加载超过 4 GB RAM 将导致问题。 🚨
+
+
+### 多进程 - 一个例子
+
+在此示例中,有一个 **Manager Process** 启动并控制两个 **Worker Processes**。
+
+该管理器进程可能是监听 IP 中的 **端口** 的进程。 它将所有通信传输到工作进程。
+
+这些工作进程将是运行您的应用程序的进程,它们将执行主要计算以接收 **请求** 并返回 **响应**,并且它们将加载您放入 RAM 中的变量中的任何内容。
+
++没有大家之前所做的工作,**FastAPI** 就不会存在。 + +以前创建的这些工具为它的出现提供了灵感。 + +在那几年中,我一直回避创建新的框架。首先,我尝试使用各种框架、插件、工具解决 **FastAPI** 现在的功能。 + +但到了一定程度之后,我别无选择,只能从之前的工具中汲取最优思路,并以尽量好的方式把这些思路整合在一起,使用之前甚至是不支持的语言特性(Python 3.6+ 的类型提示),从而创建一个能满足我所有需求的框架。 + ++ +## 调研 + +通过使用之前所有的备选方案,我有机会从它们之中学到了很多东西,获取了很多想法,并以我和我的开发团队能想到的最好方式把这些思路整合成一体。 + +例如,大家都清楚,在理想状态下,它应该基于标准的 Python 类型提示。 + +而且,最好的方式是使用现有的标准。 + +因此,甚至在开发 **FastAPI** 前,我就花了几个月的时间研究 OpenAPI、JSON Schema、OAuth2 等规范。深入理解它们之间的关系、重叠及区别之处。 + +## 设计 + +然后,我又花了一些时间从用户角度(使用 FastAPI 的开发者)设计了开发者 **API**。 + +同时,我还在最流行的 Python 代码编辑器中测试了很多思路,包括 PyCharm、VS Code、基于 Jedi 的编辑器。 + +根据最新 Python 开发者调研报告显示,这几种编辑器覆盖了约 80% 的用户。 + +也就是说,**FastAPI** 针对差不多 80% 的 Python 开发者使用的编辑器进行了测试,而且其它大多数编辑器的工作方式也与之类似,因此,**FastAPI** 的优势几乎能在所有编辑器上体现。 + +通过这种方式,我就能找到尽可能减少代码重复的最佳方式,进而实现处处都有自动补全、类型提示与错误检查等支持。 + +所有这些都是为了给开发者提供最佳的开发体验。 + +## 需求项 + +经过测试多种备选方案,我最终决定使用 **Pydantic**,并充分利用它的优势。 + +我甚至为它做了不少贡献,让它完美兼容了 JSON Schema,支持多种方式定义约束声明,并基于多个编辑器,改进了它对编辑器支持(类型检查、自动补全)。 + +在开发期间,我还为 **Starlette** 做了不少贡献,这是另一个关键需求项。 + +## 开发 + +当我启动 **FastAPI** 开发的时候,绝大多数部件都已经就位,设计已经定义,需求项和工具也已经准备就绪,相关标准与规范的知识储备也非常清晰而新鲜。 + +## 未来 + +至此,**FastAPI** 及其理念已经为很多人所用。 + +对于很多用例,它比以前很多备选方案都更适用。 + +很多开发者和开发团队已经依赖 **FastAPI** 开发他们的项目(包括我和我的团队)。 + +但,**FastAPI** 仍有很多改进的余地,也还需要添加更多的功能。 + +总之,**FastAPI** 前景光明。 + +在此,我们衷心感谢[您的帮助](help-fastapi.md){.internal-link target=_blank}。 diff --git a/docs/zh/docs/index.md b/docs/zh/docs/index.md index d776e5813..2a67e8d08 100644 --- a/docs/zh/docs/index.md +++ b/docs/zh/docs/index.md @@ -1,3 +1,12 @@ +--- +hide: + - navigation +--- + + + @@ -14,6 +23,9 @@
httpx - 使用 `TestClient` 时安装。
* jinja2 - 使用默认模板配置时安装。
-* python-multipart - 需要通过 `request.form()` 对表单进行「解析」时安装。
+* python-multipart - 需要通过 `request.form()` 对表单进行「解析」时安装。
* itsdangerous - 需要 `SessionMiddleware` 支持时安装。
* pyyaml - 使用 Starlette 提供的 `SchemaGenerator` 时安装(有 FastAPI 你可能并不需要它)。
* graphene - 需要 `GraphQLApp` 支持时安装。
-* ujson - 使用 `UJSONResponse` 时安装。
用于 FastAPI / Starlette:
* uvicorn - 用于加载和运行你的应用程序的服务器。
* orjson - 使用 `ORJSONResponse` 时安装。
+* ujson - 使用 `UJSONResponse` 时安装。
-你可以通过 `pip install fastapi[all]` 命令来安装以上所有依赖。
+你可以通过 `pip install "fastapi[all]"` 命令来安装以上所有依赖。
## 许可协议
diff --git a/docs/zh/docs/project-generation.md b/docs/zh/docs/project-generation.md
new file mode 100644
index 000000000..feafa5333
--- /dev/null
+++ b/docs/zh/docs/project-generation.md
@@ -0,0 +1,84 @@
+# 项目生成 - 模板
+
+项目生成器一般都会提供很多初始设置、安全措施、数据库,甚至还准备好了第一个 API 端点,能帮助您快速上手。
+
+项目生成器的设置通常都很主观,您可以按需更新或修改,但对于您的项目来说,它是非常好的起点。
+
+## 全栈 FastAPI + PostgreSQL
+
+GitHub:https://github.com/tiangolo/full-stack-fastapi-postgresql
+
+### 全栈 FastAPI + PostgreSQL - 功能
+
+* 完整的 **Docker** 集成(基于 Docker)
+* Docker Swarm 开发模式
+* **Docker Compose** 本地开发集成与优化
+* **生产可用**的 Python 网络服务器,使用 Uvicorn 或 Gunicorn
+* Python **FastAPI** 后端:
+* * **速度快**:可与 **NodeJS** 和 **Go** 比肩的极高性能(归功于 Starlette 和 Pydantic)
+ * **直观**:强大的编辑器支持,处处皆可自动补全,减少调试时间
+ * **简单**:易学、易用,阅读文档所需时间更短
+ * **简短**:代码重复最小化,每次参数声明都可以实现多个功能
+ * **健壮**: 生产级别的代码,还有自动交互文档
+ * **基于标准**:完全兼容并基于 API 开放标准:OpenAPI 和 JSON Schema
+ * **更多功能**包括自动验证、序列化、交互文档、OAuth2 JWT 令牌身份验证等
+* **安全密码**,默认使用密码哈希
+* **JWT 令牌**身份验证
+* **SQLAlchemy** 模型(独立于 Flask 扩展,可直接用于 Celery Worker)
+* 基础的用户模型(可按需修改或删除)
+* **Alembic** 迁移
+* **CORS**(跨域资源共享)
+* **Celery** Worker 可从后端其它部分有选择地导入并使用模型和代码
+* REST 后端测试基于 Pytest,并与 Docker 集成,可独立于数据库实现完整的 API 交互测试。因为是在 Docker 中运行,每次都可从头构建新的数据存储(使用 ElasticSearch、MongoDB、CouchDB 等数据库,仅测试 API 运行)
+* Python 与 **Jupyter Kernels** 集成,用于远程或 Docker 容器内部开发,使用 Atom Hydrogen 或 Visual Studio Code 的 Jupyter 插件
+* **Vue** 前端:
+ * 由 Vue CLI 生成
+ * **JWT 身份验证**处理
+ * 登录视图
+ * 登录后显示主仪表盘视图
+ * 主仪表盘支持用户创建与编辑
+ * 用户信息编辑
+ * **Vuex**
+ * **Vue-router**
+ * **Vuetify** 美化组件
+ * **TypeScript**
+ * 基于 **Nginx** 的 Docker 服务器(优化了 Vue-router 配置)
+ * Docker 多阶段构建,无需保存或提交编译的代码
+ * 在构建时运行前端测试(可禁用)
+ * 尽量模块化,开箱即用,但仍可使用 Vue CLI 重新生成或创建所需项目,或复用所需内容
+* 使用 **PGAdmin** 管理 PostgreSQL 数据库,可轻松替换为 PHPMyAdmin 或 MySQL
+* 使用 **Flower** 监控 Celery 任务
+* 使用 **Traefik** 处理前后端负载平衡,可把前后端放在同一个域下,按路径分隔,但在不同容器中提供服务
+* Traefik 集成,包括自动生成 Let's Encrypt **HTTPS** 凭证
+* GitLab **CI**(持续集成),包括前后端测试
+
+## 全栈 FastAPI + Couchbase
+
+GitHub:https://github.com/tiangolo/full-stack-fastapi-couchbase
+
+⚠️ **警告** ⚠️
+
+如果您想从头开始创建新项目,建议使用以下备选方案。
+
+例如,项目生成器全栈 FastAPI + PostgreSQL 会更适用,这个项目的维护积极,用的人也多,还包括了所有新功能和改进内容。
+
+当然,您也可以放心使用这个基于 Couchbase 的生成器,它也能正常使用。就算用它生成项目也没有任何问题(为了更好地满足需求,您可以自行更新这个项目)。
+
+详见资源仓库中的文档。
+
+## 全栈 FastAPI + MongoDB
+
+……敬请期待,得看我有没有时间做这个项目。😅 🎉
+
+## FastAPI + spaCy 机器学习模型
+
+GitHub:https://github.com/microsoft/cookiecutter-spacy-fastapi
+
+### FastAPI + spaCy 机器学习模型 - 功能
+
+* 集成 **spaCy** NER 模型
+* 内置 **Azure 认知搜索**请求格式
+* **生产可用**的 Python 网络服务器,使用 Uvicorn 与 Gunicorn
+* 内置 **Azure DevOps** Kubernetes (AKS) CI/CD 开发
+* **多语**支持,可在项目设置时选择 spaCy 内置的语言
+* 不仅局限于 spaCy,可**轻松扩展**至其它模型框架(Pytorch、TensorFlow)
diff --git a/docs/zh/docs/python-types.md b/docs/zh/docs/python-types.md
index 6cdb4b588..214b47611 100644
--- a/docs/zh/docs/python-types.md
+++ b/docs/zh/docs/python-types.md
@@ -237,7 +237,7 @@ John Doe
## Pydantic 模型
-Pydantic 是一个用来用来执行数据校验的 Python 库。
+Pydantic 是一个用来用来执行数据校验的 Python 库。
你可以将数据的"结构"声明为具有属性的类。
@@ -254,7 +254,7 @@ John Doe
```
!!! info
- 想进一步了解 Pydantic,请阅读其文档.
+ 想进一步了解 Pydantic,请阅读其文档.
整个 **FastAPI** 建立在 Pydantic 的基础之上。
diff --git a/docs/zh/docs/tutorial/bigger-applications.md b/docs/zh/docs/tutorial/bigger-applications.md
index 138959566..422cd7c16 100644
--- a/docs/zh/docs/tutorial/bigger-applications.md
+++ b/docs/zh/docs/tutorial/bigger-applications.md
@@ -119,7 +119,7 @@
!!! tip
我们正在使用虚构的请求首部来简化此示例。
- 但在实际情况下,使用集成的[安全性实用工具](./security/index.md){.internal-link target=_blank}会得到更好的效果。
+ 但在实际情况下,使用集成的[安全性实用工具](security/index.md){.internal-link target=_blank}会得到更好的效果。
## 其他使用 `APIRouter` 的模块
diff --git a/docs/zh/docs/tutorial/body-fields.md b/docs/zh/docs/tutorial/body-fields.md
index fb6c6d9b6..6c68f1008 100644
--- a/docs/zh/docs/tutorial/body-fields.md
+++ b/docs/zh/docs/tutorial/body-fields.md
@@ -1,10 +1,10 @@
# 请求体 - 字段
-与使用 `Query`、`Path` 和 `Body` 在*路径操作函数*中声明额外的校验和元数据的方式相同,你可以使用 Pydantic 的 `Field` 在 Pydantic 模型内部声明校验和元数据。
+与在*路径操作函数*中使用 `Query`、`Path` 、`Body` 声明校验与元数据的方式一样,可以使用 Pydantic 的 `Field` 在 Pydantic 模型内部声明校验和元数据。
## 导入 `Field`
-首先,你必须导入它:
+首先,从 Pydantic 中导入 `Field`:
=== "Python 3.10+"
@@ -42,12 +42,13 @@
{!> ../../../docs_src/body_fields/tutorial001.py!}
```
-!!! warning
- 注意,`Field` 是直接从 `pydantic` 导入的,而不是像其他的(`Query`,`Path`,`Body` 等)都从 `fastapi` 导入。
+!!! warning "警告"
+
+ 注意,与从 `fastapi` 导入 `Query`,`Path`、`Body` 不同,要直接从 `pydantic` 导入 `Field` 。
## 声明模型属性
-然后,你可以对模型属性使用 `Field`:
+然后,使用 `Field` 定义模型的属性:
=== "Python 3.10+"
@@ -85,28 +86,30 @@
{!> ../../../docs_src/body_fields/tutorial001.py!}
```
-`Field` 的工作方式和 `Query`、`Path` 和 `Body` 相同,包括它们的参数等等也完全相同。
+`Field` 的工作方式和 `Query`、`Path`、`Body` 相同,参数也相同。
!!! note "技术细节"
- 实际上,`Query`、`Path` 和其他你将在之后看到的类,创建的是由一个共同的 `Params` 类派生的子类的对象,该共同类本身又是 Pydantic 的 `FieldInfo` 类的子类。
- Pydantic 的 `Field` 也会返回一个 `FieldInfo` 的实例。
+ 实际上,`Query`、`Path` 都是 `Params` 的子类,而 `Params` 类又是 Pydantic 中 `FieldInfo` 的子类。
- `Body` 也直接返回 `FieldInfo` 的一个子类的对象。还有其他一些你之后会看到的类是 `Body` 类的子类。
+ Pydantic 的 `Field` 返回也是 `FieldInfo` 的类实例。
- 请记住当你从 `fastapi` 导入 `Query`、`Path` 等对象时,他们实际上是返回特殊类的函数。
+ `Body` 直接返回的也是 `FieldInfo` 的子类的对象。后文还会介绍一些 `Body` 的子类。
-!!! tip
- 注意每个模型属性如何使用类型、默认值和 `Field` 在代码结构上和*路径操作函数*的参数是相同的,区别是用 `Field` 替换`Path`、`Query` 和 `Body`。
+ 注意,从 `fastapi` 导入的 `Query`、`Path` 等对象实际上都是返回特殊类的函数。
-## 添加额外信息
+!!! tip "提示"
-你可以在 `Field`、`Query`、`Body` 中声明额外的信息。这些信息将包含在生成的 JSON Schema 中。
+ 注意,模型属性的类型、默认值及 `Field` 的代码结构与*路径操作函数*的参数相同,只不过是用 `Field` 替换了`Path`、`Query`、`Body`。
-你将在文档的后面部分学习声明示例时,了解到更多有关添加额外信息的知识。
+## 添加更多信息
-## 总结
+`Field`、`Query`、`Body` 等对象里可以声明更多信息,并且 JSON Schema 中也会集成这些信息。
-你可以使用 Pydantic 的 `Field` 为模型属性声明额外的校验和元数据。
+*声明示例*一章中将详细介绍添加更多信息的知识。
-你还可以使用额外的关键字参数来传递额外的 JSON Schema 元数据。
+## 小结
+
+Pydantic 的 `Field` 可以为模型属性声明更多校验和元数据。
+
+传递 JSON Schema 元数据还可以使用更多关键字参数。
diff --git a/docs/zh/docs/tutorial/body-nested-models.md b/docs/zh/docs/tutorial/body-nested-models.md
index c65308bef..3f519ae33 100644
--- a/docs/zh/docs/tutorial/body-nested-models.md
+++ b/docs/zh/docs/tutorial/body-nested-models.md
@@ -182,7 +182,7 @@ Pydantic 模型的每个属性都具有类型。
除了普通的单一值类型(如 `str`、`int`、`float` 等)外,你还可以使用从 `str` 继承的更复杂的单一值类型。
-要了解所有的可用选项,请查看关于 来自 Pydantic 的外部类型 的文档。你将在下一章节中看到一些示例。
+要了解所有的可用选项,请查看关于 来自 Pydantic 的外部类型 的文档。你将在下一章节中看到一些示例。
例如,在 `Image` 模型中我们有一个 `url` 字段,我们可以把它声明为 Pydantic 的 `HttpUrl`,而不是 `str`:
diff --git a/docs/zh/docs/tutorial/body-updates.md b/docs/zh/docs/tutorial/body-updates.md
index 43f20f8fc..e529fc914 100644
--- a/docs/zh/docs/tutorial/body-updates.md
+++ b/docs/zh/docs/tutorial/body-updates.md
@@ -34,7 +34,7 @@
即,只发送要更新的数据,其余数据保持不变。
-!!! Note "笔记"
+!!! note "笔记"
`PATCH` 没有 `PUT` 知名,也怎么不常用。
diff --git a/docs/zh/docs/tutorial/body.md b/docs/zh/docs/tutorial/body.md
index 5cf53c0c2..65d459cd1 100644
--- a/docs/zh/docs/tutorial/body.md
+++ b/docs/zh/docs/tutorial/body.md
@@ -1,21 +1,24 @@
# 请求体
-当你需要将数据从客户端(例如浏览器)发送给 API 时,你将其作为「请求体」发送。
+FastAPI 使用**请求体**从客户端(例如浏览器)向 API 发送数据。
-**请求**体是客户端发送给 API 的数据。**响应**体是 API 发送给客户端的数据。
+**请求体**是客户端发送给 API 的数据。**响应体**是 API 发送给客户端的数据。
-你的 API 几乎总是要发送**响应**体。但是客户端并不总是需要发送**请求**体。
+API 基本上肯定要发送**响应体**,但是客户端不一定发送**请求体**。
-我们使用 Pydantic 模型来声明**请求**体,并能够获得它们所具有的所有能力和优点。
+使用 Pydantic 模型声明**请求体**,能充分利用它的功能和优点。
-!!! info
- 你不能使用 `GET` 操作(HTTP 方法)发送请求体。
+!!! info "说明"
- 要发送数据,你必须使用下列方法之一:`POST`(较常见)、`PUT`、`DELETE` 或 `PATCH`。
+ 发送数据使用 `POST`(最常用)、`PUT`、`DELETE`、`PATCH` 等操作。
+
+ 规范中没有定义使用 `GET` 发送请求体的操作,但不管怎样,FastAPI 也支持这种方式,只不过仅用于非常复杂或极端的用例。
+
+ 我们不建议使用 `GET`,因此,在 Swagger UI 交互文档中不会显示有关 `GET` 的内容,而且代理协议也不一定支持 `GET`。
## 导入 Pydantic 的 `BaseModel`
-首先,你需要从 `pydantic` 中导入 `BaseModel`:
+从 `pydantic` 中导入 `BaseModel`:
=== "Python 3.10+"
@@ -31,9 +34,9 @@
## 创建数据模型
-然后,将你的数据模型声明为继承自 `BaseModel` 的类。
+把数据模型声明为继承 `BaseModel` 的类。
-使用标准的 Python 类型来声明所有属性:
+使用 Python 标准类型声明所有属性:
=== "Python 3.10+"
@@ -47,9 +50,9 @@
{!> ../../../docs_src/body/tutorial001.py!}
```
-和声明查询参数时一样,当一个模型属性具有默认值时,它不是必需的。否则它是一个必需属性。将默认值设为 `None` 可使其成为可选属性。
+与声明查询参数一样,包含默认值的模型属性是可选的,否则就是必选的。默认值为 `None` 的模型属性也是可选的。
-例如,上面的模型声明了一个这样的 JSON「`object`」(或 Python `dict`):
+例如,上述模型声明如下 JSON **对象**(即 Python **字典**):
```JSON
{
@@ -60,7 +63,7 @@
}
```
-...由于 `description` 和 `tax` 是可选的(它们的默认值为 `None`),下面的 JSON「`object`」也将是有效的:
+……由于 `description` 和 `tax` 是可选的(默认值为 `None`),下面的 JSON **对象**也有效:
```JSON
{
@@ -69,9 +72,9 @@
}
```
-## 声明为参数
+## 声明请求体参数
-使用与声明路径和查询参数的相同方式声明请求体,即可将其添加到「路径操作」中:
+使用与声明路径和查询参数相同的方式声明请求体,把请求体添加至*路径操作*:
=== "Python 3.10+"
@@ -85,56 +88,68 @@
{!> ../../../docs_src/body/tutorial001.py!}
```
-...并且将它的类型声明为你创建的 `Item` 模型。
+……此处,请求体参数的类型为 `Item` 模型。
-## 结果
+## 结论
-仅仅使用了 Python 类型声明,**FastAPI** 将会:
+仅使用 Python 类型声明,**FastAPI** 就可以:
-* 将请求体作为 JSON 读取。
-* 转换为相应的类型(在需要时)。
-* 校验数据。
- * 如果数据无效,将返回一条清晰易读的错误信息,指出不正确数据的确切位置和内容。
-* 将接收的数据赋值到参数 `item` 中。
- * 由于你已经在函数中将它声明为 `Item` 类型,你还将获得对于所有属性及其类型的一切编辑器支持(代码补全等)。
-* 为你的模型生成 JSON 模式 定义,你还可以在其他任何对你的项目有意义的地方使用它们。
-* 这些模式将成为生成的 OpenAPI 模式的一部分,并且被自动化文档 UI 所使用。
+* 以 JSON 形式读取请求体
+* (在必要时)把请求体转换为对应的类型
+* 校验数据:
+ * 数据无效时返回错误信息,并指出错误数据的确切位置和内容
+* 把接收的数据赋值给参数 `item`
+ * 把函数中请求体参数的类型声明为 `Item`,还能获得代码补全等编辑器支持
+* 为模型生成 JSON Schema,在项目中所需的位置使用
+* 这些概图是 OpenAPI 概图的部件,用于 API 文档 UI
-## 自动化文档
+## API 文档
-你所定义模型的 JSON 模式将成为生成的 OpenAPI 模式的一部分,并且在交互式 API 文档中展示:
+Pydantic 模型的 JSON 概图是 OpenAPI 生成的概图部件,可在 API 文档中显示:
-
+
-而且还将在每一个需要它们的*路径操作*的 API 文档中使用:
+而且,还会用于 API 文档中使用了概图的*路径操作*:
-
+
## 编辑器支持
-在你的编辑器中,你会在函数内部的任意地方得到类型提示和代码补全(如果你接收的是一个 `dict` 而不是 Pydantic 模型,则不会发生这种情况):
+在编辑器中,函数内部均可使用类型提示、代码补全(如果接收的不是 Pydantic 模型,而是**字典**,就没有这样的支持):
-
+
-你还会获得对不正确的类型操作的错误检查:
+还支持检查错误的类型操作:
-
+
-这并非偶然,整个框架都是围绕该设计而构建。
+这并非偶然,整个 **FastAPI** 框架都是围绕这种思路精心设计的。
-并且在进行任何实现之前,已经在设计阶段经过了全面测试,以确保它可以在所有的编辑器中生效。
+并且,在 FastAPI 的设计阶段,我们就已经进行了全面测试,以确保 FastAPI 可以获得所有编辑器的支持。
-Pydantic 本身甚至也进行了一些更改以支持此功能。
+我们还改进了 Pydantic,让它也支持这些功能。
-上面的截图取自 Visual Studio Code。
+虽然上面的截图取自 Visual Studio Code。
-但是在 PyCharm 和绝大多数其他 Python 编辑器中你也会获得同样的编辑器支持:
+但 PyCharm 和大多数 Python 编辑器也支持同样的功能:
-
+
+
+!!! tip "提示"
+
+ 使用 PyCharm 编辑器时,推荐安装 Pydantic PyCharm 插件。
+
+ 该插件用于完善 PyCharm 对 Pydantic 模型的支持,优化的功能如下:
+
+ * 自动补全
+ * 类型检查
+ * 代码重构
+ * 查找
+ * 代码审查
## 使用模型
-在函数内部,你可以直接访问模型对象的所有属性:
+在*路径操作*函数内部直接访问模型对象的属性:
=== "Python 3.10+"
@@ -150,9 +165,9 @@ Pydantic 本身甚至也进行了一些更改以支持此功能。
## 请求体 + 路径参数
-你可以同时声明路径参数和请求体。
+**FastAPI** 支持同时声明路径参数和请求体。
-**FastAPI** 将识别出与路径参数匹配的函数参数应**从路径中获取**,而声明为 Pydantic 模型的函数参数应**从请求体中获取**。
+**FastAPI** 能识别与**路径参数**匹配的函数参数,还能识别从**请求体**中获取的类型为 Pydantic 模型的函数参数。
=== "Python 3.10+"
@@ -168,9 +183,9 @@ Pydantic 本身甚至也进行了一些更改以支持此功能。
## 请求体 + 路径参数 + 查询参数
-你还可以同时声明**请求体**、**路径参数**和**查询参数**。
+**FastAPI** 支持同时声明**请求体**、**路径参数**和**查询参数**。
-**FastAPI** 会识别它们中的每一个,并从正确的位置获取数据。
+**FastAPI** 能够正确识别这三种参数,并从正确的位置获取数据。
=== "Python 3.10+"
@@ -184,12 +199,18 @@ Pydantic 本身甚至也进行了一些更改以支持此功能。
{!> ../../../docs_src/body/tutorial004.py!}
```
-函数参数将依次按如下规则进行识别:
+函数参数按如下规则进行识别:
-* 如果在**路径**中也声明了该参数,它将被用作路径参数。
-* 如果参数属于**单一类型**(比如 `int`、`float`、`str`、`bool` 等)它将被解释为**查询**参数。
-* 如果参数的类型被声明为一个 **Pydantic 模型**,它将被解释为**请求体**。
+- **路径**中声明了相同参数的参数,是路径参数
+- 类型是(`int`、`float`、`str`、`bool` 等)**单类型**的参数,是**查询**参数
+- 类型是 **Pydantic 模型**的参数,是**请求体**
+
+!!! note "笔记"
+
+ 因为默认值是 `None`, FastAPI 会把 `q` 当作可选参数。
+
+ FastAPI 不使用 `Optional[str]` 中的 `Optional`, 但 `Optional` 可以让编辑器提供更好的支持,并检测错误。
## 不使用 Pydantic
-如果你不想使用 Pydantic 模型,你还可以使用 **Body** 参数。请参阅文档 [请求体 - 多个参数:请求体中的单一值](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}。
+即便不使用 Pydantic 模型也能使用 **Body** 参数。详见[请求体 - 多参数:请求体中的单值](body-multiple-params.md#_2){.internal-link target=\_blank}。
diff --git a/docs/zh/docs/tutorial/cookie-params.md b/docs/zh/docs/tutorial/cookie-params.md
index f115f9677..8571422dd 100644
--- a/docs/zh/docs/tutorial/cookie-params.md
+++ b/docs/zh/docs/tutorial/cookie-params.md
@@ -1,10 +1,10 @@
# Cookie 参数
-你可以像定义 `Query` 参数和 `Path` 参数一样来定义 `Cookie` 参数。
+ 定义 `Cookie` 参数与定义 `Query` 和 `Path` 参数一样。
## 导入 `Cookie`
-首先,导入 `Cookie`:
+首先,导入 `Cookie`:
=== "Python 3.10+"
@@ -44,9 +44,9 @@
## 声明 `Cookie` 参数
-声明 `Cookie` 参数的结构与声明 `Query` 参数和 `Path` 参数时相同。
+声明 `Cookie` 参数的方式与声明 `Query` 和 `Path` 参数相同。
-第一个值是参数的默认值,同时也可以传递所有验证参数或注释参数,来校验参数:
+第一个值是默认值,还可以传递所有验证参数或注释参数:
=== "Python 3.10+"
@@ -86,13 +86,15 @@
```
!!! note "技术细节"
- `Cookie` 、`Path` 、`Query`是兄弟类,它们都继承自公共的 `Param` 类
- 但请记住,当你从 `fastapi` 导入的 `Query`、`Path`、`Cookie` 或其他参数声明函数,这些实际上是返回特殊类的函数。
+ `Cookie` 、`Path` 、`Query` 是**兄弟类**,都继承自共用的 `Param` 类。
-!!! info
- 你需要使用 `Cookie` 来声明 cookie 参数,否则参数将会被解释为查询参数。
+ 注意,从 `fastapi` 导入的 `Query`、`Path`、`Cookie` 等对象,实际上是返回特殊类的函数。
-## 总结
+!!! info "说明"
-使用 `Cookie` 声明 cookie 参数,使用方式与 `Query` 和 `Path` 类似。
+ 必须使用 `Cookie` 声明 cookie 参数,否则该参数会被解释为查询参数。
+
+## 小结
+
+使用 `Cookie` 声明 cookie 参数的方式与 `Query` 和 `Path` 相同。
diff --git a/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md
new file mode 100644
index 000000000..4159d626e
--- /dev/null
+++ b/docs/zh/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -0,0 +1,253 @@
+# 使用yield的依赖项
+
+FastAPI支持在完成后执行一些额外步骤的依赖项.
+
+为此,请使用 `yield` 而不是 `return`,然后再编写额外的步骤(代码)。
+
+!!! tip "提示"
+ 确保只使用一次 `yield` 。
+
+!!! note "技术细节"
+
+ 任何一个可以与以下内容一起使用的函数:
+
+ * `@contextlib.contextmanager` 或者
+ * `@contextlib.asynccontextmanager`
+
+ 都可以作为 **FastAPI** 的依赖项。
+
+ 实际上,FastAPI内部就使用了这两个装饰器。
+
+
+## 使用 `yield` 的数据库依赖项
+
+例如,您可以使用这种方式创建一个数据库会话,并在完成后关闭它。
+
+在发送响应之前,只会执行 `yield` 语句及之前的代码:
+
+```Python hl_lines="2-4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+生成的值会注入到*路径操作*和其他依赖项中:
+
+```Python hl_lines="4"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+"yield"语句后面的代码会在发送响应后执行::
+
+```Python hl_lines="5-6"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+
+!!! tip "提示"
+
+ 您可以使用 `async` 或普通函数。
+
+ **FastAPI** 会像处理普通依赖关系一样,对每个依赖关系做正确的处理。
+
+## 同时包含了 `yield` 和 `try` 的依赖项
+
+如果在带有 `yield` 的依赖关系中使用 `try` 代码块,就会收到使用依赖关系时抛出的任何异常。
+
+例如,如果中间某个代码在另一个依赖中或在*路径操作*中使数据库事务 "回滚 "或产生任何其他错误,您就会在依赖中收到异常。
+
+因此,你可以使用 `except SomeException` 在依赖关系中查找特定的异常。
+
+同样,您也可以使用 `finally` 来确保退出步骤得到执行,无论是否存在异常。
+
+```Python hl_lines="3 5"
+{!../../../docs_src/dependencies/tutorial007.py!}
+```
+## 使用`yield`的子依赖项
+
+你可以拥有任意大小和形状的子依赖和子依赖的“树”,而且它们中的任何一个或所有的都可以使用`yield`。
+
+**FastAPI** 会确保每个带有`yield`的依赖中的“退出代码”按正确顺序运行。
+
+例如,`dependency_c` 可以依赖于 `dependency_b`,而 `dependency_b` 则依赖于 `dependency_a`。
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="6 14 22"
+ {!> ../../../docs_src/dependencies/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="5 13 21"
+ {!> ../../../docs_src/dependencies/tutorial008_an.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ 如果可能,请尽量使用“ Annotated”版本。
+
+ ```Python hl_lines="4 12 20"
+ {!> ../../../docs_src/dependencies/tutorial008.py!}
+ ```
+
+所有这些依赖都可以使用`yield`。
+
+在这种情况下,`dependency_c` 在执行其退出代码时需要`dependency_b`(此处称为 `dep_b`)的值仍然可用。
+
+而`dependency_b` 反过来则需要`dependency_a`(此处称为 `dep_a`)的值在其退出代码中可用。
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="18-19 26-27"
+ {!> ../../../docs_src/dependencies/tutorial008_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="17-18 25-26"
+ {!> ../../../docs_src/dependencies/tutorial008_an.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ 如果可能,请尽量使用“ Annotated”版本。
+
+ ```Python hl_lines="16-17 24-25"
+ {!> ../../../docs_src/dependencies/tutorial008.py!}
+ ```
+
+同样,你可以有混合了`yield`和`return`的依赖。
+
+你也可以有一个单一的依赖需要多个其他带有`yield`的依赖,等等。
+
+你可以拥有任何你想要的依赖组合。
+
+**FastAPI** 将确保按正确的顺序运行所有内容。
+
+!!! note "技术细节"
+
+ 这是由 Python 的上下文管理器完成的。
+
+ **FastAPI** 在内部使用它们来实现这一点。
+
+
+## 使用 `yield` 和 `HTTPException` 的依赖项
+
+您看到可以使用带有 `yield` 的依赖项,并且具有捕获异常的 `try` 块。
+
+在 `yield` 后抛出 `HTTPException` 或类似的异常是很诱人的,但是**这不起作用**。
+
+带有`yield`的依赖中的退出代码在响应发送之后执行,因此[异常处理程序](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}已经运行过。没有任何东西可以捕获退出代码(在`yield`之后)中的依赖抛出的异常。
+
+所以,如果在`yield`之后抛出`HTTPException`,默认(或任何自定义)异常处理程序捕获`HTTPException`并返回HTTP 400响应的机制将不再能够捕获该异常。
+
+这就是允许在依赖中设置的任何东西(例如数据库会话(DB session))可以被后台任务使用的原因。
+
+后台任务在响应发送之后运行。因此,无法触发`HTTPException`,因为甚至没有办法更改*已发送*的响应。
+
+但如果后台任务产生了数据库错误,至少你可以在带有`yield`的依赖中回滚或清理关闭会话,并且可能记录错误或将其报告给远程跟踪系统。
+
+如果你知道某些代码可能会引发异常,那就做最“Pythonic”的事情,就是在代码的那部分添加一个`try`块。
+
+如果你有自定义异常,希望在返回响应之前处理,并且可能修改响应甚至触发`HTTPException`,可以创建[自定义异常处理程序](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}。
+
+!!! tip
+
+ 在`yield`之前仍然可以引发包括`HTTPException`在内的异常,但在`yield`之后则不行。
+
+执行的顺序大致如下图所示。时间从上到下流动。每列都是相互交互或执行代码的其中一部分。
+
+```mermaid
+sequenceDiagram
+
+participant client as Client
+participant handler as Exception handler
+participant dep as Dep with yield
+participant operation as Path Operation
+participant tasks as Background tasks
+
+ Note over client,tasks: Can raise exception for dependency, handled after response is sent
+ Note over client,operation: Can raise HTTPException and can change the response
+ client ->> dep: Start request
+ Note over dep: Run code up to yield
+ opt raise
+ dep -->> handler: Raise HTTPException
+ handler -->> client: HTTP error response
+ dep -->> dep: Raise other exception
+ end
+ dep ->> operation: Run dependency, e.g. DB session
+ opt raise
+ operation -->> dep: Raise HTTPException
+ dep -->> handler: Auto forward exception
+ handler -->> client: HTTP error response
+ operation -->> dep: Raise other exception
+ dep -->> handler: Auto forward exception
+ end
+ operation ->> client: Return response to client
+ Note over client,operation: Response is already sent, can't change it anymore
+ opt Tasks
+ operation -->> tasks: Send background tasks
+ end
+ opt Raise other exception
+ tasks -->> dep: Raise other exception
+ end
+ Note over dep: After yield
+ opt Handle other exception
+ dep -->> dep: Handle exception, can't change response. E.g. close DB session.
+ end
+```
+
+!!! info
+ 只会向客户端发送**一次响应**,可能是一个错误响应之一,也可能是来自*路径操作*的响应。
+
+ 在发送了其中一个响应之后,就无法再发送其他响应了。
+
+!!! tip
+ 这个图表展示了`HTTPException`,但你也可以引发任何其他你创建了[自定义异常处理程序](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}的异常。
+
+ 如果你引发任何异常,它将传递给带有`yield`的依赖,包括`HTTPException`,然后**再次**传递给异常处理程序。如果没有针对该异常的异常处理程序,那么它将被默认的内部`ServerErrorMiddleware`处理,返回500 HTTP状态码,告知客户端服务器发生了错误。
+
+## 上下文管理器
+
+### 什么是“上下文管理器”
+
+“上下文管理器”是您可以在`with`语句中使用的任何Python对象。
+
+例如,您可以使用`with`读取文件:
+
+```Python
+with open("./somefile.txt") as f:
+ contents = f.read()
+ print(contents)
+```
+
+在底层,`open("./somefile.txt")`创建了一个被称为“上下文管理器”的对象。
+
+当`with`块结束时,它会确保关闭文件,即使发生了异常也是如此。
+
+当你使用`yield`创建一个依赖项时,**FastAPI**会在内部将其转换为上下文管理器,并与其他相关工具结合使用。
+
+### 在依赖项中使用带有`yield`的上下文管理器
+
+!!! warning
+ 这是一个更为“高级”的想法。
+
+ 如果您刚开始使用**FastAPI**,您可能暂时可以跳过它。
+
+在Python中,你可以通过创建一个带有`__enter__()`和`__exit__()`方法的类来创建上下文管理器。
+
+你也可以在**FastAPI**的依赖项中使用带有`yield`的`with`或`async with`语句,通过在依赖函数内部使用它们。
+
+```Python hl_lines="1-9 13"
+{!../../../docs_src/dependencies/tutorial010.py!}
+```
+
+!!! tip
+ 另一种创建上下文管理器的方法是:
+
+ * `@contextlib.contextmanager`或者
+ * `@contextlib.asynccontextmanager`
+
+ 使用上下文管理器装饰一个只有单个`yield`的函数。这就是**FastAPI**在内部用于带有`yield`的依赖项的方式。
+
+ 但是你不需要为FastAPI的依赖项使用这些装饰器(而且也不应该)。FastAPI会在内部为你处理这些。
diff --git a/docs/zh/docs/tutorial/extra-data-types.md b/docs/zh/docs/tutorial/extra-data-types.md
index f4a77050c..cf39de0dd 100644
--- a/docs/zh/docs/tutorial/extra-data-types.md
+++ b/docs/zh/docs/tutorial/extra-data-types.md
@@ -36,7 +36,7 @@
* `datetime.timedelta`:
* 一个 Python `datetime.timedelta`.
* 在请求和响应中将表示为 `float` 代表总秒数。
- * Pydantic 也允许将其表示为 "ISO 8601 时间差异编码", 查看文档了解更多信息。
+ * Pydantic 也允许将其表示为 "ISO 8601 时间差异编码", 查看文档了解更多信息。
* `frozenset`:
* 在请求和响应中,作为 `set` 对待:
* 在请求中,列表将被读取,消除重复,并将其转换为一个 `set`。
@@ -49,7 +49,7 @@
* `Decimal`:
* 标准的 Python `Decimal`。
* 在请求和响应中被当做 `float` 一样处理。
-* 您可以在这里检查所有有效的pydantic数据类型: Pydantic data types.
+* 您可以在这里检查所有有效的pydantic数据类型: Pydantic data types.
## 例子
diff --git a/docs/zh/docs/tutorial/extra-models.md b/docs/zh/docs/tutorial/extra-models.md
index 06427a73d..94d82c524 100644
--- a/docs/zh/docs/tutorial/extra-models.md
+++ b/docs/zh/docs/tutorial/extra-models.md
@@ -1,21 +1,22 @@
-# 额外的模型
+# 更多模型
-我们从前面的示例继续,拥有多个相关的模型是很常见的。
+书接上文,多个关联模型这种情况很常见。
-对用户模型来说尤其如此,因为:
+特别是用户模型,因为:
-* **输入模型**需要拥有密码属性。
-* **输出模型**不应该包含密码。
-* **数据库模型**很可能需要保存密码的哈希值。
+* **输入模型**应该含密码
+* **输出模型**不应含密码
+* **数据库模型**需要加密的密码
-!!! danger
- 永远不要存储用户的明文密码。始终存储一个可以用于验证的「安全哈希值」。
+!!! danger "危险"
- 如果你尚未了解该知识,你可以在[安全章节](security/simple-oauth2.md#password-hashing){.internal-link target=_blank}中学习何为「密码哈希值」。
+ 千万不要存储用户的明文密码。始终存储可以进行验证的**安全哈希值**。
+
+ 如果不了解这方面的知识,请参阅[安全性中的章节](security/simple-oauth2.md#password-hashing){.internal-link target=_blank},了解什么是**密码哈希**。
## 多个模型
-下面是应该如何根据它们的密码字段以及使用位置去定义模型的大概思路:
+下面的代码展示了不同模型处理密码字段的方式,及使用位置的大致思路:
=== "Python 3.10+"
@@ -29,35 +30,35 @@
{!> ../../../docs_src/extra_models/tutorial001.py!}
```
-### 关于 `**user_in.dict()`
+### `**user_in.dict()` 简介
#### Pydantic 的 `.dict()`
-`user_in` 是一个 `UserIn` 类的 Pydantic 模型.
+`user_in` 是类 `UserIn` 的 Pydantic 模型。
-Pydantic 模型具有 `.dict()` 方法,该方法返回一个拥有模型数据的 `dict`。
+Pydantic 模型支持 `.dict()` 方法,能返回包含模型数据的**字典**。
-因此,如果我们像下面这样创建一个 Pydantic 对象 `user_in`:
+因此,如果使用如下方式创建 Pydantic 对象 `user_in`:
```Python
user_in = UserIn(username="john", password="secret", email="john.doe@example.com")
```
-然后我们调用:
+就能以如下方式调用:
```Python
user_dict = user_in.dict()
```
-现在我们有了一个数据位于变量 `user_dict` 中的 `dict`(它是一个 `dict` 而不是 Pydantic 模型对象)。
+现在,变量 `user_dict`中的就是包含数据的**字典**(变量 `user_dict` 是字典,不是 Pydantic 模型对象)。
-如果我们调用:
+以如下方式调用:
```Python
print(user_dict)
```
-我们将获得一个这样的 Python `dict`:
+输出的就是 Python **字典**:
```Python
{
@@ -70,15 +71,15 @@ print(user_dict)
#### 解包 `dict`
-如果我们将 `user_dict` 这样的 `dict` 以 `**user_dict` 形式传递给一个函数(或类),Python将对其进行「解包」。它会将 `user_dict` 的键和值作为关键字参数直接传递。
+把**字典** `user_dict` 以 `**user_dict` 形式传递给函数(或类),Python 会执行**解包**操作。它会把 `user_dict` 的键和值作为关键字参数直接传递。
-因此,从上面的 `user_dict` 继续,编写:
+因此,接着上面的 `user_dict` 继续编写如下代码:
```Python
UserInDB(**user_dict)
```
-会产生类似于以下的结果:
+就会生成如下结果:
```Python
UserInDB(
@@ -89,7 +90,7 @@ UserInDB(
)
```
-或者更确切地,直接使用 `user_dict` 来表示将来可能包含的任何内容:
+或更精准,直接把可能会用到的内容与 `user_dict` 一起使用:
```Python
UserInDB(
@@ -100,34 +101,34 @@ UserInDB(
)
```
-#### 来自于其他模型内容的 Pydantic 模型
+#### 用其它模型中的内容生成 Pydantic 模型
-如上例所示,我们从 `user_in.dict()` 中获得了 `user_dict`,此代码:
+上例中 ,从 `user_in.dict()` 中得到了 `user_dict`,下面的代码:
```Python
user_dict = user_in.dict()
UserInDB(**user_dict)
```
-等同于:
+等效于:
```Python
UserInDB(**user_in.dict())
```
-...因为 `user_in.dict()` 是一个 `dict`,然后我们通过以`**`开头传递给 `UserInDB` 来使 Python「解包」它。
+……因为 `user_in.dict()` 是字典,在传递给 `UserInDB` 时,把 `**` 加在 `user_in.dict()` 前,可以让 Python 进行**解包**。
-这样,我们获得了一个来自于其他 Pydantic 模型中的数据的 Pydantic 模型。
+这样,就可以用其它 Pydantic 模型中的数据生成 Pydantic 模型。
-#### 解包 `dict` 和额外关键字
+#### 解包 `dict` 和更多关键字
-然后添加额外的关键字参数 `hashed_password=hashed_password`,例如:
+接下来,继续添加关键字参数 `hashed_password=hashed_password`,例如:
```Python
UserInDB(**user_in.dict(), hashed_password=hashed_password)
```
-...最终的结果如下:
+……输出结果如下:
```Python
UserInDB(
@@ -139,24 +140,27 @@ UserInDB(
)
```
-!!! warning
- 辅助性的额外函数只是为了演示可能的数据流,但它们显然不能提供任何真正的安全性。
+!!! warning "警告"
+
+ 辅助的附加函数只是为了演示可能的数据流,但它们显然不能提供任何真正的安全机制。
## 减少重复
-减少代码重复是 **FastAPI** 的核心思想之一。
+**FastAPI** 的核心思想就是减少代码重复。
-因为代码重复会增加出现 bug、安全性问题、代码失步问题(当你在一个位置更新了代码但没有在其他位置更新)等的可能性。
+代码重复会导致 bug、安全问题、代码失步等问题(更新了某个位置的代码,但没有同步更新其它位置的代码)。
-上面的这些模型都共享了大量数据,并拥有重复的属性名称和类型。
+上面的这些模型共享了大量数据,拥有重复的属性名和类型。
-我们可以做得更好。
+FastAPI 可以做得更好。
-我们可以声明一个 `UserBase` 模型作为其他模型的基类。然后我们可以创建继承该模型属性(类型声明,校验等)的子类。
+声明 `UserBase` 模型作为其它模型的基类。然后,用该类衍生出继承其属性(类型声明、验证等)的子类。
-所有的数据转换、校验、文档生成等仍将正常运行。
+所有数据转换、校验、文档等功能仍将正常运行。
-这样,我们可以仅声明模型之间的差异部分(具有明文的 `password`、具有 `hashed_password` 以及不包括密码)。
+这样,就可以仅声明模型之间的差异部分(具有明文的 `password`、具有 `hashed_password` 以及不包括密码)。
+
+通过这种方式,可以只声明模型之间的区别(分别包含明文密码、哈希密码,以及无密码的模型)。
=== "Python 3.10+"
@@ -172,15 +176,15 @@ UserInDB(
## `Union` 或者 `anyOf`
-你可以将一个响应声明为两种类型的 `Union`,这意味着该响应将是两种类型中的任何一种。
+响应可以声明为两种类型的 `Union` 类型,即该响应可以是两种类型中的任意类型。
-这将在 OpenAPI 中使用 `anyOf` 进行定义。
+在 OpenAPI 中可以使用 `anyOf` 定义。
-为此,请使用标准的 Python 类型提示 `typing.Union`:
+为此,请使用 Python 标准类型提示 `typing.Union`:
+!!! note "笔记"
-!!! note
- 定义一个 `Union` 类型时,首先包括最详细的类型,然后是不太详细的类型。在下面的示例中,更详细的 `PlaneItem` 位于 `Union[PlaneItem,CarItem]` 中的 `CarItem` 之前。
+ 定义 `Union` 类型时,要把详细的类型写在前面,然后是不太详细的类型。下例中,更详细的 `PlaneItem` 位于 `Union[PlaneItem,CarItem]` 中的 `CarItem` 之前。
=== "Python 3.10+"
@@ -196,7 +200,7 @@ UserInDB(
## 模型列表
-你可以用同样的方式声明由对象列表构成的响应。
+使用同样的方式也可以声明由对象列表构成的响应。
为此,请使用标准的 Python `typing.List`:
@@ -214,11 +218,11 @@ UserInDB(
## 任意 `dict` 构成的响应
-你还可以使用一个任意的普通 `dict` 声明响应,仅声明键和值的类型,而不使用 Pydantic 模型。
+任意的 `dict` 都能用于声明响应,只要声明键和值的类型,无需使用 Pydantic 模型。
-如果你事先不知道有效的字段/属性名称(对于 Pydantic 模型是必需的),这将很有用。
+事先不知道可用的字段 / 属性名时(Pydantic 模型必须知道字段是什么),这种方式特别有用。
-在这种情况下,你可以使用 `typing.Dict`:
+此时,可以使用 `typing.Dict`:
=== "Python 3.9+"
@@ -232,8 +236,8 @@ UserInDB(
{!> ../../../docs_src/extra_models/tutorial005.py!}
```
-## 总结
+## 小结
-使用多个 Pydantic 模型,并针对不同场景自由地继承。
+针对不同场景,可以随意使用不同的 Pydantic 模型继承定义的基类。
-如果一个实体必须能够具有不同的「状态」,你无需为每个状态的实体定义单独的数据模型。以用户「实体」为例,其状态有包含 `password`、包含 `password_hash` 以及不含密码。
+实体必须具有不同的**状态**时,不必为不同状态的实体单独定义数据模型。例如,用户**实体**就有包含 `password`、包含 `password_hash` 以及不含密码等多种状态。
diff --git a/docs/zh/docs/tutorial/handling-errors.md b/docs/zh/docs/tutorial/handling-errors.md
index a0d66e557..701cd241e 100644
--- a/docs/zh/docs/tutorial/handling-errors.md
+++ b/docs/zh/docs/tutorial/handling-errors.md
@@ -179,7 +179,7 @@ path -> item_id
如果您觉得现在还用不到以下技术细节,可以先跳过下面的内容。
-`RequestValidationError` 是 Pydantic 的 `ValidationError` 的子类。
+`RequestValidationError` 是 Pydantic 的 `ValidationError` 的子类。
**FastAPI** 调用的就是 `RequestValidationError` 类,因此,如果在 `response_model` 中使用 Pydantic 模型,且数据有错误时,在日志中就会看到这个错误。
diff --git a/docs/zh/docs/tutorial/header-params.md b/docs/zh/docs/tutorial/header-params.md
index 2701167b3..25dfeba87 100644
--- a/docs/zh/docs/tutorial/header-params.md
+++ b/docs/zh/docs/tutorial/header-params.md
@@ -1,10 +1,10 @@
# Header 参数
-你可以使用定义 `Query`, `Path` 和 `Cookie` 参数一样的方法定义 Header 参数。
+定义 `Header` 参数的方式与定义 `Query`、`Path`、`Cookie` 参数相同。
## 导入 `Header`
-首先导入 `Header`:
+首先,导入 `Header`:
=== "Python 3.10+"
@@ -44,9 +44,9 @@
## 声明 `Header` 参数
-然后使用和`Path`, `Query` and `Cookie` 一样的结构定义 header 参数
+然后,使用和 `Path`、`Query`、`Cookie` 一样的结构定义 header 参数。
-第一个值是默认值,你可以传递所有的额外验证或注释参数:
+第一个值是默认值,还可以传递所有验证参数或注释参数:
=== "Python 3.10+"
@@ -85,28 +85,30 @@
```
!!! note "技术细节"
- `Header` 是 `Path`, `Query` 和 `Cookie` 的兄弟类型。它也继承自通用的 `Param` 类.
- 但是请记得,当你从`fastapi`导入 `Query`, `Path`, `Header`, 或其他时,实际上导入的是返回特定类型的函数。
+ `Header` 是 `Path`、`Query`、`Cookie` 的**兄弟类**,都继承自共用的 `Param` 类。
-!!! info
- 为了声明headers, 你需要使用`Header`, 因为否则参数将被解释为查询参数。
+ 注意,从 `fastapi` 导入的 `Query`、`Path`、`Header` 等对象,实际上是返回特殊类的函数。
+
+!!! info "说明"
+
+ 必须使用 `Header` 声明 header 参数,否则该参数会被解释为查询参数。
## 自动转换
-`Header` 在 `Path`, `Query` 和 `Cookie` 提供的功能之上有一点额外的功能。
+`Header` 比 `Path`、`Query` 和 `Cookie` 提供了更多功能。
-大多数标准的headers用 "连字符" 分隔,也称为 "减号" (`-`)。
+大部分标准请求头用**连字符**分隔,即**减号**(`-`)。
-但是像 `user-agent` 这样的变量在Python中是无效的。
+但是 `user-agent` 这样的变量在 Python 中是无效的。
-因此, 默认情况下, `Header` 将把参数名称的字符从下划线 (`_`) 转换为连字符 (`-`) 来提取并记录 headers.
+因此,默认情况下,`Header` 把参数名中的字符由下划线(`_`)改为连字符(`-`)来提取并存档请求头 。
-同时,HTTP headers 是大小写不敏感的,因此,因此可以使用标准Python样式(也称为 "snake_case")声明它们。
+同时,HTTP 的请求头不区分大小写,可以使用 Python 标准样式(即 **snake_case**)进行声明。
-因此,您可以像通常在Python代码中那样使用 `user_agent` ,而不需要将首字母大写为 `User_Agent` 或类似的东西。
+因此,可以像在 Python 代码中一样使用 `user_agent` ,无需把首字母大写为 `User_Agent` 等形式。
-如果出于某些原因,你需要禁用下划线到连字符的自动转换,设置`Header`的参数 `convert_underscores` 为 `False`:
+如需禁用下划线自动转换为连字符,可以把 `Header` 的 `convert_underscores` 参数设置为 `False`:
=== "Python 3.10+"
@@ -144,19 +146,20 @@
{!> ../../../docs_src/header_params/tutorial002.py!}
```
-!!! warning
- 在设置 `convert_underscores` 为 `False` 之前,请记住,一些HTTP代理和服务器不允许使用带有下划线的headers。
+!!! warning "警告"
+
+ 注意,使用 `convert_underscores = False` 要慎重,有些 HTTP 代理和服务器不支持使用带有下划线的请求头。
-## 重复的 headers
+## 重复的请求头
-有可能收到重复的headers。这意味着,相同的header具有多个值。
+有时,可能需要接收重复的请求头。即同一个请求头有多个值。
-您可以在类型声明中使用一个list来定义这些情况。
+类型声明中可以使用 `list` 定义多个请求头。
-你可以通过一个Python `list` 的形式获得重复header的所有值。
+使用 Python `list` 可以接收重复请求头所有的值。
-比如, 为了声明一个 `X-Token` header 可以出现多次,你可以这样写:
+例如,声明 `X-Token` 多次出现的请求头,可以写成这样:
=== "Python 3.10+"
@@ -203,14 +206,14 @@
{!> ../../../docs_src/header_params/tutorial003.py!}
```
-如果你与*路径操作*通信时发送两个HTTP headers,就像:
+与*路径操作*通信时,以下面的方式发送两个 HTTP 请求头:
```
X-Token: foo
X-Token: bar
```
-响应会是:
+响应结果是:
```JSON
{
@@ -221,8 +224,8 @@ X-Token: bar
}
```
-## 回顾
+## 小结
-使用 `Header` 来声明 header , 使用和 `Query`, `Path` 与 `Cookie` 相同的模式。
+使用 `Header` 声明请求头的方式与 `Query`、`Path` 、`Cookie` 相同。
-不用担心变量中的下划线,**FastAPI** 会负责转换它们。
+不用担心变量中的下划线,**FastAPI** 可以自动转换。
diff --git a/docs/zh/docs/tutorial/metadata.md b/docs/zh/docs/tutorial/metadata.md
index 3e669bc72..59a4af86e 100644
--- a/docs/zh/docs/tutorial/metadata.md
+++ b/docs/zh/docs/tutorial/metadata.md
@@ -1,40 +1,36 @@
# 元数据和文档 URL
-你可以在 **FastAPI** 应用中自定义几个元数据配置。
+你可以在 FastAPI 应用程序中自定义多个元数据配置。
-## 标题、描述和版本
+## API 元数据
-你可以设定:
+你可以在设置 OpenAPI 规范和自动 API 文档 UI 中使用的以下字段:
-* **Title**:在 OpenAPI 和自动 API 文档用户界面中作为 API 的标题/名称使用。
-* **Description**:在 OpenAPI 和自动 API 文档用户界面中用作 API 的描述。
-* **Version**:API 版本,例如 `v2` 或者 `2.5.0`。
- * 如果你之前的应用程序版本也使用 OpenAPI 会很有用。
+| 参数 | 类型 | 描述 |
+|------------|------|-------------|
+| `title` | `str` | API 的标题。 |
+| `summary` | `str` | API 的简短摘要。 自 OpenAPI 3.1.0、FastAPI 0.99.0 起可用。. |
+| `description` | `str` | API 的简短描述。可以使用Markdown。 |
+| `version` | `string` | API 的版本。这是您自己的应用程序的版本,而不是 OpenAPI 的版本。例如 `2.5.0` 。 |
+| `terms_of_service` | `str` | API 服务条款的 URL。如果提供,则必须是 URL。 |
+| `contact` | `dict` | 公开的 API 的联系信息。它可以包含多个字段。contact 字段| 参数 | Type | 描述 |
|---|---|---|
name | str | 联系人/组织的识别名称。 |
url | str | 指向联系信息的 URL。必须采用 URL 格式。 |
email | str | 联系人/组织的电子邮件地址。必须采用电子邮件地址的格式。 |
license_info 字段| 参数 | 类型 | 描述 |
|---|---|---|
name | str | 必须的 (如果设置了license_info). 用于 API 的许可证名称。 |
identifier | str | 一个API的SPDX许可证表达。 The identifier field is mutually exclusive of the url field. 自 OpenAPI 3.1.0、FastAPI 0.99.0 起可用。 |
url | str | 用于 API 的许可证的 URL。必须采用 URL 格式。 |
## 标签元数据
-你也可以使用参数 `openapi_tags`,为用于分组路径操作的不同标签添加额外的元数据。
-
-它接受一个列表,这个列表包含每个标签对应的一个字典。
-
-每个字典可以包含:
-
-* `name`(**必要**):一个 `str`,它与*路径操作*和 `APIRouter` 中使用的 `tags` 参数有相同的标签名。
-* `description`:一个用于简短描述标签的 `str`。它支持 Markdown 并且会在文档用户界面中显示。
-* `externalDocs`:一个描述外部文档的 `dict`:
- * `description`:用于简短描述外部文档的 `str`。
- * `url`(**必要**):外部文档的 URL `str`。
-
### 创建标签元数据
让我们在带有标签的示例中为 `users` 和 `items` 试一下。
@@ -47,7 +43,7 @@
注意你可以在描述内使用 Markdown,例如「login」会显示为粗体(**login**)以及「fancy」会显示为斜体(_fancy_)。
-!!! 提示
+!!! tip "提示"
不必为你使用的所有标签都添加元数据。
### 使用你的标签
@@ -58,8 +54,8 @@
{!../../../docs_src/metadata/tutorial004.py!}
```
-!!! 信息
- 阅读更多关于标签的信息[路径操作配置](../path-operation-configuration/#tags){.internal-link target=_blank}。
+!!! info "信息"
+ 阅读更多关于标签的信息[路径操作配置](path-operation-configuration.md#tags){.internal-link target=_blank}。
### 查看文档
diff --git a/docs/zh/docs/tutorial/path-params.md b/docs/zh/docs/tutorial/path-params.md
index 1b428d662..12a08b4a3 100644
--- a/docs/zh/docs/tutorial/path-params.md
+++ b/docs/zh/docs/tutorial/path-params.md
@@ -1,48 +1,50 @@
# 路径参数
-你可以使用与 Python 格式化字符串相同的语法来声明路径"参数"或"变量":
+FastAPI 支持使用 Python 字符串格式化语法声明**路径参数**(**变量**):
```Python hl_lines="6-7"
{!../../../docs_src/path_params/tutorial001.py!}
```
-路径参数 `item_id` 的值将作为参数 `item_id` 传递给你的函数。
+这段代码把路径参数 `item_id` 的值传递给路径函数的参数 `item_id`。
-所以,如果你运行示例并访问 http://127.0.0.1:8000/items/foo,将会看到如下响应:
+运行示例并访问 http://127.0.0.1:8000/items/foo,可获得如下响应:
```JSON
{"item_id":"foo"}
```
-## 有类型的路径参数
+## 声明路径参数的类型
-你可以使用标准的 Python 类型标注为函数中的路径参数声明类型。
+使用 Python 标准类型注解,声明路径操作函数中路径参数的类型。
```Python hl_lines="7"
{!../../../docs_src/path_params/tutorial002.py!}
```
-在这个例子中,`item_id` 被声明为 `int` 类型。
+本例把 `item_id` 的类型声明为 `int`。
-!!! check
- 这将为你的函数提供编辑器支持,包括错误检查、代码补全等等。
+!!! check "检查"
-## 数据转换
+ 类型声明将为函数提供错误检查、代码补全等编辑器支持。
-如果你运行示例并打开浏览器访问 http://127.0.0.1:8000/items/3,将得到如下响应:
+## 数据转换
+
+运行示例并访问 http://127.0.0.1:8000/items/3,返回的响应如下:
```JSON
{"item_id":3}
```
-!!! check
- 注意函数接收(并返回)的值为 3,是一个 Python `int` 值,而不是字符串 `"3"`。
+!!! check "检查"
- 所以,**FastAPI** 通过上面的类型声明提供了对请求的自动"解析"。
+ 注意,函数接收并返回的值是 `3`( `int`),不是 `"3"`(`str`)。
+
+ **FastAPI** 通过类型声明自动**解析**请求中的数据。
## 数据校验
-但如果你通过浏览器访问 http://127.0.0.1:8000/items/foo,你会看到一个清晰可读的 HTTP 错误:
+通过浏览器访问 http://127.0.0.1:8000/items/foo,接收如下 HTTP 错误信息:
```JSON
{
@@ -59,86 +61,91 @@
}
```
-因为路径参数 `item_id` 传入的值为 `"foo"`,它不是一个 `int`。
+这是因为路径参数 `item_id` 的值 (`"foo"`)的类型不是 `int`。
-如果你提供的是 `float` 而非整数也会出现同样的错误,比如: http://127.0.0.1:8000/items/4.2
+值的类型不是 `int ` 而是浮点数(`float`)时也会显示同样的错误,比如: http://127.0.0.1:8000/items/4.2。
-!!! check
- 所以,通过同样的 Python 类型声明,**FastAPI** 提供了数据校验功能。
+!!! check "检查"
- 注意上面的错误同样清楚地指出了校验未通过的具体原因。
+ **FastAPI** 使用 Python 类型声明实现了数据校验。
- 在开发和调试与你的 API 进行交互的代码时,这非常有用。
+ 注意,上面的错误清晰地指出了未通过校验的具体原因。
-## 文档
+ 这在开发调试与 API 交互的代码时非常有用。
-当你打开浏览器访问 http://127.0.0.1:8000/docs,你将看到自动生成的交互式 API 文档:
+## 查看文档
-
+访问 http://127.0.0.1:8000/docs,查看自动生成的 API 文档:
-!!! check
- 再一次,还是通过相同的 Python 类型声明,**FastAPI** 为你提供了自动生成的交互式文档(集成 Swagger UI)。
+
- 注意这里的路径参数被声明为一个整数。
+!!! check "检查"
-## 基于标准的好处:可选文档
+ 还是使用 Python 类型声明,**FastAPI** 提供了(集成 Swagger UI 的)API 文档。
-由于生成的 API 模式来自于 OpenAPI 标准,所以有很多工具与其兼容。
+ 注意,路径参数的类型是整数。
-正因如此,**FastAPI** 内置了一个可选的 API 文档(使用 Redoc):
+## 基于标准的好处,备选文档
-
+**FastAPI** 使用 OpenAPI 生成概图,所以能兼容很多工具。
-同样的,还有很多其他兼容的工具,包括适用于多种语言的代码生成工具。
+因此,**FastAPI** 还内置了 ReDoc 生成的备选 API 文档,可在此查看 http://127.0.0.1:8000/redoc:
+
+
+
+同样,还有很多兼容工具,包括多种语言的代码生成工具。
## Pydantic
-所有的数据校验都由 Pydantic 在幕后完成,所以你可以从它所有的优点中受益。并且你知道它在这方面非常胜任。
+FastAPI 充分地利用了 Pydantic 的优势,用它在后台校验数据。众所周知,Pydantic 擅长的就是数据校验。
-你可以使用同样的类型声明来声明 `str`、`float`、`bool` 以及许多其他的复合数据类型。
+同样,`str`、`float`、`bool` 以及很多复合数据类型都可以使用类型声明。
-本教程的下一章节将探讨其中的一些内容。
+下一章介绍详细内容。
## 顺序很重要
-在创建*路径操作*时,你会发现有些情况下路径是固定的。
+有时,*路径操作*中的路径是写死的。
-比如 `/users/me`,我们假设它用来获取关于当前用户的数据.
+比如要使用 `/users/me` 获取当前用户的数据。
-然后,你还可以使用路径 `/users/{user_id}` 来通过用户 ID 获取关于特定用户的数据。
+然后还要使用 `/users/{user_id}`,通过用户 ID 获取指定用户的数据。
+
+由于*路径操作*是按顺序依次运行的,因此,一定要在 `/users/{user_id}` 之前声明 `/users/me` :
-由于*路径操作*是按顺序依次运行的,你需要确保路径 `/users/me` 声明在路径 `/users/{user_id}`之前:
```Python hl_lines="6 11"
{!../../../docs_src/path_params/tutorial003.py!}
```
-否则,`/users/{user_id}` 的路径还将与 `/users/me` 相匹配,"认为"自己正在接收一个值为 `"me"` 的 `user_id` 参数。
+否则,`/users/{user_id}` 将匹配 `/users/me`,FastAPI 会**认为**正在接收值为 `"me"` 的 `user_id` 参数。
## 预设值
-如果你有一个接收路径参数的路径操作,但你希望预先设定可能的有效参数值,则可以使用标准的 Python `Enum` 类型。
+路径操作使用 Python 的 `Enum` 类型接收预设的*路径参数*。
-### 创建一个 `Enum` 类
+### 创建 `Enum` 类
-导入 `Enum` 并创建一个继承自 `str` 和 `Enum` 的子类。
+导入 `Enum` 并创建继承自 `str` 和 `Enum` 的子类。
-通过从 `str` 继承,API 文档将能够知道这些值必须为 `string` 类型并且能够正确地展示出来。
+通过从 `str` 继承,API 文档就能把值的类型定义为**字符串**,并且能正确渲染。
-然后创建具有固定值的类属性,这些固定值将是可用的有效值:
+然后,创建包含固定值的类属性,这些固定值是可用的有效值:
```Python hl_lines="1 6-9"
{!../../../docs_src/path_params/tutorial005.py!}
```
-!!! info
- 枚举(或 enums)从 3.4 版本起在 Python 中可用。
+!!! info "说明"
-!!! tip
- 如果你想知道,"AlexNet"、"ResNet" 和 "LeNet" 只是机器学习中的模型名称。
+ Python 3.4 及之后版本支持枚举(即 enums)。
+
+!!! tip "提示"
+
+ **AlexNet**、**ResNet**、**LeNet** 是机器学习模型。
### 声明*路径参数*
-然后使用你定义的枚举类(`ModelName`)创建一个带有类型标注的*路径参数*:
+使用 Enum 类(`ModelName`)创建使用类型注解的*路径参数*:
```Python hl_lines="16"
{!../../../docs_src/path_params/tutorial005.py!}
@@ -146,17 +153,17 @@
### 查看文档
-因为已经指定了*路径参数*的可用值,所以交互式文档可以恰当地展示它们:
+ API 文档会显示预定义*路径参数*的可用值:
-
+
-### 使用 Python *枚举类型*
+### 使用 Python _枚举类型_
-*路径参数*的值将是一个*枚举成员*。
+*路径参数*的值是枚举的元素。
-#### 比较*枚举成员*
+#### 比较*枚举元素*
-你可以将它与你创建的枚举类 `ModelName` 中的*枚举成员*进行比较:
+枚举类 `ModelName` 中的*枚举元素*支持比较操作:
```Python hl_lines="17"
{!../../../docs_src/path_params/tutorial005.py!}
@@ -164,71 +171,82 @@
#### 获取*枚举值*
-你可以使用 `model_name.value` 或通常来说 `your_enum_member.value` 来获取实际的值(在这个例子中为 `str`):
+使用 `model_name.value` 或 `your_enum_member.value` 获取实际的值(本例中为**字符串**):
-```Python hl_lines="19"
+```Python hl_lines="20"
{!../../../docs_src/path_params/tutorial005.py!}
```
-!!! tip
- 你也可以通过 `ModelName.lenet.value` 来获取值 `"lenet"`。
+!!! tip "提示"
-#### 返回*枚举成员*
+ 使用 `ModelName.lenet.value` 也能获取值 `"lenet"`。
-你可以从*路径操作*中返回*枚举成员*,即使嵌套在 JSON 结构中(例如一个 `dict` 中)。
+#### 返回*枚举元素*
-在返回给客户端之前,它们将被转换为对应的值:
+即使嵌套在 JSON 请求体里(例如, `dict`),也可以从*路径操作*返回*枚举元素*。
-```Python hl_lines="18-21"
+返回给客户端之前,要把枚举元素转换为对应的值(本例中为字符串):
+
+```Python hl_lines="18 21 23"
{!../../../docs_src/path_params/tutorial005.py!}
```
+客户端中的 JSON 响应如下:
+
+```JSON
+{
+ "model_name": "alexnet",
+ "message": "Deep Learning FTW!"
+}
+```
+
## 包含路径的路径参数
-假设你有一个*路径操作*,它的路径为 `/files/{file_path}`。
+假设*路径操作*的路径为 `/files/{file_path}`。
-但是你需要 `file_path` 自身也包含*路径*,比如 `home/johndoe/myfile.txt`。
+但需要 `file_path` 中也包含*路径*,比如,`home/johndoe/myfile.txt`。
-因此,该文件的URL将类似于这样:`/files/home/johndoe/myfile.txt`。
+此时,该文件的 URL 是这样的:`/files/home/johndoe/myfile.txt`。
### OpenAPI 支持
-OpenAPI 不支持任何方式去声明*路径参数*以在其内部包含*路径*,因为这可能会导致难以测试和定义的情况出现。
+OpenAPI 不支持声明包含路径的*路径参数*,因为这会导致测试和定义更加困难。
-不过,你仍然可以通过 Starlette 的一个内部工具在 **FastAPI** 中实现它。
+不过,仍可使用 Starlette 内置工具在 **FastAPI** 中实现这一功能。
-而且文档依旧可以使用,但是不会添加任何该参数应包含路径的说明。
+而且不影响文档正常运行,但是不会添加该参数包含路径的说明。
### 路径转换器
-你可以使用直接来自 Starlette 的选项来声明一个包含*路径*的*路径参数*:
+直接使用 Starlette 的选项声明包含*路径*的*路径参数*:
```
/files/{file_path:path}
```
-在这种情况下,参数的名称为 `file_path`,结尾部分的 `:path` 说明该参数应匹配任意的*路径*。
+本例中,参数名为 `file_path`,结尾部分的 `:path` 说明该参数应匹配*路径*。
-因此,你可以这样使用它:
+用法如下:
```Python hl_lines="6"
{!../../../docs_src/path_params/tutorial004.py!}
```
-!!! tip
- 你可能会需要参数包含 `/home/johndoe/myfile.txt`,以斜杠(`/`)开头。
+!!! tip "提示"
- 在这种情况下,URL 将会是 `/files//home/johndoe/myfile.txt`,在`files` 和 `home` 之间有一个双斜杠(`//`)。
+ 注意,包含 `/home/johndoe/myfile.txt` 的路径参数要以斜杠(`/`)开头。
-## 总结
+ 本例中的 URL 是 `/files//home/johndoe/myfile.txt`。注意,`files` 和 `home` 之间要使用**双斜杠**(`//`)。
-使用 **FastAPI**,通过简短、直观和标准的 Python 类型声明,你将获得:
+## 小结
-* 编辑器支持:错误检查,代码补全等
-* 数据 "解析"
-* 数据校验
-* API 标注和自动生成的文档
+通过简短、直观的 Python 标准类型声明,**FastAPI** 可以获得:
-而且你只需要声明一次即可。
+- 编辑器支持:错误检查,代码自动补全等
+- 数据**解析**
+- 数据校验
+- API 注解和 API 文档
-这可能是 **FastAPI** 与其他框架相比主要的明显优势(除了原始性能以外)。
+只需要声明一次即可。
+
+这可能是除了性能以外,**FastAPI** 与其它框架相比的主要优势。
diff --git a/docs/zh/docs/tutorial/query-params-str-validations.md b/docs/zh/docs/tutorial/query-params-str-validations.md
index 39253eb0d..af0428837 100644
--- a/docs/zh/docs/tutorial/query-params-str-validations.md
+++ b/docs/zh/docs/tutorial/query-params-str-validations.md
@@ -152,7 +152,7 @@ q: Union[str, None] = Query(default=None, min_length=3)
```
!!! tip
- Pydantic 是 FastAPI 中所有数据验证和序列化的核心,当你在没有设默认值的情况下使用 `Optional` 或 `Union[Something, None]` 时,它具有特殊行为,你可以在 Pydantic 文档中阅读有关必需可选字段的更多信息。
+ Pydantic 是 FastAPI 中所有数据验证和序列化的核心,当你在没有设默认值的情况下使用 `Optional` 或 `Union[Something, None]` 时,它具有特殊行为,你可以在 Pydantic 文档中阅读有关必需可选字段的更多信息。
### 使用Pydantic中的`Required`代替省略号(`...`)
diff --git a/docs/zh/docs/tutorial/query-params.md b/docs/zh/docs/tutorial/query-params.md
index b1668a2d2..77138de51 100644
--- a/docs/zh/docs/tutorial/query-params.md
+++ b/docs/zh/docs/tutorial/query-params.md
@@ -1,86 +1,102 @@
# 查询参数
-声明不属于路径参数的其他函数参数时,它们将被自动解释为"查询字符串"参数
+声明的参数不是路径参数时,路径操作函数会把该参数自动解释为**查询**参数。
```Python hl_lines="9"
{!../../../docs_src/query_params/tutorial001.py!}
```
-查询字符串是键值对的集合,这些键值对位于 URL 的 `?` 之后,并以 `&` 符号分隔。
+查询字符串是键值对的集合,这些键值对位于 URL 的 `?` 之后,以 `&` 分隔。
-例如,在以下 url 中:
+例如,以下 URL 中:
```
http://127.0.0.1:8000/items/?skip=0&limit=10
```
-...查询参数为:
+……查询参数为:
-* `skip`:对应的值为 `0`
-* `limit`:对应的值为 `10`
+* `skip`:值为 `0`
+* `limit`:值为 `10`
-由于它们是 URL 的一部分,因此它们的"原始值"是字符串。
+这些值都是 URL 的组成部分,因此,它们的类型**本应**是字符串。
-但是,当你为它们声明了 Python 类型(在上面的示例中为 `int`)时,它们将转换为该类型并针对该类型进行校验。
+但声明 Python 类型(上例中为 `int`)之后,这些值就会转换为声明的类型,并进行类型校验。
-应用于路径参数的所有相同过程也适用于查询参数:
+所有应用于路径参数的流程也适用于查询参数:
-* (很明显的)编辑器支持
-* 数据"解析"
+* (显而易见的)编辑器支持
+* 数据**解析**
* 数据校验
-* 自动生成文档
+* API 文档
## 默认值
-由于查询参数不是路径的固定部分,因此它们可以是可选的,并且可以有默认值。
+查询参数不是路径的固定内容,它是可选的,还支持默认值。
-在上面的示例中,它们具有 `skip=0` 和 `limit=10` 的默认值。
+上例用 `skip=0` 和 `limit=10` 设定默认值。
-因此,访问 URL:
+访问 URL:
```
http://127.0.0.1:8000/items/
```
-将与访问以下地址相同:
+与访问以下地址相同:
```
http://127.0.0.1:8000/items/?skip=0&limit=10
```
-但是,如果你访问的是:
+但如果访问:
```
http://127.0.0.1:8000/items/?skip=20
```
-函数中的参数值将会是:
+查询参数的值就是:
* `skip=20`:在 URL 中设定的值
* `limit=10`:使用默认值
## 可选参数
-通过同样的方式,你可以将它们的默认值设置为 `None` 来声明可选查询参数:
+同理,把默认值设为 `None` 即可声明**可选的**查询参数:
-```Python hl_lines="7"
-{!../../../docs_src/query_params/tutorial002.py!}
-```
+=== "Python 3.10+"
-在这个例子中,函数参数 `q` 将是可选的,并且默认值为 `None`。
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/query_params/tutorial002_py310.py!}
+ ```
-!!! check
- 还要注意的是,**FastAPI** 足够聪明,能够分辨出参数 `item_id` 是路径参数而 `q` 不是,因此 `q` 是一个查询参数。
+=== "Python 3.8+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/query_params/tutorial002.py!}
+ ```
+
+
+本例中,查询参数 `q` 是可选的,默认值为 `None`。
+
+!!! check "检查"
+
+ 注意,**FastAPI** 可以识别出 `item_id` 是路径参数,`q` 不是路径参数,而是查询参数。
+
+!!! note "笔记"
+
+ 因为默认值为 `= None`,FastAPI 把 `q` 识别为可选参数。
+
+ FastAPI 不使用 `Optional[str]` 中的 `Optional`(只使用 `str`),但 `Optional[str]` 可以帮助编辑器发现代码中的错误。
## 查询参数类型转换
-你还可以声明 `bool` 类型,它们将被自动转换:
+参数还可以声明为 `bool` 类型,FastAPI 会自动转换参数类型:
-```Python hl_lines="7"
+```Python hl_lines="9"
{!../../../docs_src/query_params/tutorial003.py!}
```
-这个例子中,如果你访问:
+本例中,访问:
```
http://127.0.0.1:8000/items/foo?short=1
@@ -110,42 +126,42 @@ http://127.0.0.1:8000/items/foo?short=on
http://127.0.0.1:8000/items/foo?short=yes
```
-或任何其他的变体形式(大写,首字母大写等等),你的函数接收的 `short` 参数都会是布尔值 `True`。对于值为 `False` 的情况也是一样的。
+或其它任意大小写形式(大写、首字母大写等),函数接收的 `short` 参数都是布尔值 `True`。值为 `False` 时也一样。
## 多个路径和查询参数
-你可以同时声明多个路径参数和查询参数,**FastAPI** 能够识别它们。
+**FastAPI** 可以识别同时声明的多个路径参数和查询参数。
-而且你不需要以任何特定的顺序来声明。
+而且声明查询参数的顺序并不重要。
-它们将通过名称被检测到:
+FastAPI 通过参数名进行检测:
-```Python hl_lines="6 8"
+```Python hl_lines="8 10"
{!../../../docs_src/query_params/tutorial004.py!}
```
-## 必需查询参数
+## 必选查询参数
-当你为非路径参数声明了默认值时(目前而言,我们所知道的仅有查询参数),则该参数不是必需的。
+为不是路径参数的参数声明默认值(至此,仅有查询参数),该参数就**不是必选**的了。
-如果你不想添加一个特定的值,而只是想使该参数成为可选的,则将默认值设置为 `None`。
+如果只想把参数设为**可选**,但又不想指定参数的值,则要把默认值设为 `None`。
-但当你想让一个查询参数成为必需的,不声明任何默认值就可以:
+如果要把查询参数设置为**必选**,就不要声明默认值:
```Python hl_lines="6-7"
{!../../../docs_src/query_params/tutorial005.py!}
```
-这里的查询参数 `needy` 是类型为 `str` 的必需查询参数。
+这里的查询参数 `needy` 是类型为 `str` 的必选查询参数。
-如果你在浏览器中打开一个像下面的 URL:
+在浏览器中打开如下 URL:
```
http://127.0.0.1:8000/items/foo-item
```
-...因为没有添加必需的参数 `needy`,你将看到类似以下的错误:
+……因为路径中没有必选参数 `needy`,返回的响应中会显示如下错误信息:
```JSON
{
@@ -162,13 +178,13 @@ http://127.0.0.1:8000/items/foo-item
}
```
-由于 `needy` 是必需参数,因此你需要在 URL 中设置它的值:
+`needy` 是必选参数,因此要在 URL 中设置值:
```
http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
```
-...这样就正常了:
+……这样就正常了:
```JSON
{
@@ -177,17 +193,17 @@ http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
}
```
-当然,你也可以定义一些参数为必需的,一些具有默认值,而某些则完全是可选的:
+当然,把一些参数定义为必选,为另一些参数设置默认值,再把其它参数定义为可选,这些操作都是可以的:
-```Python hl_lines="7"
+```Python hl_lines="10"
{!../../../docs_src/query_params/tutorial006.py!}
```
-在这个例子中,有3个查询参数:
+本例中有 3 个查询参数:
-* `needy`,一个必需的 `str` 类型参数。
-* `skip`,一个默认值为 `0` 的 `int` 类型参数。
-* `limit`,一个可选的 `int` 类型参数。
+* `needy`,必选的 `str` 类型参数
+* `skip`,默认值为 `0` 的 `int` 类型参数
+* `limit`,可选的 `int` 类型参数
-!!! tip
- 你还可以像在 [路径参数](path-params.md#predefined-values){.internal-link target=_blank} 中那样使用 `Enum`。
+!!! tip "提示"
+ 还可以像在[路径参数](path-params.md#_8){.internal-link target=_blank} 中那样使用 `Enum`。
diff --git a/docs/zh/docs/tutorial/request-files.md b/docs/zh/docs/tutorial/request-files.md
index 2c48f33ca..1cd3518cf 100644
--- a/docs/zh/docs/tutorial/request-files.md
+++ b/docs/zh/docs/tutorial/request-files.md
@@ -6,7 +6,7 @@
因为上传文件以「表单数据」形式发送。
- 所以接收上传文件,要预先安装 `python-multipart`。
+ 所以接收上传文件,要预先安装 `python-multipart`。
例如: `pip install python-multipart`。
diff --git a/docs/zh/docs/tutorial/request-forms-and-files.md b/docs/zh/docs/tutorial/request-forms-and-files.md
index 70cd70f98..f58593669 100644
--- a/docs/zh/docs/tutorial/request-forms-and-files.md
+++ b/docs/zh/docs/tutorial/request-forms-and-files.md
@@ -4,7 +4,7 @@ FastAPI 支持同时使用 `File` 和 `Form` 定义文件和表单字段。
!!! info "说明"
- 接收上传文件或表单数据,要预先安装 `python-multipart`。
+ 接收上传文件或表单数据,要预先安装 `python-multipart`。
例如,`pip install python-multipart`。
diff --git a/docs/zh/docs/tutorial/request-forms.md b/docs/zh/docs/tutorial/request-forms.md
index 6436ffbcd..e4fcd88ff 100644
--- a/docs/zh/docs/tutorial/request-forms.md
+++ b/docs/zh/docs/tutorial/request-forms.md
@@ -4,7 +4,7 @@
!!! info "说明"
- 要使用表单,需预先安装 `python-multipart`。
+ 要使用表单,需预先安装 `python-multipart`。
例如,`pip install python-multipart`。
diff --git a/docs/zh/docs/tutorial/response-model.md b/docs/zh/docs/tutorial/response-model.md
index e731b6989..0f1b3b4b9 100644
--- a/docs/zh/docs/tutorial/response-model.md
+++ b/docs/zh/docs/tutorial/response-model.md
@@ -160,7 +160,7 @@ FastAPI 将使用此 `response_model` 来:
```
!!! info
- FastAPI 通过 Pydantic 模型的 `.dict()` 配合 该方法的 `exclude_unset` 参数 来实现此功能。
+ FastAPI 通过 Pydantic 模型的 `.dict()` 配合 该方法的 `exclude_unset` 参数 来实现此功能。
!!! info
你还可以使用:
@@ -168,7 +168,7 @@ FastAPI 将使用此 `response_model` 来:
* `response_model_exclude_defaults=True`
* `response_model_exclude_none=True`
- 参考 Pydantic 文档 中对 `exclude_defaults` 和 `exclude_none` 的描述。
+ 参考 Pydantic 文档 中对 `exclude_defaults` 和 `exclude_none` 的描述。
#### 默认值字段有实际值的数据
diff --git a/docs/zh/docs/tutorial/response-status-code.md b/docs/zh/docs/tutorial/response-status-code.md
index 357831942..cc23231b4 100644
--- a/docs/zh/docs/tutorial/response-status-code.md
+++ b/docs/zh/docs/tutorial/response-status-code.md
@@ -1,89 +1,95 @@
# 响应状态码
-与指定响应模型的方式相同,你也可以在以下任意的*路径操作*中使用 `status_code` 参数来声明用于响应的 HTTP 状态码:
+与指定响应模型的方式相同,在以下任意*路径操作*中,可以使用 `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` 等)的一个参数。不像之前的所有参数和请求体,它不属于*路径操作函数*。
+!!! note "笔记"
-`status_code` 参数接收一个表示 HTTP 状态码的数字。
+ 注意,`status_code` 是(`get`、`post` 等)**装饰器**方法中的参数。与之前的参数和请求体不同,不是*路径操作函数*的参数。
-!!! info
- `status_code` 也能够接收一个 `IntEnum` 类型,比如 Python 的 `http.HTTPStatus`。
+`status_code` 参数接收表示 HTTP 状态码的数字。
-它将会:
+!!! info "说明"
-* 在响应中返回该状态码。
-* 在 OpenAPI 模式中(以及在用户界面中)将其记录为:
+ `status_code` 还能接收 `IntEnum` 类型,比如 Python 的 `http.HTTPStatus`。
-
+它可以:
-!!! note
- 一些响应状态码(请参阅下一部分)表示响应没有响应体。
+* 在响应中返回状态码
+* 在 OpenAPI 概图(及用户界面)中存档:
- FastAPI 知道这一点,并将生成表明没有响应体的 OpenAPI 文档。
+
+
+!!! note "笔记"
+
+ 某些响应状态码表示响应没有响应体(参阅下一章)。
+
+ FastAPI 可以进行识别,并生成表明无响应体的 OpenAPI 文档。
## 关于 HTTP 状态码
-!!! note
- 如果你已经了解什么是 HTTP 状态码,请跳到下一部分。
+!!! note "笔记"
-在 HTTP 协议中,你将发送 3 位数的数字状态码作为响应的一部分。
+ 如果已经了解 HTTP 状态码,请跳到下一章。
-这些状态码有一个识别它们的关联名称,但是重要的还是数字。
+在 HTTP 协议中,发送 3 位数的数字状态码是响应的一部分。
-简而言之:
+这些状态码都具有便于识别的关联名称,但是重要的还是数字。
-* `100` 及以上状态码用于「消息」响应。你很少直接使用它们。具有这些状态代码的响应不能带有响应体。
-* **`200`** 及以上状态码用于「成功」响应。这些是你最常使用的。
- * `200` 是默认状态代码,它表示一切「正常」。
- * 另一个例子会是 `201`,「已创建」。它通常在数据库中创建了一条新记录后使用。
- * 一个特殊的例子是 `204`,「无内容」。此响应在没有内容返回给客户端时使用,因此该响应不能包含响应体。
-* **`300`** 及以上状态码用于「重定向」。具有这些状态码的响应可能有或者可能没有响应体,但 `304`「未修改」是个例外,该响应不得含有响应体。
-* **`400`** 及以上状态码用于「客户端错误」响应。这些可能是你第二常使用的类型。
- * 一个例子是 `404`,用于「未找到」响应。
- * 对于来自客户端的一般错误,你可以只使用 `400`。
-* `500` 及以上状态码用于服务器端错误。你几乎永远不会直接使用它们。当你的应用程序代码或服务器中的某些部分出现问题时,它将自动返回这些状态代码之一。
+简言之:
-!!! tip
- 要了解有关每个状态代码以及适用场景的更多信息,请查看 MDN 关于 HTTP 状态码的文档。
+* `100` 及以上的状态码用于返回**信息**。这类状态码很少直接使用。具有这些状态码的响应不能包含响应体
+* **`200`** 及以上的状态码用于表示**成功**。这些状态码是最常用的
+ * `200` 是默认状态代码,表示一切**正常**
+ * `201` 表示**已创建**,通常在数据库中创建新记录后使用
+ * `204` 是一种特殊的例子,表示**无内容**。该响应在没有为客户端返回内容时使用,因此,该响应不能包含响应体
+* **`300`** 及以上的状态码用于**重定向**。具有这些状态码的响应不一定包含响应体,但 `304`**未修改**是个例外,该响应不得包含响应体
+* **`400`** 及以上的状态码用于表示**客户端错误**。这些可能是第二常用的类型
+ * `404`,用于**未找到**响应
+ * 对于来自客户端的一般错误,可以只使用 `400`
+* `500` 及以上的状态码用于表示服务器端错误。几乎永远不会直接使用这些状态码。应用代码或服务器出现问题时,会自动返回这些状态代码
-## 记住名称的捷径
+!!! tip "提示"
-让我们再次看看之前的例子:
+ 状态码及适用场景的详情,请参阅 MDN 的 HTTP 状态码文档。
+
+## 状态码名称快捷方式
+
+再看下之前的例子:
```Python hl_lines="6"
{!../../../docs_src/response_status_code/tutorial001.py!}
```
-`201` 是表示「已创建」的状态码。
+`201` 表示**已创建**的状态码。
-但是你不必去记住每个代码的含义。
+但我们没有必要记住所有代码的含义。
-你可以使用来自 `fastapi.status` 的便捷变量。
+可以使用 `fastapi.status` 中的快捷变量。
```Python hl_lines="1 6"
{!../../../docs_src/response_status_code/tutorial002.py!}
```
-它们只是一种便捷方式,它们具有同样的数字代码,但是这样使用你就可以使用编辑器的自动补全功能来查找它们:
+这只是一种快捷方式,具有相同的数字代码,但它可以使用编辑器的自动补全功能:
-
+
!!! note "技术细节"
- 你也可以使用 `from starlette import status`。
- 为了给你(即开发者)提供方便,**FastAPI** 提供了与 `starlette.status` 完全相同的 `fastapi.status`。但它直接来自于 Starlette。
+ 也可以使用 `from starlette import status`。
+
+ 为了让开发者更方便,**FastAPI** 提供了与 `starlette.status` 完全相同的 `fastapi.status`。但它直接来自于 Starlette。
## 更改默认状态码
-稍后,在[高级用户指南](../advanced/response-change-status-code.md){.internal-link target=_blank}中你将了解如何返回与在此声明的默认状态码不同的状态码。
+[高级用户指南](../advanced/response-change-status-code.md){.internal-link target=_blank}中,将介绍如何返回与在此声明的默认状态码不同的状态码。
diff --git a/docs/zh/docs/tutorial/schema-extra-example.md b/docs/zh/docs/tutorial/schema-extra-example.md
index ebc04da8b..ae204dc61 100644
--- a/docs/zh/docs/tutorial/schema-extra-example.md
+++ b/docs/zh/docs/tutorial/schema-extra-example.md
@@ -8,7 +8,7 @@
## Pydantic `schema_extra`
-您可以使用 `Config` 和 `schema_extra` 为Pydantic模型声明一个示例,如Pydantic 文档:定制 Schema 中所述:
+您可以使用 `Config` 和 `schema_extra` 为Pydantic模型声明一个示例,如Pydantic 文档:定制 Schema 中所述:
=== "Python 3.10+"
diff --git a/docs/zh/docs/tutorial/security/first-steps.md b/docs/zh/docs/tutorial/security/first-steps.md
index dda956417..f28cc24f8 100644
--- a/docs/zh/docs/tutorial/security/first-steps.md
+++ b/docs/zh/docs/tutorial/security/first-steps.md
@@ -45,7 +45,7 @@
!!! info "说明"
- 先安装 `python-multipart`。
+ 先安装 `python-multipart`。
安装命令: `pip install python-multipart`。
diff --git a/docs/zh/docs/tutorial/security/get-current-user.md b/docs/zh/docs/tutorial/security/get-current-user.md
index 477baec3a..1f17f5bd9 100644
--- a/docs/zh/docs/tutorial/security/get-current-user.md
+++ b/docs/zh/docs/tutorial/security/get-current-user.md
@@ -1,35 +1,35 @@
# 获取当前用户
-在上一章节中,(基于依赖项注入系统的)安全系统向*路径操作函数*提供了一个 `str` 类型的 `token`:
+上一章中,(基于依赖注入系统的)安全系统向*路径操作函数*传递了 `str` 类型的 `token`:
```Python hl_lines="10"
{!../../../docs_src/security/tutorial001.py!}
```
-但这还不是很实用。
+但这并不实用。
-让我们来使它返回当前用户给我们。
+接下来,我们学习如何返回当前用户。
-## 创建一个用户模型
+## 创建用户模型
-首先,让我们来创建一个用户 Pydantic 模型。
+首先,创建 Pydantic 用户模型。
-与使用 Pydantic 声明请求体的方式相同,我们可以在其他任何地方使用它:
+与使用 Pydantic 声明请求体相同,并且可在任何位置使用:
```Python hl_lines="5 12-16"
{!../../../docs_src/security/tutorial002.py!}
```
-## 创建一个 `get_current_user` 依赖项
+## 创建 `get_current_user` 依赖项
-让我们来创建一个 `get_current_user` 依赖项。
+创建 `get_current_user` 依赖项。
-还记得依赖项可以有子依赖项吗?
+还记得依赖项支持子依赖项吗?
-`get_current_user` 将具有一个我们之前所创建的同一个 `oauth2_scheme` 作为依赖项。
+`get_current_user` 使用 `oauth2_scheme` 作为依赖项。
-与我们之前直接在路径操作中所做的相同,我们新的依赖项 `get_current_user` 将从子依赖项 `oauth2_scheme` 中接收一个 `str` 类型的 `token`:
+与之前直接在路径操作中的做法相同,新的 `get_current_user` 依赖项从子依赖项 `oauth2_scheme` 中接收 `str` 类型的 `token`:
```Python hl_lines="25"
{!../../../docs_src/security/tutorial002.py!}
@@ -37,7 +37,7 @@
## 获取用户
-`get_current_user` 将使用我们创建的(伪)工具函数,该函数接收 `str` 类型的令牌并返回我们的 Pydantic `User` 模型:
+`get_current_user` 使用创建的(伪)工具函数,该函数接收 `str` 类型的令牌,并返回 Pydantic 的 `User` 模型:
```Python hl_lines="19-22 26-27"
{!../../../docs_src/security/tutorial002.py!}
@@ -45,70 +45,72 @@
## 注入当前用户
-因此现在我们可以在*路径操作*中使用 `get_current_user` 作为 `Depends` 了:
+在*路径操作* 的 `Depends` 中使用 `get_current_user`:
```Python hl_lines="31"
{!../../../docs_src/security/tutorial002.py!}
```
-注意我们将 `current_user` 的类型声明为 Pydantic 模型 `User`。
+注意,此处把 `current_user` 的类型声明为 Pydantic 的 `User` 模型。
-这将帮助我们在函数内部使用所有的代码补全和类型检查。
+这有助于在函数内部使用代码补全和类型检查。
-!!! tip
- 你可能还记得请求体也是使用 Pydantic 模型来声明的。
+!!! tip "提示"
- 在这里 **FastAPI** 不会搞混,因为你正在使用的是 `Depends`。
+ 还记得请求体也是使用 Pydantic 模型声明的吧。
-!!! check
- 这种依赖系统的设计方式使我们可以拥有不同的依赖项(不同的「可依赖类型」),并且它们都返回一个 `User` 模型。
+ 放心,因为使用了 `Depends`,**FastAPI** 不会搞混。
- 我们并未被局限于只能有一个返回该类型数据的依赖项。
+!!! check "检查"
+
+ 依赖系统的这种设计方式可以支持不同的依赖项返回同一个 `User` 模型。
+
+ 而不是局限于只能有一个返回该类型数据的依赖项。
-## 其他模型
+## 其它模型
-现在你可以直接在*路径操作函数*中获取当前用户,并使用 `Depends` 在**依赖注入**级别处理安全性机制。
+接下来,直接在*路径操作函数*中获取当前用户,并用 `Depends` 在**依赖注入**系统中处理安全机制。
-你可以使用任何模型或数据来满足安全性要求(在这个示例中,使用的是 Pydantic 模型 `User`)。
+开发者可以使用任何模型或数据满足安全需求(本例中是 Pydantic 的 `User` 模型)。
-但是你并未被限制只能使用某些特定的数据模型,类或类型。
+而且,不局限于只能使用特定的数据模型、类或类型。
-你想要在模型中使用 `id` 和 `email` 而不使用任何的 `username`?当然可以。你可以同样地使用这些工具。
+不想在模型中使用 `username`,而是使用 `id` 和 `email`?当然可以。这些工具也支持。
-你只想要一个 `str`?或者仅仅一个 `dict`?还是直接一个数据库模型类的实例?它们的工作方式都是一样的。
+只想使用字符串?或字典?甚至是数据库类模型的实例?工作方式都一样。
-实际上你没有用户登录到你的应用程序,而是只拥有访问令牌的机器人,程序或其他系统?再一次,它们的工作方式也是一样的。
+实际上,就算登录应用的不是用户,而是只拥有访问令牌的机器人、程序或其它系统?工作方式也一样。
-尽管去使用你的应用程序所需要的任何模型,任何类,任何数据库。**FastAPI** 通过依赖项注入系统都帮你搞定。
+尽管使用应用所需的任何模型、类、数据库。**FastAPI** 通过依赖注入系统都能帮您搞定。
-## 代码体积
+## 代码大小
-这个示例似乎看起来很冗长。考虑到我们在同一文件中混合了安全性,数据模型工具函数和路径操作等代码。
+这个示例看起来有些冗长。毕竟这个文件同时包含了安全、数据模型的工具函数,以及路径操作等代码。
-但关键的是。
+但,关键是:
-安全性和依赖项注入内容只需要编写一次。
+**安全和依赖注入的代码只需要写一次。**
-你可以根据需要使其变得很复杂。而且只需要在一个地方写一次。但仍然具备所有的灵活性。
+就算写得再复杂,也只是在一个位置写一次就够了。所以,要多复杂就可以写多复杂。
-但是,你可以有无数个使用同一安全系统的端点(*路径操作*)。
+但是,就算有数千个端点(*路径操作*),它们都可以使用同一个安全系统。
-所有(或所需的任何部分)的端点,都可以利用对这些或你创建的其他依赖项进行复用所带来的优势。
+而且,所有端点(或它们的任何部件)都可以利用这些依赖项或任何其它依赖项。
-所有的这无数个*路径操作*甚至可以小到只需 3 行代码:
+所有*路径操作*只需 3 行代码就可以了:
```Python hl_lines="30-32"
{!../../../docs_src/security/tutorial002.py!}
```
-## 总结
+## 小结
-现在你可以直接在*路径操作函数*中获取当前用户。
+现在,我们可以直接在*路径操作函数*中获取当前用户。
-我们已经进行到一半了。
+至此,安全的内容已经讲了一半。
-我们只需要再为用户/客户端添加一个真正发送 `username` 和 `password` 的*路径操作*。
+只要再为用户或客户端的*路径操作*添加真正发送 `username` 和 `password` 的功能就可以了。
-这些内容在下一章节。
+下一章见。
diff --git a/docs/zh/docs/tutorial/security/simple-oauth2.md b/docs/zh/docs/tutorial/security/simple-oauth2.md
index c7f46177f..751767ea2 100644
--- a/docs/zh/docs/tutorial/security/simple-oauth2.md
+++ b/docs/zh/docs/tutorial/security/simple-oauth2.md
@@ -144,7 +144,7 @@ UserInDB(
!!! info "说明"
- `user_dict` 的说明,详见[**更多模型**一章](../extra-models.md#about-user_indict){.internal-link target=_blank}。
+ `user_dict` 的说明,详见[**更多模型**一章](../extra-models.md#user_indict){.internal-link target=_blank}。
## 返回 Token
diff --git a/docs/zh/docs/tutorial/sql-databases.md b/docs/zh/docs/tutorial/sql-databases.md
index c49374971..be0c76593 100644
--- a/docs/zh/docs/tutorial/sql-databases.md
+++ b/docs/zh/docs/tutorial/sql-databases.md
@@ -329,7 +329,7 @@ name: str
现在,在用于查询的 Pydantic*模型*`Item`中`User`,添加一个内部`Config`类。
-此类[`Config`](https://pydantic-docs.helpmanual.io/usage/model_config/)用于为 Pydantic 提供配置。
+此类[`Config`](https://docs.pydantic.dev/latest/api/config/)用于为 Pydantic 提供配置。
在`Config`类中,设置属性`orm_mode = True`。
diff --git a/docs/zh/docs/tutorial/testing.md b/docs/zh/docs/tutorial/testing.md
index 77fff7596..69841978c 100644
--- a/docs/zh/docs/tutorial/testing.md
+++ b/docs/zh/docs/tutorial/testing.md
@@ -8,7 +8,7 @@
## 使用 `TestClient`
-!!! 信息
+!!! info "信息"
要使用 `TestClient`,先要安装 `httpx`.
例:`pip install httpx`.
@@ -27,7 +27,7 @@
{!../../../docs_src/app_testing/tutorial001.py!}
```
-!!! 提示
+!!! tip "提示"
注意测试函数是普通的 `def`,不是 `async def`。
还有client的调用也是普通的调用,不是用 `await`。
@@ -39,7 +39,7 @@
**FastAPI** 提供了和 `starlette.testclient` 一样的 `fastapi.testclient`,只是为了方便开发者。但它直接来自Starlette。
-!!! 提示
+!!! tip "提示"
除了发送请求之外,如果你还想测试时在FastAPI应用中调用 `async` 函数(例如异步数据库函数), 可以在高级教程中看下 [Async Tests](../advanced/async-tests.md){.internal-link target=_blank} 。
## 分离测试
@@ -50,7 +50,7 @@
### **FastAPI** app 文件
-假设你有一个像 [更大的应用](./bigger-applications.md){.internal-link target=_blank} 中所描述的文件结构:
+假设你有一个像 [更大的应用](bigger-applications.md){.internal-link target=_blank} 中所描述的文件结构:
```
.
@@ -130,7 +130,7 @@
=== "Python 3.10+ non-Annotated"
- !!! tip
+ !!! tip "提示"
Prefer to use the `Annotated` version if possible.
```Python
@@ -139,7 +139,7 @@
=== "Python 3.8+ non-Annotated"
- !!! tip
+ !!! tip "提示"
Prefer to use the `Annotated` version if possible.
```Python
@@ -168,7 +168,7 @@
关于如何传数据给后端的更多信息 (使用`httpx` 或 `TestClient`),请查阅 HTTPX 文档.
-!!! 信息
+!!! info "信息"
注意 `TestClient` 接收可以被转化为JSON的数据,而不是Pydantic模型。
如果你在测试中有一个Pydantic模型,并且你想在测试时发送它的数据给应用,你可以使用在[JSON Compatible Encoder](encoder.md){.internal-link target=_blank}介绍的`jsonable_encoder` 。
diff --git a/docs_src/app_testing/app_b/test_main.py b/docs_src/app_testing/app_b/test_main.py
index 4e2b98e23..4e1c51ecc 100644
--- a/docs_src/app_testing/app_b/test_main.py
+++ b/docs_src/app_testing/app_b/test_main.py
@@ -21,7 +21,7 @@ def test_read_item_bad_token():
assert response.json() == {"detail": "Invalid X-Token header"}
-def test_read_inexistent_item():
+def test_read_nonexistent_item():
response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
assert response.status_code == 404
assert response.json() == {"detail": "Item not found"}
diff --git a/docs_src/app_testing/app_b_an/test_main.py b/docs_src/app_testing/app_b_an/test_main.py
index d186b8ecb..e2eda449d 100644
--- a/docs_src/app_testing/app_b_an/test_main.py
+++ b/docs_src/app_testing/app_b_an/test_main.py
@@ -21,7 +21,7 @@ def test_read_item_bad_token():
assert response.json() == {"detail": "Invalid X-Token header"}
-def test_read_inexistent_item():
+def test_read_nonexistent_item():
response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
assert response.status_code == 404
assert response.json() == {"detail": "Item not found"}
diff --git a/docs_src/app_testing/app_b_an_py310/test_main.py b/docs_src/app_testing/app_b_an_py310/test_main.py
index d186b8ecb..e2eda449d 100644
--- a/docs_src/app_testing/app_b_an_py310/test_main.py
+++ b/docs_src/app_testing/app_b_an_py310/test_main.py
@@ -21,7 +21,7 @@ def test_read_item_bad_token():
assert response.json() == {"detail": "Invalid X-Token header"}
-def test_read_inexistent_item():
+def test_read_nonexistent_item():
response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
assert response.status_code == 404
assert response.json() == {"detail": "Item not found"}
diff --git a/docs_src/app_testing/app_b_an_py39/test_main.py b/docs_src/app_testing/app_b_an_py39/test_main.py
index d186b8ecb..e2eda449d 100644
--- a/docs_src/app_testing/app_b_an_py39/test_main.py
+++ b/docs_src/app_testing/app_b_an_py39/test_main.py
@@ -21,7 +21,7 @@ def test_read_item_bad_token():
assert response.json() == {"detail": "Invalid X-Token header"}
-def test_read_inexistent_item():
+def test_read_nonexistent_item():
response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
assert response.status_code == 404
assert response.json() == {"detail": "Item not found"}
diff --git a/docs_src/app_testing/app_b_py310/test_main.py b/docs_src/app_testing/app_b_py310/test_main.py
index 4e2b98e23..4e1c51ecc 100644
--- a/docs_src/app_testing/app_b_py310/test_main.py
+++ b/docs_src/app_testing/app_b_py310/test_main.py
@@ -21,7 +21,7 @@ def test_read_item_bad_token():
assert response.json() == {"detail": "Invalid X-Token header"}
-def test_read_inexistent_item():
+def test_read_nonexistent_item():
response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
assert response.status_code == 404
assert response.json() == {"detail": "Item not found"}
diff --git a/docs_src/custom_response/tutorial006c.py b/docs_src/custom_response/tutorial006c.py
index db87a9389..87c720364 100644
--- a/docs_src/custom_response/tutorial006c.py
+++ b/docs_src/custom_response/tutorial006c.py
@@ -6,4 +6,4 @@ app = FastAPI()
@app.get("/pydantic", response_class=RedirectResponse, status_code=302)
async def redirect_pydantic():
- return "https://pydantic-docs.helpmanual.io/"
+ return "https://docs.pydantic.dev/"
diff --git a/docs_src/dependencies/tutorial005_an.py b/docs_src/dependencies/tutorial005_an.py
index 6785099da..1d78c17a2 100644
--- a/docs_src/dependencies/tutorial005_an.py
+++ b/docs_src/dependencies/tutorial005_an.py
@@ -21,6 +21,6 @@ def query_or_cookie_extractor(
@app.get("/items/")
async def read_query(
- query_or_default: Annotated[str, Depends(query_or_cookie_extractor)]
+ query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
):
return {"q_or_cookie": query_or_default}
diff --git a/docs_src/dependencies/tutorial005_an_py310.py b/docs_src/dependencies/tutorial005_an_py310.py
index 6c0aa0b36..5ccfc62bd 100644
--- a/docs_src/dependencies/tutorial005_an_py310.py
+++ b/docs_src/dependencies/tutorial005_an_py310.py
@@ -20,6 +20,6 @@ def query_or_cookie_extractor(
@app.get("/items/")
async def read_query(
- query_or_default: Annotated[str, Depends(query_or_cookie_extractor)]
+ query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
):
return {"q_or_cookie": query_or_default}
diff --git a/docs_src/dependencies/tutorial005_an_py39.py b/docs_src/dependencies/tutorial005_an_py39.py
index e8887e162..d5dd8dca9 100644
--- a/docs_src/dependencies/tutorial005_an_py39.py
+++ b/docs_src/dependencies/tutorial005_an_py39.py
@@ -20,6 +20,6 @@ def query_or_cookie_extractor(
@app.get("/items/")
async def read_query(
- query_or_default: Annotated[str, Depends(query_or_cookie_extractor)]
+ query_or_default: Annotated[str, Depends(query_or_cookie_extractor)],
):
return {"q_or_cookie": query_or_default}
diff --git a/docs_src/dependencies/tutorial008c.py b/docs_src/dependencies/tutorial008c.py
new file mode 100644
index 000000000..4b99a5a31
--- /dev/null
+++ b/docs_src/dependencies/tutorial008c.py
@@ -0,0 +1,27 @@
+from fastapi import Depends, FastAPI, HTTPException
+
+app = FastAPI()
+
+
+class InternalError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except InternalError:
+ print("Oops, we didn't raise again, Britney 😱")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: str = Depends(get_username)):
+ if item_id == "portal-gun":
+ raise InternalError(
+ f"The portal gun is too dangerous to be owned by {username}"
+ )
+ if item_id != "plumbus":
+ raise HTTPException(
+ status_code=404, detail="Item not found, there's only a plumbus here"
+ )
+ return item_id
diff --git a/docs_src/dependencies/tutorial008c_an.py b/docs_src/dependencies/tutorial008c_an.py
new file mode 100644
index 000000000..94f59f9aa
--- /dev/null
+++ b/docs_src/dependencies/tutorial008c_an.py
@@ -0,0 +1,28 @@
+from fastapi import Depends, FastAPI, HTTPException
+from typing_extensions import Annotated
+
+app = FastAPI()
+
+
+class InternalError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except InternalError:
+ print("Oops, we didn't raise again, Britney 😱")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id == "portal-gun":
+ raise InternalError(
+ f"The portal gun is too dangerous to be owned by {username}"
+ )
+ if item_id != "plumbus":
+ raise HTTPException(
+ status_code=404, detail="Item not found, there's only a plumbus here"
+ )
+ return item_id
diff --git a/docs_src/dependencies/tutorial008c_an_py39.py b/docs_src/dependencies/tutorial008c_an_py39.py
new file mode 100644
index 000000000..da92efa9c
--- /dev/null
+++ b/docs_src/dependencies/tutorial008c_an_py39.py
@@ -0,0 +1,29 @@
+from typing import Annotated
+
+from fastapi import Depends, FastAPI, HTTPException
+
+app = FastAPI()
+
+
+class InternalError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except InternalError:
+ print("Oops, we didn't raise again, Britney 😱")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id == "portal-gun":
+ raise InternalError(
+ f"The portal gun is too dangerous to be owned by {username}"
+ )
+ if item_id != "plumbus":
+ raise HTTPException(
+ status_code=404, detail="Item not found, there's only a plumbus here"
+ )
+ return item_id
diff --git a/docs_src/dependencies/tutorial008d.py b/docs_src/dependencies/tutorial008d.py
new file mode 100644
index 000000000..93039343d
--- /dev/null
+++ b/docs_src/dependencies/tutorial008d.py
@@ -0,0 +1,28 @@
+from fastapi import Depends, FastAPI, HTTPException
+
+app = FastAPI()
+
+
+class InternalError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except InternalError:
+ print("We don't swallow the internal error here, we raise again 😎")
+ raise
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: str = Depends(get_username)):
+ if item_id == "portal-gun":
+ raise InternalError(
+ f"The portal gun is too dangerous to be owned by {username}"
+ )
+ if item_id != "plumbus":
+ raise HTTPException(
+ status_code=404, detail="Item not found, there's only a plumbus here"
+ )
+ return item_id
diff --git a/docs_src/dependencies/tutorial008d_an.py b/docs_src/dependencies/tutorial008d_an.py
new file mode 100644
index 000000000..c35424574
--- /dev/null
+++ b/docs_src/dependencies/tutorial008d_an.py
@@ -0,0 +1,29 @@
+from fastapi import Depends, FastAPI, HTTPException
+from typing_extensions import Annotated
+
+app = FastAPI()
+
+
+class InternalError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except InternalError:
+ print("We don't swallow the internal error here, we raise again 😎")
+ raise
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id == "portal-gun":
+ raise InternalError(
+ f"The portal gun is too dangerous to be owned by {username}"
+ )
+ if item_id != "plumbus":
+ raise HTTPException(
+ status_code=404, detail="Item not found, there's only a plumbus here"
+ )
+ return item_id
diff --git a/docs_src/dependencies/tutorial008d_an_py39.py b/docs_src/dependencies/tutorial008d_an_py39.py
new file mode 100644
index 000000000..99bd5cb91
--- /dev/null
+++ b/docs_src/dependencies/tutorial008d_an_py39.py
@@ -0,0 +1,30 @@
+from typing import Annotated
+
+from fastapi import Depends, FastAPI, HTTPException
+
+app = FastAPI()
+
+
+class InternalError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except InternalError:
+ print("We don't swallow the internal error here, we raise again 😎")
+ raise
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id == "portal-gun":
+ raise InternalError(
+ f"The portal gun is too dangerous to be owned by {username}"
+ )
+ if item_id != "plumbus":
+ raise HTTPException(
+ status_code=404, detail="Item not found, there's only a plumbus here"
+ )
+ return item_id
diff --git a/docs_src/extra_data_types/tutorial001.py b/docs_src/extra_data_types/tutorial001.py
index 8ae8472a7..71de958ff 100644
--- a/docs_src/extra_data_types/tutorial001.py
+++ b/docs_src/extra_data_types/tutorial001.py
@@ -10,10 +10,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Union[datetime, None] = Body(default=None),
- end_datetime: Union[datetime, None] = Body(default=None),
+ start_datetime: datetime = Body(),
+ end_datetime: datetime = Body(),
+ process_after: timedelta = Body(),
repeat_at: Union[time, None] = Body(default=None),
- process_after: Union[timedelta, None] = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -21,8 +21,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_an.py b/docs_src/extra_data_types/tutorial001_an.py
index a4c074241..257d0c7c8 100644
--- a/docs_src/extra_data_types/tutorial001_an.py
+++ b/docs_src/extra_data_types/tutorial001_an.py
@@ -11,10 +11,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Annotated[Union[datetime, None], Body()] = None,
- end_datetime: Annotated[Union[datetime, None], Body()] = None,
+ start_datetime: Annotated[datetime, Body()],
+ end_datetime: Annotated[datetime, Body()],
+ process_after: Annotated[timedelta, Body()],
repeat_at: Annotated[Union[time, None], Body()] = None,
- process_after: Annotated[Union[timedelta, None], Body()] = None,
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -22,8 +22,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_an_py310.py b/docs_src/extra_data_types/tutorial001_an_py310.py
index 4f69c40d9..668bf1909 100644
--- a/docs_src/extra_data_types/tutorial001_an_py310.py
+++ b/docs_src/extra_data_types/tutorial001_an_py310.py
@@ -10,10 +10,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Annotated[datetime | None, Body()] = None,
- end_datetime: Annotated[datetime | None, Body()] = None,
+ start_datetime: Annotated[datetime, Body()],
+ end_datetime: Annotated[datetime, Body()],
+ process_after: Annotated[timedelta, Body()],
repeat_at: Annotated[time | None, Body()] = None,
- process_after: Annotated[timedelta | None, Body()] = None,
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -21,8 +21,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_an_py39.py b/docs_src/extra_data_types/tutorial001_an_py39.py
index 630d36ae3..fa3551d66 100644
--- a/docs_src/extra_data_types/tutorial001_an_py39.py
+++ b/docs_src/extra_data_types/tutorial001_an_py39.py
@@ -10,10 +10,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: Annotated[Union[datetime, None], Body()] = None,
- end_datetime: Annotated[Union[datetime, None], Body()] = None,
+ start_datetime: Annotated[datetime, Body()],
+ end_datetime: Annotated[datetime, Body()],
+ process_after: Annotated[timedelta, Body()],
repeat_at: Annotated[Union[time, None], Body()] = None,
- process_after: Annotated[Union[timedelta, None], Body()] = None,
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -21,8 +21,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/extra_data_types/tutorial001_py310.py b/docs_src/extra_data_types/tutorial001_py310.py
index d22f81888..a275a0577 100644
--- a/docs_src/extra_data_types/tutorial001_py310.py
+++ b/docs_src/extra_data_types/tutorial001_py310.py
@@ -9,10 +9,10 @@ app = FastAPI()
@app.put("/items/{item_id}")
async def read_items(
item_id: UUID,
- start_datetime: datetime | None = Body(default=None),
- end_datetime: datetime | None = Body(default=None),
+ start_datetime: datetime = Body(),
+ end_datetime: datetime = Body(),
+ process_after: timedelta = Body(),
repeat_at: time | None = Body(default=None),
- process_after: timedelta | None = Body(default=None),
):
start_process = start_datetime + process_after
duration = end_datetime - start_process
@@ -20,8 +20,8 @@ async def read_items(
"item_id": item_id,
"start_datetime": start_datetime,
"end_datetime": end_datetime,
- "repeat_at": repeat_at,
"process_after": process_after,
+ "repeat_at": repeat_at,
"start_process": start_process,
"duration": duration,
}
diff --git a/docs_src/generate_clients/tutorial004.js b/docs_src/generate_clients/tutorial004.js
index 18dc38267..fa222ba6c 100644
--- a/docs_src/generate_clients/tutorial004.js
+++ b/docs_src/generate_clients/tutorial004.js
@@ -1,29 +1,36 @@
-import * as fs from "fs";
+import * as fs from 'fs'
-const filePath = "./openapi.json";
+async function modifyOpenAPIFile(filePath) {
+ try {
+ const data = await fs.promises.readFile(filePath)
+ const openapiContent = JSON.parse(data)
-fs.readFile(filePath, (err, data) => {
- const openapiContent = JSON.parse(data);
- if (err) throw err;
-
- const paths = openapiContent.paths;
-
- Object.keys(paths).forEach((pathKey) => {
- const pathData = paths[pathKey];
- Object.keys(pathData).forEach((method) => {
- const operation = pathData[method];
- if (operation.tags && operation.tags.length > 0) {
- const tag = operation.tags[0];
- const operationId = operation.operationId;
- const toRemove = `${tag}-`;
- if (operationId.startsWith(toRemove)) {
- const newOperationId = operationId.substring(toRemove.length);
- operation.operationId = newOperationId;
+ const paths = openapiContent.paths
+ for (const pathKey of Object.keys(paths)) {
+ const pathData = paths[pathKey]
+ for (const method of Object.keys(pathData)) {
+ const operation = pathData[method]
+ if (operation.tags && operation.tags.length > 0) {
+ const tag = operation.tags[0]
+ const operationId = operation.operationId
+ const toRemove = `${tag}-`
+ if (operationId.startsWith(toRemove)) {
+ const newOperationId = operationId.substring(toRemove.length)
+ operation.operationId = newOperationId
+ }
}
}
- });
- });
- fs.writeFile(filePath, JSON.stringify(openapiContent, null, 2), (err) => {
- if (err) throw err;
- });
-});
+ }
+
+ await fs.promises.writeFile(
+ filePath,
+ JSON.stringify(openapiContent, null, 2),
+ )
+ console.log('File successfully modified')
+ } catch (err) {
+ console.error('Error:', err)
+ }
+}
+
+const filePath = './openapi.json'
+modifyOpenAPIFile(filePath)
diff --git a/docs_src/header_params/tutorial002.py b/docs_src/header_params/tutorial002.py
index 639ab1735..0a34f17cc 100644
--- a/docs_src/header_params/tutorial002.py
+++ b/docs_src/header_params/tutorial002.py
@@ -7,6 +7,6 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- strange_header: Union[str, None] = Header(default=None, convert_underscores=False)
+ strange_header: Union[str, None] = Header(default=None, convert_underscores=False),
):
return {"strange_header": strange_header}
diff --git a/docs_src/header_params/tutorial002_an_py310.py b/docs_src/header_params/tutorial002_an_py310.py
index b340647b6..8a102749f 100644
--- a/docs_src/header_params/tutorial002_an_py310.py
+++ b/docs_src/header_params/tutorial002_an_py310.py
@@ -7,6 +7,6 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- strange_header: Annotated[str | None, Header(convert_underscores=False)] = None
+ strange_header: Annotated[str | None, Header(convert_underscores=False)] = None,
):
return {"strange_header": strange_header}
diff --git a/docs_src/header_params/tutorial002_py310.py b/docs_src/header_params/tutorial002_py310.py
index b7979b542..10d6716c6 100644
--- a/docs_src/header_params/tutorial002_py310.py
+++ b/docs_src/header_params/tutorial002_py310.py
@@ -5,6 +5,6 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- strange_header: str | None = Header(default=None, convert_underscores=False)
+ strange_header: str | None = Header(default=None, convert_underscores=False),
):
return {"strange_header": strange_header}
diff --git a/docs_src/path_operation_advanced_configuration/tutorial007.py b/docs_src/path_operation_advanced_configuration/tutorial007.py
index 972ddbd2c..54e2e9399 100644
--- a/docs_src/path_operation_advanced_configuration/tutorial007.py
+++ b/docs_src/path_operation_advanced_configuration/tutorial007.py
@@ -30,5 +30,5 @@ async def create_item(request: Request):
try:
item = Item.model_validate(data)
except ValidationError as e:
- raise HTTPException(status_code=422, detail=e.errors())
+ raise HTTPException(status_code=422, detail=e.errors(include_url=False))
return item
diff --git a/docs_src/query_params_str_validations/tutorial003.py b/docs_src/query_params_str_validations/tutorial003.py
index 73d2e08c8..7d4917373 100644
--- a/docs_src/query_params_str_validations/tutorial003.py
+++ b/docs_src/query_params_str_validations/tutorial003.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Union[str, None] = Query(default=None, min_length=3, max_length=50)
+ q: Union[str, None] = Query(default=None, min_length=3, max_length=50),
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial003_an.py b/docs_src/query_params_str_validations/tutorial003_an.py
index a3665f6a8..0dd14086c 100644
--- a/docs_src/query_params_str_validations/tutorial003_an.py
+++ b/docs_src/query_params_str_validations/tutorial003_an.py
@@ -8,7 +8,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None
+ q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None,
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial003_an_py310.py b/docs_src/query_params_str_validations/tutorial003_an_py310.py
index 836af04de..79a604b6c 100644
--- a/docs_src/query_params_str_validations/tutorial003_an_py310.py
+++ b/docs_src/query_params_str_validations/tutorial003_an_py310.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Annotated[str | None, Query(min_length=3, max_length=50)] = None
+ q: Annotated[str | None, Query(min_length=3, max_length=50)] = None,
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial003_an_py39.py b/docs_src/query_params_str_validations/tutorial003_an_py39.py
index 87a426839..3d6697793 100644
--- a/docs_src/query_params_str_validations/tutorial003_an_py39.py
+++ b/docs_src/query_params_str_validations/tutorial003_an_py39.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None
+ q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None,
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial007.py b/docs_src/query_params_str_validations/tutorial007.py
index cb836569e..27b649e14 100644
--- a/docs_src/query_params_str_validations/tutorial007.py
+++ b/docs_src/query_params_str_validations/tutorial007.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Union[str, None] = Query(default=None, title="Query string", min_length=3)
+ q: Union[str, None] = Query(default=None, title="Query string", min_length=3),
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial007_an.py b/docs_src/query_params_str_validations/tutorial007_an.py
index 3bc85cc0c..4b3c8de4b 100644
--- a/docs_src/query_params_str_validations/tutorial007_an.py
+++ b/docs_src/query_params_str_validations/tutorial007_an.py
@@ -8,7 +8,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None
+ q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None,
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial007_an_py310.py b/docs_src/query_params_str_validations/tutorial007_an_py310.py
index 5933911fd..ef18e500d 100644
--- a/docs_src/query_params_str_validations/tutorial007_an_py310.py
+++ b/docs_src/query_params_str_validations/tutorial007_an_py310.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Annotated[str | None, Query(title="Query string", min_length=3)] = None
+ q: Annotated[str | None, Query(title="Query string", min_length=3)] = None,
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial007_an_py39.py b/docs_src/query_params_str_validations/tutorial007_an_py39.py
index dafa1c5c9..8d7a82c46 100644
--- a/docs_src/query_params_str_validations/tutorial007_an_py39.py
+++ b/docs_src/query_params_str_validations/tutorial007_an_py39.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None
+ q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None,
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial007_py310.py b/docs_src/query_params_str_validations/tutorial007_py310.py
index e3e1ef2e0..c283576d5 100644
--- a/docs_src/query_params_str_validations/tutorial007_py310.py
+++ b/docs_src/query_params_str_validations/tutorial007_py310.py
@@ -5,7 +5,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- q: str | None = Query(default=None, title="Query string", min_length=3)
+ q: str | None = Query(default=None, title="Query string", min_length=3),
):
results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
if q:
diff --git a/docs_src/query_params_str_validations/tutorial014.py b/docs_src/query_params_str_validations/tutorial014.py
index 50e0a6c2b..779db1c80 100644
--- a/docs_src/query_params_str_validations/tutorial014.py
+++ b/docs_src/query_params_str_validations/tutorial014.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- hidden_query: Union[str, None] = Query(default=None, include_in_schema=False)
+ hidden_query: Union[str, None] = Query(default=None, include_in_schema=False),
):
if hidden_query:
return {"hidden_query": hidden_query}
diff --git a/docs_src/query_params_str_validations/tutorial014_an.py b/docs_src/query_params_str_validations/tutorial014_an.py
index a9a9c4427..2eaa58540 100644
--- a/docs_src/query_params_str_validations/tutorial014_an.py
+++ b/docs_src/query_params_str_validations/tutorial014_an.py
@@ -8,7 +8,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None
+ hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None,
):
if hidden_query:
return {"hidden_query": hidden_query}
diff --git a/docs_src/query_params_str_validations/tutorial014_an_py310.py b/docs_src/query_params_str_validations/tutorial014_an_py310.py
index 5fba54150..e728dbdb5 100644
--- a/docs_src/query_params_str_validations/tutorial014_an_py310.py
+++ b/docs_src/query_params_str_validations/tutorial014_an_py310.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None
+ hidden_query: Annotated[str | None, Query(include_in_schema=False)] = None,
):
if hidden_query:
return {"hidden_query": hidden_query}
diff --git a/docs_src/query_params_str_validations/tutorial014_an_py39.py b/docs_src/query_params_str_validations/tutorial014_an_py39.py
index b07985210..aaf7703a5 100644
--- a/docs_src/query_params_str_validations/tutorial014_an_py39.py
+++ b/docs_src/query_params_str_validations/tutorial014_an_py39.py
@@ -7,7 +7,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None
+ hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None,
):
if hidden_query:
return {"hidden_query": hidden_query}
diff --git a/docs_src/query_params_str_validations/tutorial014_py310.py b/docs_src/query_params_str_validations/tutorial014_py310.py
index 1b617efdd..97bb3386e 100644
--- a/docs_src/query_params_str_validations/tutorial014_py310.py
+++ b/docs_src/query_params_str_validations/tutorial014_py310.py
@@ -5,7 +5,7 @@ app = FastAPI()
@app.get("/items/")
async def read_items(
- hidden_query: str | None = Query(default=None, include_in_schema=False)
+ hidden_query: str | None = Query(default=None, include_in_schema=False),
):
if hidden_query:
return {"hidden_query": hidden_query}
diff --git a/docs_src/security/tutorial003_an.py b/docs_src/security/tutorial003_an.py
index 261cb4857..8fb40dd4a 100644
--- a/docs_src/security/tutorial003_an.py
+++ b/docs_src/security/tutorial003_an.py
@@ -68,7 +68,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
async def get_current_active_user(
- current_user: Annotated[User, Depends(get_current_user)]
+ current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -90,6 +90,6 @@ async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
@app.get("/users/me")
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
diff --git a/docs_src/security/tutorial003_an_py310.py b/docs_src/security/tutorial003_an_py310.py
index a03f4f8bf..ced4a2fbc 100644
--- a/docs_src/security/tutorial003_an_py310.py
+++ b/docs_src/security/tutorial003_an_py310.py
@@ -67,7 +67,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
async def get_current_active_user(
- current_user: Annotated[User, Depends(get_current_user)]
+ current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -89,6 +89,6 @@ async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
@app.get("/users/me")
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
diff --git a/docs_src/security/tutorial003_an_py39.py b/docs_src/security/tutorial003_an_py39.py
index 308dbe798..068a3933e 100644
--- a/docs_src/security/tutorial003_an_py39.py
+++ b/docs_src/security/tutorial003_an_py39.py
@@ -67,7 +67,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
async def get_current_active_user(
- current_user: Annotated[User, Depends(get_current_user)]
+ current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -89,6 +89,6 @@ async def login(form_data: Annotated[OAuth2PasswordRequestForm, Depends()]):
@app.get("/users/me")
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
diff --git a/docs_src/security/tutorial004.py b/docs_src/security/tutorial004.py
index 044eec700..d0fbaa572 100644
--- a/docs_src/security/tutorial004.py
+++ b/docs_src/security/tutorial004.py
@@ -114,7 +114,7 @@ async def get_current_active_user(current_user: User = Depends(get_current_user)
@app.post("/token")
async def login_for_access_token(
- form_data: OAuth2PasswordRequestForm = Depends()
+ form_data: OAuth2PasswordRequestForm = Depends(),
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
diff --git a/docs_src/security/tutorial004_an.py b/docs_src/security/tutorial004_an.py
index c78e8496c..eebd36d64 100644
--- a/docs_src/security/tutorial004_an.py
+++ b/docs_src/security/tutorial004_an.py
@@ -108,7 +108,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
async def get_current_active_user(
- current_user: Annotated[User, Depends(get_current_user)]
+ current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -117,7 +117,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -135,13 +135,13 @@ async def login_for_access_token(
@app.get("/users/me/", response_model=User)
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
@app.get("/users/me/items/")
async def read_own_items(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial004_an_py310.py b/docs_src/security/tutorial004_an_py310.py
index 36dbc677e..4e50ada7c 100644
--- a/docs_src/security/tutorial004_an_py310.py
+++ b/docs_src/security/tutorial004_an_py310.py
@@ -107,7 +107,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
async def get_current_active_user(
- current_user: Annotated[User, Depends(get_current_user)]
+ current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -116,7 +116,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -134,13 +134,13 @@ async def login_for_access_token(
@app.get("/users/me/", response_model=User)
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
@app.get("/users/me/items/")
async def read_own_items(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial004_an_py39.py b/docs_src/security/tutorial004_an_py39.py
index 23fc04a72..eb49aaa67 100644
--- a/docs_src/security/tutorial004_an_py39.py
+++ b/docs_src/security/tutorial004_an_py39.py
@@ -107,7 +107,7 @@ async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]):
async def get_current_active_user(
- current_user: Annotated[User, Depends(get_current_user)]
+ current_user: Annotated[User, Depends(get_current_user)],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -116,7 +116,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -134,13 +134,13 @@ async def login_for_access_token(
@app.get("/users/me/", response_model=User)
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
@app.get("/users/me/items/")
async def read_own_items(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial004_py310.py b/docs_src/security/tutorial004_py310.py
index 8363d45ab..5a905783d 100644
--- a/docs_src/security/tutorial004_py310.py
+++ b/docs_src/security/tutorial004_py310.py
@@ -113,7 +113,7 @@ async def get_current_active_user(current_user: User = Depends(get_current_user)
@app.post("/token")
async def login_for_access_token(
- form_data: OAuth2PasswordRequestForm = Depends()
+ form_data: OAuth2PasswordRequestForm = Depends(),
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
diff --git a/docs_src/security/tutorial005.py b/docs_src/security/tutorial005.py
index b16bf440a..d4a6975da 100644
--- a/docs_src/security/tutorial005.py
+++ b/docs_src/security/tutorial005.py
@@ -136,7 +136,7 @@ async def get_current_user(
async def get_current_active_user(
- current_user: User = Security(get_current_user, scopes=["me"])
+ current_user: User = Security(get_current_user, scopes=["me"]),
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -145,7 +145,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: OAuth2PasswordRequestForm = Depends()
+ form_data: OAuth2PasswordRequestForm = Depends(),
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -165,7 +165,7 @@ async def read_users_me(current_user: User = Depends(get_current_active_user)):
@app.get("/users/me/items/")
async def read_own_items(
- current_user: User = Security(get_current_active_user, scopes=["items"])
+ current_user: User = Security(get_current_active_user, scopes=["items"]),
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial005_an.py b/docs_src/security/tutorial005_an.py
index 95e406b32..982daed2f 100644
--- a/docs_src/security/tutorial005_an.py
+++ b/docs_src/security/tutorial005_an.py
@@ -137,7 +137,7 @@ async def get_current_user(
async def get_current_active_user(
- current_user: Annotated[User, Security(get_current_user, scopes=["me"])]
+ current_user: Annotated[User, Security(get_current_user, scopes=["me"])],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -146,7 +146,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -161,14 +161,14 @@ async def login_for_access_token(
@app.get("/users/me/", response_model=User)
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
@app.get("/users/me/items/")
async def read_own_items(
- current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])]
+ current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])],
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial005_an_py310.py b/docs_src/security/tutorial005_an_py310.py
index c6116a5ed..79aafbff1 100644
--- a/docs_src/security/tutorial005_an_py310.py
+++ b/docs_src/security/tutorial005_an_py310.py
@@ -136,7 +136,7 @@ async def get_current_user(
async def get_current_active_user(
- current_user: Annotated[User, Security(get_current_user, scopes=["me"])]
+ current_user: Annotated[User, Security(get_current_user, scopes=["me"])],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -145,7 +145,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -160,14 +160,14 @@ async def login_for_access_token(
@app.get("/users/me/", response_model=User)
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
@app.get("/users/me/items/")
async def read_own_items(
- current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])]
+ current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])],
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial005_an_py39.py b/docs_src/security/tutorial005_an_py39.py
index af51c08b5..3bdab5507 100644
--- a/docs_src/security/tutorial005_an_py39.py
+++ b/docs_src/security/tutorial005_an_py39.py
@@ -136,7 +136,7 @@ async def get_current_user(
async def get_current_active_user(
- current_user: Annotated[User, Security(get_current_user, scopes=["me"])]
+ current_user: Annotated[User, Security(get_current_user, scopes=["me"])],
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -145,7 +145,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -160,14 +160,14 @@ async def login_for_access_token(
@app.get("/users/me/", response_model=User)
async def read_users_me(
- current_user: Annotated[User, Depends(get_current_active_user)]
+ current_user: Annotated[User, Depends(get_current_active_user)],
):
return current_user
@app.get("/users/me/items/")
async def read_own_items(
- current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])]
+ current_user: Annotated[User, Security(get_current_active_user, scopes=["items"])],
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial005_py310.py b/docs_src/security/tutorial005_py310.py
index 37a22c709..9f75aa0be 100644
--- a/docs_src/security/tutorial005_py310.py
+++ b/docs_src/security/tutorial005_py310.py
@@ -135,7 +135,7 @@ async def get_current_user(
async def get_current_active_user(
- current_user: User = Security(get_current_user, scopes=["me"])
+ current_user: User = Security(get_current_user, scopes=["me"]),
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -144,7 +144,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: OAuth2PasswordRequestForm = Depends()
+ form_data: OAuth2PasswordRequestForm = Depends(),
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -164,7 +164,7 @@ async def read_users_me(current_user: User = Depends(get_current_active_user)):
@app.get("/users/me/items/")
async def read_own_items(
- current_user: User = Security(get_current_active_user, scopes=["items"])
+ current_user: User = Security(get_current_active_user, scopes=["items"]),
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial005_py39.py b/docs_src/security/tutorial005_py39.py
index c27580763..bac248932 100644
--- a/docs_src/security/tutorial005_py39.py
+++ b/docs_src/security/tutorial005_py39.py
@@ -136,7 +136,7 @@ async def get_current_user(
async def get_current_active_user(
- current_user: User = Security(get_current_user, scopes=["me"])
+ current_user: User = Security(get_current_user, scopes=["me"]),
):
if current_user.disabled:
raise HTTPException(status_code=400, detail="Inactive user")
@@ -145,7 +145,7 @@ async def get_current_active_user(
@app.post("/token")
async def login_for_access_token(
- form_data: OAuth2PasswordRequestForm = Depends()
+ form_data: OAuth2PasswordRequestForm = Depends(),
) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
@@ -165,7 +165,7 @@ async def read_users_me(current_user: User = Depends(get_current_active_user)):
@app.get("/users/me/items/")
async def read_own_items(
- current_user: User = Security(get_current_active_user, scopes=["items"])
+ current_user: User = Security(get_current_active_user, scopes=["items"]),
):
return [{"item_id": "Foo", "owner": current_user.username}]
diff --git a/docs_src/security/tutorial007_an.py b/docs_src/security/tutorial007_an.py
index 9e9c3cd70..0d211dfde 100644
--- a/docs_src/security/tutorial007_an.py
+++ b/docs_src/security/tutorial007_an.py
@@ -10,7 +10,7 @@ security = HTTPBasic()
def get_current_username(
- credentials: Annotated[HTTPBasicCredentials, Depends(security)]
+ credentials: Annotated[HTTPBasicCredentials, Depends(security)],
):
current_username_bytes = credentials.username.encode("utf8")
correct_username_bytes = b"stanleyjobson"
diff --git a/docs_src/security/tutorial007_an_py39.py b/docs_src/security/tutorial007_an_py39.py
index 3d9ea2726..87ef98657 100644
--- a/docs_src/security/tutorial007_an_py39.py
+++ b/docs_src/security/tutorial007_an_py39.py
@@ -10,7 +10,7 @@ security = HTTPBasic()
def get_current_username(
- credentials: Annotated[HTTPBasicCredentials, Depends(security)]
+ credentials: Annotated[HTTPBasicCredentials, Depends(security)],
):
current_username_bytes = credentials.username.encode("utf8")
correct_username_bytes = b"stanleyjobson"
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index f457fafd4..f28657712 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.109.0"
+__version__ = "0.110.2"
from starlette import status as status
diff --git a/fastapi/_compat.py b/fastapi/_compat.py
index 35d4a8723..06b847b4f 100644
--- a/fastapi/_compat.py
+++ b/fastapi/_compat.py
@@ -20,10 +20,12 @@ from typing import (
from fastapi.exceptions import RequestErrorModel
from fastapi.types import IncEx, ModelNameMap, UnionType
from pydantic import BaseModel, create_model
-from pydantic.version import VERSION as PYDANTIC_VERSION
+from pydantic.version import VERSION as P_VERSION
from starlette.datastructures import UploadFile
from typing_extensions import Annotated, Literal, get_args, get_origin
+# Reassign variable to make it reexported for mypy
+PYDANTIC_VERSION = P_VERSION
PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.")
@@ -127,7 +129,7 @@ if PYDANTIC_V2:
)
except ValidationError as exc:
return None, _regenerate_error_with_loc(
- errors=exc.errors(), loc_prefix=loc
+ errors=exc.errors(include_url=False), loc_prefix=loc
)
def serialize(
@@ -266,7 +268,7 @@ if PYDANTIC_V2:
def get_missing_field_error(loc: Tuple[str, ...]) -> Dict[str, Any]:
error = ValidationError.from_exception_data(
"Field required", [{"type": "missing", "loc": loc, "input": {}}]
- ).errors()[0]
+ ).errors(include_url=False)[0]
error["input"] = None
return error # type: ignore[return-value]
diff --git a/fastapi/applications.py b/fastapi/applications.py
index 597c60a56..4446cacfb 100644
--- a/fastapi/applications.py
+++ b/fastapi/applications.py
@@ -40,7 +40,7 @@ from starlette.requests import Request
from starlette.responses import HTMLResponse, JSONResponse, Response
from starlette.routing import BaseRoute
from starlette.types import ASGIApp, Lifespan, Receive, Scope, Send
-from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc, deprecated
AppType = TypeVar("AppType", bound="FastAPI")
@@ -297,7 +297,7 @@ class FastAPI(Starlette):
browser tabs open). Or if you want to leave fixed the possible URLs.
If the servers `list` is not provided, or is an empty `list`, the
- default value would be a a `dict` with a `url` value of `/`.
+ default value would be a `dict` with a `url` value of `/`.
Each item in the `list` is a `dict` containing:
@@ -1019,7 +1019,7 @@ class FastAPI(Starlette):
oauth2_redirect_url = root_path + oauth2_redirect_url
return get_swagger_ui_html(
openapi_url=openapi_url,
- title=self.title + " - Swagger UI",
+ title=f"{self.title} - Swagger UI",
oauth2_redirect_url=oauth2_redirect_url,
init_oauth=self.swagger_ui_init_oauth,
swagger_ui_parameters=self.swagger_ui_parameters,
@@ -1043,7 +1043,7 @@ class FastAPI(Starlette):
root_path = req.scope.get("root_path", "").rstrip("/")
openapi_url = root_path + self.openapi_url
return get_redoc_html(
- openapi_url=openapi_url, title=self.title + " - ReDoc"
+ openapi_url=openapi_url, title=f"{self.title} - ReDoc"
)
self.add_route(self.redoc_url, redoc_html, include_in_schema=False)
diff --git a/fastapi/background.py b/fastapi/background.py
index 35ab1b227..203578a41 100644
--- a/fastapi/background.py
+++ b/fastapi/background.py
@@ -1,7 +1,7 @@
from typing import Any, Callable
from starlette.background import BackgroundTasks as StarletteBackgroundTasks
-from typing_extensions import Annotated, Doc, ParamSpec # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc, ParamSpec
P = ParamSpec("P")
diff --git a/fastapi/datastructures.py b/fastapi/datastructures.py
index ce03e3ce4..cf8406b0f 100644
--- a/fastapi/datastructures.py
+++ b/fastapi/datastructures.py
@@ -24,7 +24,7 @@ from starlette.datastructures import Headers as Headers # noqa: F401
from starlette.datastructures import QueryParams as QueryParams # noqa: F401
from starlette.datastructures import State as State # noqa: F401
from starlette.datastructures import UploadFile as StarletteUploadFile
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
class UploadFile(StarletteUploadFile):
diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py
index b73473484..4f984177a 100644
--- a/fastapi/dependencies/utils.py
+++ b/fastapi/dependencies/utils.py
@@ -1,6 +1,6 @@
import inspect
from contextlib import AsyncExitStack, contextmanager
-from copy import deepcopy
+from copy import copy, deepcopy
from typing import (
Any,
Callable,
@@ -384,6 +384,8 @@ def analyze_param(
field_info.annotation = type_annotation
if depends is not None and depends.dependency is None:
+ # Copy `depends` before mutating it
+ depends = copy(depends)
depends.dependency = type_annotation
if lenient_issubclass(
@@ -743,7 +745,7 @@ async def request_body_to_args(
results: List[Union[bytes, str]] = []
async def process_fn(
- fn: Callable[[], Coroutine[Any, Any, Any]]
+ fn: Callable[[], Coroutine[Any, Any, Any]],
) -> None:
result = await fn()
results.append(result) # noqa: B023
diff --git a/fastapi/encoders.py b/fastapi/encoders.py
index e50171393..451ea0760 100644
--- a/fastapi/encoders.py
+++ b/fastapi/encoders.py
@@ -22,9 +22,9 @@ from pydantic import BaseModel
from pydantic.color import Color
from pydantic.networks import AnyUrl, NameEmail
from pydantic.types import SecretBytes, SecretStr
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
-from ._compat import PYDANTIC_V2, Url, _model_dump
+from ._compat import PYDANTIC_V2, UndefinedType, Url, _model_dump
# Taken from Pydantic v1 as is
@@ -86,7 +86,7 @@ ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
def generate_encoders_by_class_tuples(
- type_encoder_map: Dict[Any, Callable[[Any], Any]]
+ type_encoder_map: Dict[Any, Callable[[Any], Any]],
) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]:
encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(
tuple
@@ -259,6 +259,8 @@ def jsonable_encoder(
return str(obj)
if isinstance(obj, (str, int, float, type(None))):
return obj
+ if isinstance(obj, UndefinedType):
+ return None
if isinstance(obj, dict):
encoded_dict = {}
allowed_keys = set(obj.keys())
diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py
index 680d288e4..44d4ada86 100644
--- a/fastapi/exceptions.py
+++ b/fastapi/exceptions.py
@@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Sequence, Type, Union
from pydantic import BaseModel, create_model
from starlette.exceptions import HTTPException as StarletteHTTPException
from starlette.exceptions import WebSocketException as StarletteWebSocketException
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
class HTTPException(StarletteHTTPException):
diff --git a/fastapi/openapi/docs.py b/fastapi/openapi/docs.py
index 69473d19c..67815e0fb 100644
--- a/fastapi/openapi/docs.py
+++ b/fastapi/openapi/docs.py
@@ -3,7 +3,7 @@ from typing import Any, Dict, Optional
from fastapi.encoders import jsonable_encoder
from starlette.responses import HTMLResponse
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
swagger_ui_default_parameters: Annotated[
Dict[str, Any],
diff --git a/fastapi/openapi/models.py b/fastapi/openapi/models.py
index 5f3bdbb20..ed07b40f5 100644
--- a/fastapi/openapi/models.py
+++ b/fastapi/openapi/models.py
@@ -55,35 +55,29 @@ except ImportError: # pragma: no cover
return with_info_plain_validator_function(cls._validate)
-class Contact(BaseModel):
+class BaseModelWithConfig(BaseModel):
+ if PYDANTIC_V2:
+ model_config = {"extra": "allow"}
+
+ else:
+
+ class Config:
+ extra = "allow"
+
+
+class Contact(BaseModelWithConfig):
name: Optional[str] = None
url: Optional[AnyUrl] = None
email: Optional[EmailStr] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class License(BaseModel):
+class License(BaseModelWithConfig):
name: str
identifier: Optional[str] = None
url: Optional[AnyUrl] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Info(BaseModel):
+class Info(BaseModelWithConfig):
title: str
summary: Optional[str] = None
description: Optional[str] = None
@@ -92,42 +86,18 @@ class Info(BaseModel):
license: Optional[License] = None
version: str
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class ServerVariable(BaseModel):
+class ServerVariable(BaseModelWithConfig):
enum: Annotated[Optional[List[str]], Field(min_length=1)] = None
default: str
description: Optional[str] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Server(BaseModel):
+class Server(BaseModelWithConfig):
url: Union[AnyUrl, str]
description: Optional[str] = None
variables: Optional[Dict[str, ServerVariable]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class Reference(BaseModel):
ref: str = Field(alias="$ref")
@@ -138,36 +108,20 @@ class Discriminator(BaseModel):
mapping: Optional[Dict[str, str]] = None
-class XML(BaseModel):
+class XML(BaseModelWithConfig):
name: Optional[str] = None
namespace: Optional[str] = None
prefix: Optional[str] = None
attribute: Optional[bool] = None
wrapped: Optional[bool] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class ExternalDocumentation(BaseModel):
+class ExternalDocumentation(BaseModelWithConfig):
description: Optional[str] = None
url: AnyUrl
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Schema(BaseModel):
+class Schema(BaseModelWithConfig):
# Ref: JSON Schema 2020-12: https://json-schema.org/draft/2020-12/json-schema-core.html#name-the-json-schema-core-vocabu
# Core Vocabulary
schema_: Optional[str] = Field(default=None, alias="$schema")
@@ -253,14 +207,6 @@ class Schema(BaseModel):
),
] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
# Ref: https://json-schema.org/draft/2020-12/json-schema-core.html#name-json-schema-documents
# A JSON Schema MUST be an object or a boolean.
@@ -289,38 +235,22 @@ class ParameterInType(Enum):
cookie = "cookie"
-class Encoding(BaseModel):
+class Encoding(BaseModelWithConfig):
contentType: Optional[str] = None
headers: Optional[Dict[str, Union["Header", Reference]]] = None
style: Optional[str] = None
explode: Optional[bool] = None
allowReserved: Optional[bool] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class MediaType(BaseModel):
+class MediaType(BaseModelWithConfig):
schema_: Optional[Union[Schema, Reference]] = Field(default=None, alias="schema")
example: Optional[Any] = None
examples: Optional[Dict[str, Union[Example, Reference]]] = None
encoding: Optional[Dict[str, Encoding]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class ParameterBase(BaseModel):
+class ParameterBase(BaseModelWithConfig):
description: Optional[str] = None
required: Optional[bool] = None
deprecated: Optional[bool] = None
@@ -334,14 +264,6 @@ class ParameterBase(BaseModel):
# Serialization rules for more complex scenarios
content: Optional[Dict[str, MediaType]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class Parameter(ParameterBase):
name: str
@@ -352,21 +274,13 @@ class Header(ParameterBase):
pass
-class RequestBody(BaseModel):
+class RequestBody(BaseModelWithConfig):
description: Optional[str] = None
content: Dict[str, MediaType]
required: Optional[bool] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Link(BaseModel):
+class Link(BaseModelWithConfig):
operationRef: Optional[str] = None
operationId: Optional[str] = None
parameters: Optional[Dict[str, Union[Any, str]]] = None
@@ -374,31 +288,15 @@ class Link(BaseModel):
description: Optional[str] = None
server: Optional[Server] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Response(BaseModel):
+class Response(BaseModelWithConfig):
description: str
headers: Optional[Dict[str, Union[Header, Reference]]] = None
content: Optional[Dict[str, MediaType]] = None
links: Optional[Dict[str, Union[Link, Reference]]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Operation(BaseModel):
+class Operation(BaseModelWithConfig):
tags: Optional[List[str]] = None
summary: Optional[str] = None
description: Optional[str] = None
@@ -413,16 +311,8 @@ class Operation(BaseModel):
security: Optional[List[Dict[str, List[str]]]] = None
servers: Optional[List[Server]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class PathItem(BaseModel):
+class PathItem(BaseModelWithConfig):
ref: Optional[str] = Field(default=None, alias="$ref")
summary: Optional[str] = None
description: Optional[str] = None
@@ -437,14 +327,6 @@ class PathItem(BaseModel):
servers: Optional[List[Server]] = None
parameters: Optional[List[Union[Parameter, Reference]]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class SecuritySchemeType(Enum):
apiKey = "apiKey"
@@ -453,18 +335,10 @@ class SecuritySchemeType(Enum):
openIdConnect = "openIdConnect"
-class SecurityBase(BaseModel):
+class SecurityBase(BaseModelWithConfig):
type_: SecuritySchemeType = Field(alias="type")
description: Optional[str] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class APIKeyIn(Enum):
query = "query"
@@ -488,18 +362,10 @@ class HTTPBearer(HTTPBase):
bearerFormat: Optional[str] = None
-class OAuthFlow(BaseModel):
+class OAuthFlow(BaseModelWithConfig):
refreshUrl: Optional[str] = None
scopes: Dict[str, str] = {}
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class OAuthFlowImplicit(OAuthFlow):
authorizationUrl: str
@@ -518,20 +384,12 @@ class OAuthFlowAuthorizationCode(OAuthFlow):
tokenUrl: str
-class OAuthFlows(BaseModel):
+class OAuthFlows(BaseModelWithConfig):
implicit: Optional[OAuthFlowImplicit] = None
password: Optional[OAuthFlowPassword] = None
clientCredentials: Optional[OAuthFlowClientCredentials] = None
authorizationCode: Optional[OAuthFlowAuthorizationCode] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
class OAuth2(SecurityBase):
type_: SecuritySchemeType = Field(default=SecuritySchemeType.oauth2, alias="type")
@@ -548,7 +406,7 @@ class OpenIdConnect(SecurityBase):
SecurityScheme = Union[APIKey, HTTPBase, OAuth2, OpenIdConnect, HTTPBearer]
-class Components(BaseModel):
+class Components(BaseModelWithConfig):
schemas: Optional[Dict[str, Union[Schema, Reference]]] = None
responses: Optional[Dict[str, Union[Response, Reference]]] = None
parameters: Optional[Dict[str, Union[Parameter, Reference]]] = None
@@ -561,30 +419,14 @@ class Components(BaseModel):
callbacks: Optional[Dict[str, Union[Dict[str, PathItem], Reference, Any]]] = None
pathItems: Optional[Dict[str, Union[PathItem, Reference]]] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class Tag(BaseModel):
+class Tag(BaseModelWithConfig):
name: str
description: Optional[str] = None
externalDocs: Optional[ExternalDocumentation] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
- else:
-
- class Config:
- extra = "allow"
-
-
-class OpenAPI(BaseModel):
+class OpenAPI(BaseModelWithConfig):
openapi: str
info: Info
jsonSchemaDialect: Optional[str] = None
@@ -597,14 +439,6 @@ class OpenAPI(BaseModel):
tags: Optional[List[Tag]] = None
externalDocs: Optional[ExternalDocumentation] = None
- if PYDANTIC_V2:
- model_config = {"extra": "allow"}
-
- else:
-
- class Config:
- extra = "allow"
-
_model_rebuild(Schema)
_model_rebuild(Operation)
diff --git a/fastapi/openapi/utils.py b/fastapi/openapi/utils.py
index 5bfb5acef..79ad9f83f 100644
--- a/fastapi/openapi/utils.py
+++ b/fastapi/openapi/utils.py
@@ -123,7 +123,7 @@ def get_openapi_operation_parameters(
elif field_info.example != Undefined:
parameter["example"] = jsonable_encoder(field_info.example)
if field_info.deprecated:
- parameter["deprecated"] = field_info.deprecated
+ parameter["deprecated"] = True
parameters.append(parameter)
return parameters
diff --git a/fastapi/param_functions.py b/fastapi/param_functions.py
index 3f6dbc959..3b25d774a 100644
--- a/fastapi/param_functions.py
+++ b/fastapi/param_functions.py
@@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Union
from fastapi import params
from fastapi._compat import Undefined
from fastapi.openapi.models import Example
-from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc, deprecated
_Unset: Any = Undefined
@@ -240,7 +240,7 @@ def Path( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -565,7 +565,7 @@ def Query( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -880,7 +880,7 @@ def Header( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -1185,7 +1185,7 @@ def Cookie( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -1512,7 +1512,7 @@ def Body( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -1827,7 +1827,7 @@ def Form( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
@@ -2141,7 +2141,7 @@ def File( # noqa: N802
),
] = None,
deprecated: Annotated[
- Optional[bool],
+ Union[deprecated, str, bool, None],
Doc(
"""
Mark this parameter field as deprecated.
diff --git a/fastapi/params.py b/fastapi/params.py
index b40944dba..860146531 100644
--- a/fastapi/params.py
+++ b/fastapi/params.py
@@ -6,7 +6,7 @@ from fastapi.openapi.models import Example
from pydantic.fields import FieldInfo
from typing_extensions import Annotated, deprecated
-from ._compat import PYDANTIC_V2, Undefined
+from ._compat import PYDANTIC_V2, PYDANTIC_VERSION, Undefined
_Unset: Any = Undefined
@@ -63,12 +63,11 @@ class Param(FieldInfo):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
):
- self.deprecated = deprecated
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
@@ -106,6 +105,10 @@ class Param(FieldInfo):
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
+ if PYDANTIC_VERSION < "2.7.0":
+ self.deprecated = deprecated
+ else:
+ kwargs["deprecated"] = deprecated
if PYDANTIC_V2:
kwargs.update(
{
@@ -174,7 +177,7 @@ class Path(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -260,7 +263,7 @@ class Query(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -345,7 +348,7 @@ class Header(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -430,7 +433,7 @@ class Cookie(Param):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -514,14 +517,13 @@ class Body(FieldInfo):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
):
self.embed = embed
self.media_type = media_type
- self.deprecated = deprecated
if example is not _Unset:
warnings.warn(
"`example` has been deprecated, please use `examples` instead",
@@ -559,6 +561,10 @@ class Body(FieldInfo):
stacklevel=4,
)
current_json_schema_extra = json_schema_extra or extra
+ if PYDANTIC_VERSION < "2.7.0":
+ self.deprecated = deprecated
+ else:
+ kwargs["deprecated"] = deprecated
if PYDANTIC_V2:
kwargs.update(
{
@@ -627,7 +633,7 @@ class Form(Body):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
@@ -712,7 +718,7 @@ class File(Form):
),
] = _Unset,
openapi_examples: Optional[Dict[str, Example]] = None,
- deprecated: Optional[bool] = None,
+ deprecated: Union[deprecated, str, bool, None] = None,
include_in_schema: bool = True,
json_schema_extra: Union[Dict[str, Any], None] = None,
**extra: Any,
diff --git a/fastapi/routing.py b/fastapi/routing.py
index acebabfca..fa1351859 100644
--- a/fastapi/routing.py
+++ b/fastapi/routing.py
@@ -69,7 +69,7 @@ from starlette.routing import (
from starlette.routing import Mount as Mount # noqa
from starlette.types import ASGIApp, Lifespan, Scope
from starlette.websockets import WebSocket
-from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc, deprecated
def _prepare_response_content(
@@ -216,19 +216,14 @@ def get_request_handler(
actual_response_class = response_class
async def app(request: Request) -> Response:
- exception_to_reraise: Optional[Exception] = None
response: Union[Response, None] = None
- async with AsyncExitStack() as async_exit_stack:
- # TODO: remove this scope later, after a few releases
- # This scope fastapi_astack is no longer used by FastAPI, kept for
- # compatibility, just in case
- request.scope["fastapi_astack"] = async_exit_stack
+ async with AsyncExitStack() as file_stack:
try:
body: Any = None
if body_field:
if is_body_form:
body = await request.form()
- async_exit_stack.push_async_callback(body.close)
+ file_stack.push_async_callback(body.close)
else:
body_bytes = await request.body()
if body_bytes:
@@ -260,18 +255,17 @@ def get_request_handler(
],
body=e.doc,
)
- exception_to_reraise = validation_error
raise validation_error from e
- except HTTPException as e:
- exception_to_reraise = e
+ except HTTPException:
+ # If a middleware raises an HTTPException, it should be raised again
raise
except Exception as e:
http_error = HTTPException(
status_code=400, detail="There was an error parsing the body"
)
- exception_to_reraise = http_error
raise http_error from e
- try:
+ errors: List[Any] = []
+ async with AsyncExitStack() as async_exit_stack:
solved_result = await solve_dependencies(
request=request,
dependant=dependant,
@@ -280,59 +274,53 @@ def get_request_handler(
async_exit_stack=async_exit_stack,
)
values, errors, background_tasks, sub_response, _ = solved_result
- except Exception as e:
- exception_to_reraise = e
- raise e
+ if not errors:
+ raw_response = await run_endpoint_function(
+ dependant=dependant, values=values, is_coroutine=is_coroutine
+ )
+ if isinstance(raw_response, Response):
+ if raw_response.background is None:
+ raw_response.background = background_tasks
+ response = raw_response
+ else:
+ response_args: Dict[str, Any] = {"background": background_tasks}
+ # If status_code was set, use it, otherwise use the default from the
+ # response class, in the case of redirect it's 307
+ current_status_code = (
+ status_code if status_code else sub_response.status_code
+ )
+ if current_status_code is not None:
+ response_args["status_code"] = current_status_code
+ if sub_response.status_code:
+ response_args["status_code"] = sub_response.status_code
+ content = await serialize_response(
+ field=response_field,
+ response_content=raw_response,
+ include=response_model_include,
+ exclude=response_model_exclude,
+ by_alias=response_model_by_alias,
+ exclude_unset=response_model_exclude_unset,
+ exclude_defaults=response_model_exclude_defaults,
+ exclude_none=response_model_exclude_none,
+ is_coroutine=is_coroutine,
+ )
+ response = actual_response_class(content, **response_args)
+ if not is_body_allowed_for_status_code(response.status_code):
+ response.body = b""
+ response.headers.raw.extend(sub_response.headers.raw)
if errors:
validation_error = RequestValidationError(
_normalize_errors(errors), body=body
)
- exception_to_reraise = validation_error
raise validation_error
- else:
- try:
- raw_response = await run_endpoint_function(
- dependant=dependant, values=values, is_coroutine=is_coroutine
- )
- except Exception as e:
- exception_to_reraise = e
- raise e
- if isinstance(raw_response, Response):
- if raw_response.background is None:
- raw_response.background = background_tasks
- response = raw_response
- else:
- response_args: Dict[str, Any] = {"background": background_tasks}
- # If status_code was set, use it, otherwise use the default from the
- # response class, in the case of redirect it's 307
- current_status_code = (
- status_code if status_code else sub_response.status_code
- )
- if current_status_code is not None:
- response_args["status_code"] = current_status_code
- if sub_response.status_code:
- response_args["status_code"] = sub_response.status_code
- content = await serialize_response(
- field=response_field,
- response_content=raw_response,
- include=response_model_include,
- exclude=response_model_exclude,
- by_alias=response_model_by_alias,
- exclude_unset=response_model_exclude_unset,
- exclude_defaults=response_model_exclude_defaults,
- exclude_none=response_model_exclude_none,
- is_coroutine=is_coroutine,
- )
- response = actual_response_class(content, **response_args)
- if not is_body_allowed_for_status_code(response.status_code):
- response.body = b""
- response.headers.raw.extend(sub_response.headers.raw)
- # This exception was possibly handled by the dependency but it should
- # still bubble up so that the ServerErrorMiddleware can return a 500
- # or the ExceptionMiddleware can catch and handle any other exceptions
- if exception_to_reraise:
- raise exception_to_reraise
- assert response is not None, "An error occurred while generating the request"
+ if response is None:
+ raise FastAPIError(
+ "No response object was returned. There's a high chance that the "
+ "application code is raising an exception and a dependency with yield "
+ "has a block with a bare except, or a block with except Exception, "
+ "and is not raising the exception again. Read more about it in the "
+ "docs: https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#dependencies-with-yield-and-except"
+ )
return response
return app
diff --git a/fastapi/security/api_key.py b/fastapi/security/api_key.py
index b1a6b4f94..b74a017f1 100644
--- a/fastapi/security/api_key.py
+++ b/fastapi/security/api_key.py
@@ -5,7 +5,7 @@ from fastapi.security.base import SecurityBase
from starlette.exceptions import HTTPException
from starlette.requests import Request
from starlette.status import HTTP_403_FORBIDDEN
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
class APIKeyBase(SecurityBase):
diff --git a/fastapi/security/http.py b/fastapi/security/http.py
index 738455de3..a142b135d 100644
--- a/fastapi/security/http.py
+++ b/fastapi/security/http.py
@@ -10,12 +10,12 @@ from fastapi.security.utils import get_authorization_scheme_param
from pydantic import BaseModel
from starlette.requests import Request
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
class HTTPBasicCredentials(BaseModel):
"""
- The HTTP Basic credendials given as the result of using `HTTPBasic` in a
+ The HTTP Basic credentials given as the result of using `HTTPBasic` in a
dependency.
Read more about it in the
diff --git a/fastapi/security/oauth2.py b/fastapi/security/oauth2.py
index 9281dfb64..9720cace0 100644
--- a/fastapi/security/oauth2.py
+++ b/fastapi/security/oauth2.py
@@ -10,7 +10,7 @@ from starlette.requests import Request
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
# TODO: import from typing when deprecating Python 3.9
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
class OAuth2PasswordRequestForm:
@@ -54,7 +54,7 @@ class OAuth2PasswordRequestForm:
Note that for OAuth2 the scope `items:read` is a single scope in an opaque string.
You could have custom internal logic to separate it by colon caracters (`:`) or
similar, and get the two parts `items` and `read`. Many applications do that to
- group and organize permisions, you could do it as well in your application, just
+ group and organize permissions, you could do it as well in your application, just
know that that it is application specific, it's not part of the specification.
"""
@@ -196,7 +196,7 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm):
Note that for OAuth2 the scope `items:read` is a single scope in an opaque string.
You could have custom internal logic to separate it by colon caracters (`:`) or
similar, and get the two parts `items` and `read`. Many applications do that to
- group and organize permisions, you could do it as well in your application, just
+ group and organize permissions, you could do it as well in your application, just
know that that it is application specific, it's not part of the specification.
@@ -353,7 +353,7 @@ class OAuth2(SecurityBase):
bool,
Doc(
"""
- By default, if no HTTP Auhtorization header is provided, required for
+ By default, if no HTTP Authorization header is provided, required for
OAuth2 authentication, it will automatically cancel the request and
send the client an error.
@@ -441,7 +441,7 @@ class OAuth2PasswordBearer(OAuth2):
bool,
Doc(
"""
- By default, if no HTTP Auhtorization header is provided, required for
+ By default, if no HTTP Authorization header is provided, required for
OAuth2 authentication, it will automatically cancel the request and
send the client an error.
@@ -543,7 +543,7 @@ class OAuth2AuthorizationCodeBearer(OAuth2):
bool,
Doc(
"""
- By default, if no HTTP Auhtorization header is provided, required for
+ By default, if no HTTP Authorization header is provided, required for
OAuth2 authentication, it will automatically cancel the request and
send the client an error.
diff --git a/fastapi/security/open_id_connect_url.py b/fastapi/security/open_id_connect_url.py
index c612b475d..c8cceb911 100644
--- a/fastapi/security/open_id_connect_url.py
+++ b/fastapi/security/open_id_connect_url.py
@@ -5,7 +5,7 @@ from fastapi.security.base import SecurityBase
from starlette.exceptions import HTTPException
from starlette.requests import Request
from starlette.status import HTTP_403_FORBIDDEN
-from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
+from typing_extensions import Annotated, Doc
class OpenIdConnect(SecurityBase):
@@ -49,7 +49,7 @@ class OpenIdConnect(SecurityBase):
bool,
Doc(
"""
- By default, if no HTTP Auhtorization header is provided, required for
+ By default, if no HTTP Authorization header is provided, required for
OpenID Connect authentication, it will automatically cancel the request
and send the client an error.
diff --git a/fastapi/utils.py b/fastapi/utils.py
index 0019c2153..dfda4e678 100644
--- a/fastapi/utils.py
+++ b/fastapi/utils.py
@@ -53,7 +53,7 @@ def is_body_allowed_for_status_code(status_code: Union[int, str, None]) -> bool:
}:
return True
current_status_code = int(status_code)
- return not (current_status_code < 200 or current_status_code in {204, 304})
+ return not (current_status_code < 200 or current_status_code in {204, 205, 304})
def get_path_param_names(path: str) -> Set[str]:
@@ -221,9 +221,3 @@ def get_value_or_default(
if not isinstance(item, DefaultPlaceholder):
return item
return first_item
-
-
-def match_pydantic_error_url(error_type: str) -> Any:
- from dirty_equals import IsStr
-
- return IsStr(regex=rf"^https://errors\.pydantic\.dev/.*/v/{error_type}")
diff --git a/pyproject.toml b/pyproject.toml
index 3e43f35e1..6c3bebf2b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,7 +41,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
- "starlette>=0.35.0,<0.36.0",
+ "starlette>=0.37.2,<0.38.0",
"pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
"typing-extensions>=4.8.0",
]
@@ -56,7 +56,7 @@ Repository = "https://github.com/tiangolo/fastapi"
all = [
"httpx >=0.23.0",
"jinja2 >=2.11.2",
- "python-multipart >=0.0.5",
+ "python-multipart >=0.0.7",
"itsdangerous >=1.1.0",
"pyyaml >=5.3.1",
"ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0",
@@ -121,9 +121,6 @@ filterwarnings = [
# - https://github.com/mpdavis/python-jose/issues/332
# - https://github.com/mpdavis/python-jose/issues/334
'ignore:datetime\.datetime\.utcnow\(\) is deprecated and scheduled for removal in a future version\..*:DeprecationWarning:jose',
- # TODO: remove after upgrading Starlette to a version including https://github.com/encode/starlette/pull/2406
- # Probably Starlette 0.36.0
- "ignore: The 'method' parameter is not used, and it will be removed.:DeprecationWarning:starlette",
]
[tool.coverage.run]
@@ -139,7 +136,7 @@ omit = [
"docs_src/response_model/tutorial003_04_py310.py",
]
-[tool.ruff]
+[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
@@ -152,10 +149,11 @@ select = [
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
+ "C901", # too complex
"W191", # indentation contains tabs
]
-[tool.ruff.per-file-ignores]
+[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"docs_src/dependencies/tutorial007.py" = ["F821"]
"docs_src/dependencies/tutorial008.py" = ["F821"]
@@ -188,9 +186,9 @@ ignore = [
"docs_src/dependencies/tutorial008b_an_py39.py" = ["B904"]
-[tool.ruff.isort]
+[tool.ruff.lint.isort]
known-third-party = ["fastapi", "pydantic", "starlette"]
-[tool.ruff.pyupgrade]
+[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
diff --git a/requirements-docs.txt b/requirements-docs.txt
index 28408a9f1..599e01f16 100644
--- a/requirements-docs.txt
+++ b/requirements-docs.txt
@@ -1,19 +1,18 @@
-e .
-r requirements-docs-tests.txt
-mkdocs-material==9.4.7
+mkdocs-material==9.5.18
mdx-include >=1.4.1,<2.0.0
-mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0
mkdocs-redirects>=1.2.1,<1.3.0
-typer-cli >=0.0.13,<0.0.14
-typer[all] >=0.6.1,<0.8.0
+typer >=0.12.0
pyyaml >=5.3.1,<7.0.0
# For Material for MkDocs, Chinese search
jieba==0.42.1
# For image processing by Material for MkDocs
-pillow==10.1.0
+pillow==10.3.0
# For image processing by Material for MkDocs
cairosvg==2.7.0
mkdocstrings[python]==0.23.0
griffe-typingdoc==0.2.2
# For griffe, it formats with black
-black==23.3.0
+black==24.3.0
+mkdocs-macros-plugin==1.0.5
diff --git a/requirements-tests.txt b/requirements-tests.txt
index e1a976c13..30762bc64 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -3,8 +3,8 @@
pydantic-settings >=2.0.0
pytest >=7.1.3,<8.0.0
coverage[toml] >= 6.5.0,< 8.0
-mypy ==1.4.1
-ruff ==0.1.2
+mypy ==1.8.0
+ruff ==0.2.0
email_validator >=1.1.1,<3.0.0
dirty-equals ==0.6.0
# TODO: once removing databases from tutorial, upgrade SQLAlchemy
@@ -13,7 +13,7 @@ sqlalchemy >=1.3.18,<1.4.43
databases[sqlite] >=0.3.2,<0.7.0
orjson >=3.2.1,<4.0.0
ujson >=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0
-python-multipart >=0.0.5,<0.0.7
+python-multipart >=0.0.7,<0.1.0
flask >=1.1.2,<3.0.0
anyio[trio] >=3.2.1,<4.0.0
python-jose[cryptography] >=3.3.0,<4.0.0
diff --git a/scripts/build-docs.sh b/scripts/build-docs.sh
index ebf864afa..7aa0a9a47 100755
--- a/scripts/build-docs.sh
+++ b/scripts/build-docs.sh
@@ -4,5 +4,5 @@ set -e
set -x
# Check README.md is up to date
-python ./scripts/docs.py verify-readme
+python ./scripts/docs.py verify-docs
python ./scripts/docs.py build-all
diff --git a/scripts/docs.py b/scripts/docs.py
index 37a7a3477..59578a820 100644
--- a/scripts/docs.py
+++ b/scripts/docs.py
@@ -76,8 +76,6 @@ def callback() -> None:
def new_lang(lang: str = typer.Argument(..., callback=lang_callback)):
"""
Generate a new docs translation directory for the language LANG.
-
- LANG should be a 2-letter language code, like: en, es, de, pt, etc.
"""
new_path: Path = Path("docs") / lang
if new_path.exists():
@@ -268,7 +266,7 @@ def live(
mkdocs.commands.serve.serve(dev_addr="127.0.0.1:8008")
-def update_config() -> None:
+def get_updated_config_content() -> Dict[str, Any]:
config = get_en_config()
languages = [{"en": "/"}]
new_alternate: List[Dict[str, str]] = []
@@ -296,12 +294,42 @@ def update_config() -> None:
new_alternate.append({"link": url, "name": use_name})
new_alternate.append({"link": "/em/", "name": "😉"})
config["extra"]["alternate"] = new_alternate
+ return config
+
+
+def update_config() -> None:
+ config = get_updated_config_content()
en_config_path.write_text(
yaml.dump(config, sort_keys=False, width=200, allow_unicode=True),
encoding="utf-8",
)
+@app.command()
+def verify_config() -> None:
+ """
+ Verify main mkdocs.yml content to make sure it uses the latest language names.
+ """
+ typer.echo("Verifying mkdocs.yml")
+ config = get_en_config()
+ updated_config = get_updated_config_content()
+ if config != updated_config:
+ typer.secho(
+ "docs/en/mkdocs.yml outdated from docs/language_names.yml, "
+ "update language_names.yml and run "
+ "python ./scripts/docs.py update-languages",
+ color=typer.colors.RED,
+ )
+ raise typer.Abort()
+ typer.echo("Valid mkdocs.yml ✅")
+
+
+@app.command()
+def verify_docs():
+ verify_readme()
+ verify_config()
+
+
@app.command()
def langs_json():
langs = []
diff --git a/tests/main.py b/tests/main.py
index 15760c039..6927eab61 100644
--- a/tests/main.py
+++ b/tests/main.py
@@ -1,5 +1,5 @@
import http
-from typing import FrozenSet, Optional
+from typing import FrozenSet, List, Optional
from fastapi import FastAPI, Path, Query
@@ -192,3 +192,13 @@ def get_enum_status_code():
@app.get("/query/frozenset")
def get_query_type_frozenset(query: FrozenSet[int] = Query(...)):
return ",".join(map(str, sorted(query)))
+
+
+@app.get("/query/list")
+def get_query_list(device_ids: List[int] = Query()) -> List[int]:
+ return device_ids
+
+
+@app.get("/query/list-default")
+def get_query_list_default(device_ids: List[int] = Query(default=[])) -> List[int]:
+ return device_ids
diff --git a/tests/test_annotated.py b/tests/test_annotated.py
index 2222be978..473d33e52 100644
--- a/tests/test_annotated.py
+++ b/tests/test_annotated.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import APIRouter, FastAPI, Query
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from typing_extensions import Annotated
app = FastAPI()
@@ -38,7 +37,6 @@ foo_is_missing = {
"msg": "Field required",
"type": "missing",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
)
# TODO: remove when deprecating Pydantic v1
@@ -60,7 +58,6 @@ foo_is_short = {
"msg": "String should have at least 1 character",
"type": "string_too_short",
"input": "",
- "url": match_pydantic_error_url("string_too_short"),
}
)
# TODO: remove when deprecating Pydantic v1
diff --git a/tests/test_application.py b/tests/test_application.py
index ea7a80128..5c62f5f6e 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -1163,6 +1163,91 @@ def test_openapi_schema():
},
}
},
+ "/query/list": {
+ "get": {
+ "summary": "Get Query List",
+ "operationId": "get_query_list_query_list_get",
+ "parameters": [
+ {
+ "name": "device_ids",
+ "in": "query",
+ "required": True,
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "title": "Device Ids",
+ },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "title": "Response Get Query List Query List Get",
+ }
+ }
+ },
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ },
+ },
+ }
+ },
+ "/query/list-default": {
+ "get": {
+ "summary": "Get Query List Default",
+ "operationId": "get_query_list_default_query_list_default_get",
+ "parameters": [
+ {
+ "name": "device_ids",
+ "in": "query",
+ "required": False,
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "default": [],
+ "title": "Device Ids",
+ },
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {"type": "integer"},
+ "title": "Response Get Query List Default Query List Default Get",
+ }
+ }
+ },
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ },
+ },
+ }
+ },
},
"components": {
"schemas": {
diff --git a/tests/test_dependency_contextmanager.py b/tests/test_dependency_contextmanager.py
index b07f9aa5b..008dab7bc 100644
--- a/tests/test_dependency_contextmanager.py
+++ b/tests/test_dependency_contextmanager.py
@@ -55,6 +55,7 @@ async def asyncgen_state_try(state: Dict[str, str] = Depends(get_state)):
yield state["/async_raise"]
except AsyncDependencyError:
errors.append("/async_raise")
+ raise
finally:
state["/async_raise"] = "asyncgen raise finalized"
@@ -65,6 +66,7 @@ def generator_state_try(state: Dict[str, str] = Depends(get_state)):
yield state["/sync_raise"]
except SyncDependencyError:
errors.append("/sync_raise")
+ raise
finally:
state["/sync_raise"] = "generator raise finalized"
diff --git a/tests/test_dependency_duplicates.py b/tests/test_dependency_duplicates.py
index 0882cc41d..8e8d07c2d 100644
--- a/tests/test_dependency_duplicates.py
+++ b/tests/test_dependency_duplicates.py
@@ -3,7 +3,6 @@ from typing import List
from dirty_equals import IsDict
from fastapi import Depends, FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -57,7 +56,6 @@ def test_no_duplicates_invalid():
"loc": ["body", "item2"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_dependency_normal_exceptions.py b/tests/test_dependency_normal_exceptions.py
index 23c366d5d..326f8fd88 100644
--- a/tests/test_dependency_normal_exceptions.py
+++ b/tests/test_dependency_normal_exceptions.py
@@ -20,6 +20,7 @@ async def get_database():
fake_database.update(temp_database)
except HTTPException:
state["except"] = True
+ raise
finally:
state["finally"] = True
diff --git a/tests/test_dependency_overrides.py b/tests/test_dependency_overrides.py
index 21cff998d..154937fa0 100644
--- a/tests/test_dependency_overrides.py
+++ b/tests/test_dependency_overrides.py
@@ -4,7 +4,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import APIRouter, Depends, FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
app = FastAPI()
@@ -63,7 +62,6 @@ def test_main_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -110,7 +108,6 @@ def test_decorator_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -151,7 +148,6 @@ def test_router_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -198,7 +194,6 @@ def test_router_decorator_depends():
"loc": ["query", "q"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -285,7 +280,6 @@ def test_override_with_sub_main_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -316,7 +310,6 @@ def test_override_with_sub__main_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -355,7 +348,6 @@ def test_override_with_sub_decorator_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -386,7 +378,6 @@ def test_override_with_sub_decorator_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -425,7 +416,6 @@ def test_override_with_sub_router_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -456,7 +446,6 @@ def test_override_with_sub_router_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -495,7 +484,6 @@ def test_override_with_sub_router_decorator_depends():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -526,7 +514,6 @@ def test_override_with_sub_router_decorator_depends_q_foo():
"loc": ["query", "k"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_filter_pydantic_sub_model_pv2.py b/tests/test_filter_pydantic_sub_model_pv2.py
index 9097d2ce5..2e2c26ddc 100644
--- a/tests/test_filter_pydantic_sub_model_pv2.py
+++ b/tests/test_filter_pydantic_sub_model_pv2.py
@@ -5,7 +5,6 @@ from dirty_equals import HasRepr, IsDict, IsOneOf
from fastapi import Depends, FastAPI
from fastapi.exceptions import ResponseValidationError
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from .utils import needs_pydanticv2
@@ -67,7 +66,6 @@ def test_validator_is_cloned(client: TestClient):
"msg": "Value error, name must end in A",
"input": "modelX",
"ctx": {"error": HasRepr("ValueError('name must end in A')")},
- "url": match_pydantic_error_url("value_error"),
}
)
| IsDict(
diff --git a/tests/test_generic_parameterless_depends.py b/tests/test_generic_parameterless_depends.py
new file mode 100644
index 000000000..fe13ff89b
--- /dev/null
+++ b/tests/test_generic_parameterless_depends.py
@@ -0,0 +1,77 @@
+from typing import TypeVar
+
+from fastapi import Depends, FastAPI
+from fastapi.testclient import TestClient
+from typing_extensions import Annotated
+
+app = FastAPI()
+
+T = TypeVar("T")
+
+Dep = Annotated[T, Depends()]
+
+
+class A:
+ pass
+
+
+class B:
+ pass
+
+
+@app.get("/a")
+async def a(dep: Dep[A]):
+ return {"cls": dep.__class__.__name__}
+
+
+@app.get("/b")
+async def b(dep: Dep[B]):
+ return {"cls": dep.__class__.__name__}
+
+
+client = TestClient(app)
+
+
+def test_generic_parameterless_depends():
+ response = client.get("/a")
+ assert response.status_code == 200, response.text
+ assert response.json() == {"cls": "A"}
+
+ response = client.get("/b")
+ assert response.status_code == 200, response.text
+ assert response.json() == {"cls": "B"}
+
+
+def test_openapi_schema():
+ response = client.get("/openapi.json")
+ assert response.status_code == 200, response.text
+ assert response.json() == {
+ "info": {"title": "FastAPI", "version": "0.1.0"},
+ "openapi": "3.1.0",
+ "paths": {
+ "/a": {
+ "get": {
+ "operationId": "a_a_get",
+ "responses": {
+ "200": {
+ "content": {"application/json": {"schema": {}}},
+ "description": "Successful " "Response",
+ }
+ },
+ "summary": "A",
+ }
+ },
+ "/b": {
+ "get": {
+ "operationId": "b_b_get",
+ "responses": {
+ "200": {
+ "content": {"application/json": {"schema": {}}},
+ "description": "Successful " "Response",
+ }
+ },
+ "summary": "B",
+ }
+ },
+ },
+ }
diff --git a/tests/test_jsonable_encoder.py b/tests/test_jsonable_encoder.py
index 7c8338ff3..1906d6bf1 100644
--- a/tests/test_jsonable_encoder.py
+++ b/tests/test_jsonable_encoder.py
@@ -7,7 +7,7 @@ from pathlib import PurePath, PurePosixPath, PureWindowsPath
from typing import Optional
import pytest
-from fastapi._compat import PYDANTIC_V2
+from fastapi._compat import PYDANTIC_V2, Undefined
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel, Field, ValidationError
@@ -310,3 +310,9 @@ def test_encode_deque_encodes_child_models():
dq = deque([Model(test="test")])
assert jsonable_encoder(dq)[0]["test"] == "test"
+
+
+@needs_pydanticv2
+def test_encode_pydantic_undefined():
+ data = {"value": Undefined}
+ assert jsonable_encoder(data) == {"value": None}
diff --git a/tests/test_multi_body_errors.py b/tests/test_multi_body_errors.py
index a51ca7253..0102f0f1a 100644
--- a/tests/test_multi_body_errors.py
+++ b/tests/test_multi_body_errors.py
@@ -4,7 +4,6 @@ from typing import List
from dirty_equals import IsDict, IsOneOf
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel, condecimal
app = FastAPI()
@@ -52,7 +51,6 @@ def test_jsonable_encoder_requiring_error():
"msg": "Input should be greater than 0",
"input": -1.0,
"ctx": {"gt": 0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -82,28 +80,24 @@ def test_put_incorrect_body_multiple():
"loc": ["body", 0, "name"],
"msg": "Field required",
"input": {"age": "five"},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "decimal_parsing",
"loc": ["body", 0, "age"],
"msg": "Input should be a valid decimal",
"input": "five",
- "url": match_pydantic_error_url("decimal_parsing"),
},
{
"type": "missing",
"loc": ["body", 1, "name"],
"msg": "Field required",
"input": {"age": "six"},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "decimal_parsing",
"loc": ["body", 1, "age"],
"msg": "Input should be a valid decimal",
"input": "six",
- "url": match_pydantic_error_url("decimal_parsing"),
},
]
}
diff --git a/tests/test_multi_query_errors.py b/tests/test_multi_query_errors.py
index 470a35808..8162d986c 100644
--- a/tests/test_multi_query_errors.py
+++ b/tests/test_multi_query_errors.py
@@ -3,7 +3,6 @@ from typing import List
from dirty_equals import IsDict
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
app = FastAPI()
@@ -33,14 +32,12 @@ def test_multi_query_incorrect():
"loc": ["query", "q", 0],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "five",
- "url": match_pydantic_error_url("int_parsing"),
},
{
"type": "int_parsing",
"loc": ["query", "q", 1],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "six",
- "url": match_pydantic_error_url("int_parsing"),
},
]
}
diff --git a/tests/test_param_include_in_schema.py b/tests/test_param_include_in_schema.py
index 26201e9e2..f461947c9 100644
--- a/tests/test_param_include_in_schema.py
+++ b/tests/test_param_include_in_schema.py
@@ -9,14 +9,14 @@ app = FastAPI()
@app.get("/hidden_cookie")
async def hidden_cookie(
- hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False)
+ hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False),
):
return {"hidden_cookie": hidden_cookie}
@app.get("/hidden_header")
async def hidden_header(
- hidden_header: Optional[str] = Header(default=None, include_in_schema=False)
+ hidden_header: Optional[str] = Header(default=None, include_in_schema=False),
):
return {"hidden_header": hidden_header}
@@ -28,7 +28,7 @@ async def hidden_path(hidden_path: str = Path(include_in_schema=False)):
@app.get("/hidden_query")
async def hidden_query(
- hidden_query: Optional[str] = Query(default=None, include_in_schema=False)
+ hidden_query: Optional[str] = Query(default=None, include_in_schema=False),
):
return {"hidden_query": hidden_query}
diff --git a/tests/test_path.py b/tests/test_path.py
index 848b245e2..09c1f13fb 100644
--- a/tests/test_path.py
+++ b/tests/test_path.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from .main import app
@@ -54,7 +53,6 @@ def test_path_int_foobar():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foobar",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -83,7 +81,6 @@ def test_path_int_True():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "True",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -118,7 +115,6 @@ def test_path_int_42_5():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "42.5",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -147,7 +143,6 @@ def test_path_float_foobar():
"loc": ["path", "item_id"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "foobar",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -176,7 +171,6 @@ def test_path_float_True():
"loc": ["path", "item_id"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "True",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -217,7 +211,6 @@ def test_path_bool_foobar():
"loc": ["path", "item_id"],
"msg": "Input should be a valid boolean, unable to interpret input",
"input": "foobar",
- "url": match_pydantic_error_url("bool_parsing"),
}
]
}
@@ -252,7 +245,6 @@ def test_path_bool_42():
"loc": ["path", "item_id"],
"msg": "Input should be a valid boolean, unable to interpret input",
"input": "42",
- "url": match_pydantic_error_url("bool_parsing"),
}
]
}
@@ -281,7 +273,6 @@ def test_path_bool_42_5():
"loc": ["path", "item_id"],
"msg": "Input should be a valid boolean, unable to interpret input",
"input": "42.5",
- "url": match_pydantic_error_url("bool_parsing"),
}
]
}
@@ -353,7 +344,6 @@ def test_path_param_minlength_fo():
"msg": "String should have at least 3 characters",
"input": "fo",
"ctx": {"min_length": 3},
- "url": match_pydantic_error_url("string_too_short"),
}
]
}
@@ -390,7 +380,6 @@ def test_path_param_maxlength_foobar():
"msg": "String should have at most 3 characters",
"input": "foobar",
"ctx": {"max_length": 3},
- "url": match_pydantic_error_url("string_too_long"),
}
]
}
@@ -427,7 +416,6 @@ def test_path_param_min_maxlength_foobar():
"msg": "String should have at most 3 characters",
"input": "foobar",
"ctx": {"max_length": 3},
- "url": match_pydantic_error_url("string_too_long"),
}
]
}
@@ -458,7 +446,6 @@ def test_path_param_min_maxlength_f():
"msg": "String should have at least 2 characters",
"input": "f",
"ctx": {"min_length": 2},
- "url": match_pydantic_error_url("string_too_short"),
}
]
}
@@ -494,7 +481,6 @@ def test_path_param_gt_2():
"msg": "Input should be greater than 3",
"input": "2",
"ctx": {"gt": 3.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -531,7 +517,6 @@ def test_path_param_gt0_0():
"msg": "Input should be greater than 0",
"input": "0",
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -574,7 +559,6 @@ def test_path_param_ge_2():
"msg": "Input should be greater than or equal to 3",
"input": "2",
"ctx": {"ge": 3.0},
- "url": match_pydantic_error_url("greater_than_equal"),
}
]
}
@@ -605,7 +589,6 @@ def test_path_param_lt_42():
"msg": "Input should be less than 3",
"input": "42",
"ctx": {"lt": 3.0},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -648,7 +631,6 @@ def test_path_param_lt0_0():
"msg": "Input should be less than 0",
"input": "0",
"ctx": {"lt": 0.0},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -679,7 +661,6 @@ def test_path_param_le_42():
"msg": "Input should be less than or equal to 3",
"input": "42",
"ctx": {"le": 3.0},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -728,7 +709,6 @@ def test_path_param_lt_gt_4():
"msg": "Input should be less than 3",
"input": "4",
"ctx": {"lt": 3.0},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -759,7 +739,6 @@ def test_path_param_lt_gt_0():
"msg": "Input should be greater than 1",
"input": "0",
"ctx": {"gt": 1.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -807,7 +786,6 @@ def test_path_param_le_ge_4():
"msg": "Input should be less than or equal to 3",
"input": "4",
"ctx": {"le": 3.0},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -844,7 +822,6 @@ def test_path_param_lt_int_42():
"msg": "Input should be less than 3",
"input": "42",
"ctx": {"lt": 3},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -874,7 +851,6 @@ def test_path_param_lt_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -910,7 +886,6 @@ def test_path_param_gt_int_2():
"msg": "Input should be greater than 3",
"input": "2",
"ctx": {"gt": 3},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -940,7 +915,6 @@ def test_path_param_gt_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -970,7 +944,6 @@ def test_path_param_le_int_42():
"msg": "Input should be less than or equal to 3",
"input": "42",
"ctx": {"le": 3},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -1012,7 +985,6 @@ def test_path_param_le_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -1054,7 +1026,6 @@ def test_path_param_ge_int_2():
"msg": "Input should be greater than or equal to 3",
"input": "2",
"ctx": {"ge": 3},
- "url": match_pydantic_error_url("greater_than_equal"),
}
]
}
@@ -1084,7 +1055,6 @@ def test_path_param_ge_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -1120,7 +1090,6 @@ def test_path_param_lt_gt_int_4():
"msg": "Input should be less than 3",
"input": "4",
"ctx": {"lt": 3},
- "url": match_pydantic_error_url("less_than"),
}
]
}
@@ -1151,7 +1120,6 @@ def test_path_param_lt_gt_int_0():
"msg": "Input should be greater than 1",
"input": "0",
"ctx": {"gt": 1},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
@@ -1181,7 +1149,6 @@ def test_path_param_lt_gt_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -1229,7 +1196,6 @@ def test_path_param_le_ge_int_4():
"msg": "Input should be less than or equal to 3",
"input": "4",
"ctx": {"le": 3},
- "url": match_pydantic_error_url("less_than_equal"),
}
]
}
@@ -1259,7 +1225,6 @@ def test_path_param_le_ge_int_2_7():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "2.7",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_query.py b/tests/test_query.py
index 5bb9995d6..57f551d2a 100644
--- a/tests/test_query.py
+++ b/tests/test_query.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from .main import app
@@ -18,7 +17,6 @@ def test_query():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -53,7 +51,6 @@ def test_query_not_declared_baz():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -100,7 +97,6 @@ def test_query_int():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -135,7 +131,6 @@ def test_query_int_query_42_5():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "42.5",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -164,7 +159,6 @@ def test_query_int_query_baz():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "baz",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -193,7 +187,6 @@ def test_query_int_not_declared_baz():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -234,7 +227,6 @@ def test_query_int_optional_query_foo():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -275,7 +267,6 @@ def test_query_int_default_query_foo():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -316,7 +307,6 @@ def test_query_param_required():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -351,7 +341,6 @@ def test_query_param_required_int():
"loc": ["query", "query"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -386,7 +375,6 @@ def test_query_param_required_int_query_foo():
"loc": ["query", "query"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
@@ -408,3 +396,26 @@ def test_query_frozenset_query_1_query_1_query_2():
response = client.get("/query/frozenset/?query=1&query=1&query=2")
assert response.status_code == 200
assert response.json() == "1,2"
+
+
+def test_query_list():
+ response = client.get("/query/list/?device_ids=1&device_ids=2")
+ assert response.status_code == 200
+ assert response.json() == [1, 2]
+
+
+def test_query_list_empty():
+ response = client.get("/query/list/")
+ assert response.status_code == 422
+
+
+def test_query_list_default():
+ response = client.get("/query/list-default/?device_ids=1&device_ids=2")
+ assert response.status_code == 200
+ assert response.json() == [1, 2]
+
+
+def test_query_list_default_empty():
+ response = client.get("/query/list-default/")
+ assert response.status_code == 200
+ assert response.json() == []
diff --git a/tests/test_regex_deprecated_body.py b/tests/test_regex_deprecated_body.py
index ca1ab514c..74654ff3c 100644
--- a/tests/test_regex_deprecated_body.py
+++ b/tests/test_regex_deprecated_body.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI, Form
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from typing_extensions import Annotated
from .utils import needs_py310
@@ -14,7 +13,7 @@ def get_client():
@app.post("/items/")
async def read_items(
- q: Annotated[str | None, Form(regex="^fixedquery$")] = None
+ q: Annotated[str | None, Form(regex="^fixedquery$")] = None,
):
if q:
return f"Hello {q}"
@@ -55,7 +54,6 @@ def test_query_nonregexquery():
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_regex_deprecated_params.py b/tests/test_regex_deprecated_params.py
index 79a653353..2ce64c686 100644
--- a/tests/test_regex_deprecated_params.py
+++ b/tests/test_regex_deprecated_params.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI, Query
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from typing_extensions import Annotated
from .utils import needs_py310
@@ -14,7 +13,7 @@ def get_client():
@app.get("/items/")
async def read_items(
- q: Annotated[str | None, Query(regex="^fixedquery$")] = None
+ q: Annotated[str | None, Query(regex="^fixedquery$")] = None,
):
if q:
return f"Hello {q}"
@@ -55,7 +54,6 @@ def test_query_params_str_validations_item_query_nonregexquery():
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_security_oauth2.py b/tests/test_security_oauth2.py
index e98f80ebf..7d914d034 100644
--- a/tests/test_security_oauth2.py
+++ b/tests/test_security_oauth2.py
@@ -2,7 +2,6 @@ from dirty_equals import IsDict
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -71,21 +70,18 @@ def test_strict_login_no_data():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -124,7 +120,6 @@ def test_strict_login_no_grant_type():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -157,7 +152,6 @@ def test_strict_login_incorrect_grant_type():
"msg": "String should match pattern 'password'",
"input": "incorrect",
"ctx": {"pattern": "password"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_security_oauth2_optional.py b/tests/test_security_oauth2_optional.py
index d06c01bba..0da3b911e 100644
--- a/tests/test_security_oauth2_optional.py
+++ b/tests/test_security_oauth2_optional.py
@@ -4,7 +4,6 @@ from dirty_equals import IsDict
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -75,21 +74,18 @@ def test_strict_login_no_data():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,7 +124,6 @@ def test_strict_login_no_grant_type():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -161,7 +156,6 @@ def test_strict_login_incorrect_grant_type():
"msg": "String should match pattern 'password'",
"input": "incorrect",
"ctx": {"pattern": "password"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_security_oauth2_optional_description.py b/tests/test_security_oauth2_optional_description.py
index 9287e4366..85a9f9b39 100644
--- a/tests/test_security_oauth2_optional_description.py
+++ b/tests/test_security_oauth2_optional_description.py
@@ -4,7 +4,6 @@ from dirty_equals import IsDict
from fastapi import Depends, FastAPI, Security
from fastapi.security import OAuth2, OAuth2PasswordRequestFormStrict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from pydantic import BaseModel
app = FastAPI()
@@ -76,21 +75,18 @@ def test_strict_login_None():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -129,7 +125,6 @@ def test_strict_login_no_grant_type():
"loc": ["body", "grant_type"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -162,7 +157,6 @@ def test_strict_login_incorrect_grant_type():
"msg": "String should match pattern 'password'",
"input": "incorrect",
"ctx": {"pattern": "password"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_bigger_applications/test_main.py b/tests/test_tutorial/test_bigger_applications/test_main.py
index 526e265a6..35fdfa4a6 100644
--- a/tests/test_tutorial/test_bigger_applications/test_main.py
+++ b/tests/test_tutorial/test_bigger_applications/test_main.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_users_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -64,7 +62,6 @@ def test_users_foo_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -99,7 +96,6 @@ def test_users_me_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -145,7 +141,6 @@ def test_items_with_no_token_jessica(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -192,7 +187,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -233,7 +227,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -262,7 +255,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -297,7 +289,6 @@ def test_root_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -326,14 +317,12 @@ def test_put_no_header(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_bigger_applications/test_main_an.py b/tests/test_tutorial/test_bigger_applications/test_main_an.py
index c0b77d4a7..4e2e3e74d 100644
--- a/tests/test_tutorial/test_bigger_applications/test_main_an.py
+++ b/tests/test_tutorial/test_bigger_applications/test_main_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_users_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -64,7 +62,6 @@ def test_users_foo_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -99,7 +96,6 @@ def test_users_me_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -145,7 +141,6 @@ def test_items_with_no_token_jessica(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -192,7 +187,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -233,7 +227,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -262,7 +255,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -297,7 +289,6 @@ def test_root_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -326,14 +317,12 @@ def test_put_no_header(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py b/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
index 948331b5d..8c9e976df 100644
--- a/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
+++ b/tests/test_tutorial/test_bigger_applications/test_main_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -33,7 +32,6 @@ def test_users_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -70,7 +68,6 @@ def test_users_foo_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -107,7 +104,6 @@ def test_users_me_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -156,7 +152,6 @@ def test_items_with_no_token_jessica(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -206,7 +201,6 @@ def test_items_plumbus_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -250,7 +244,6 @@ def test_items_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -280,7 +273,6 @@ def test_items_plumbus_with_missing_x_token_header(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -317,7 +309,6 @@ def test_root_with_no_token(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -347,14 +338,12 @@ def test_put_no_header(client: TestClient):
"loc": ["query", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body/test_tutorial001.py b/tests/test_tutorial/test_body/test_tutorial001.py
index 2476b773f..0d55d73eb 100644
--- a/tests/test_tutorial/test_body/test_tutorial001.py
+++ b/tests/test_tutorial/test_body/test_tutorial001.py
@@ -3,7 +3,6 @@ from unittest.mock import patch
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture
@@ -74,7 +73,6 @@ def test_post_with_only_name(client: TestClient):
"loc": ["body", "price"],
"msg": "Field required",
"input": {"name": "Foo"},
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -103,7 +101,6 @@ def test_post_with_only_name_price(client: TestClient):
"loc": ["body", "price"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "twenty",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -132,14 +129,12 @@ def test_post_with_no_data(client: TestClient):
"loc": ["body", "name"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "price"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -173,7 +168,6 @@ def test_post_with_none(client: TestClient):
"loc": ["body"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -244,7 +238,6 @@ def test_post_form_for_json(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": "name=Foo&price=50.5",
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -308,9 +301,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url(
- "model_attributes_type"
- ), # "https://errors.pydantic.dev/0.38.0/v/dict_attributes_type",
}
]
}
@@ -339,7 +329,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -367,7 +356,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
diff --git a/tests/test_tutorial/test_body/test_tutorial001_py310.py b/tests/test_tutorial/test_body/test_tutorial001_py310.py
index b64d86005..4b9c12806 100644
--- a/tests/test_tutorial/test_body/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body/test_tutorial001_py310.py
@@ -3,7 +3,6 @@ from unittest.mock import patch
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -81,7 +80,6 @@ def test_post_with_only_name(client: TestClient):
"loc": ["body", "price"],
"msg": "Field required",
"input": {"name": "Foo"},
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -111,7 +109,6 @@ def test_post_with_only_name_price(client: TestClient):
"loc": ["body", "price"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "twenty",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
@@ -141,14 +138,12 @@ def test_post_with_no_data(client: TestClient):
"loc": ["body", "name"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "price"],
"msg": "Field required",
"input": {},
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -183,7 +178,6 @@ def test_post_with_none(client: TestClient):
"loc": ["body"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -256,7 +250,6 @@ def test_post_form_for_json(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": "name=Foo&price=50.5",
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -324,7 +317,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -353,7 +345,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
@@ -381,7 +372,6 @@ def test_wrong_headers(client: TestClient):
"loc": ["body"],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": '{"name": "Foo", "price": 50.5}',
- "url": match_pydantic_error_url("model_attributes_type"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001.py b/tests/test_tutorial/test_body_fields/test_tutorial001.py
index 1ff2d9576..fd6139eb9 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -57,7 +56,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_an.py b/tests/test_tutorial/test_body_fields/test_tutorial001_an.py
index 907d6842a..72c18c1f7 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -57,7 +56,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
index 431d2d181..1bc62868f 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
index 8cef6c154..3c5557a1b 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py b/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
index b48cd9ec2..8c1386aa6 100644
--- a/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body_fields/test_tutorial001_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -62,7 +61,6 @@ def test_invalid_price(client: TestClient):
"msg": "Input should be greater than 0",
"input": -3.0,
"ctx": {"gt": 0.0},
- "url": match_pydantic_error_url("greater_than"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
index e5dc13b26..6275ebe95 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -50,7 +49,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
index 51e8e3a4e..5cd3e2c4a 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -50,7 +49,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
index 8ac1f7261..0173ab21b 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
index 7ada42c52..cda19918a 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
index 0a832eaf6..663291933 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -56,7 +55,6 @@ def test_post_id_foo(client: TestClient):
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
index 2046579a9..c26f8b89b 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -46,21 +45,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -99,21 +95,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
index 1282483e0..62c7e2fad 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -46,21 +45,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -99,21 +95,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
index 577c079d0..f46430fb5 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
index 0ec04151c..29071cddc 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
index 9caf5fe6c..133afe9b5 100644
--- a/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
+++ b/tests/test_tutorial/test_body_multiple_params/test_tutorial003_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -50,21 +49,18 @@ def test_post_body_no_data(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -104,21 +100,18 @@ def test_post_body_empty_list(client: TestClient):
"loc": ["body", "item"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "user"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "importance"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial009.py b/tests/test_tutorial/test_body_nested_models/test_tutorial009.py
index f4a76be44..762073aea 100644
--- a/tests/test_tutorial/test_body_nested_models/test_tutorial009.py
+++ b/tests/test_tutorial/test_body_nested_models/test_tutorial009.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -31,7 +30,6 @@ def test_post_invalid_body(client: TestClient):
"loc": ["body", "foo", "[key]"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py b/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
index 8ab9bcac8..24623cecc 100644
--- a/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
+++ b/tests/test_tutorial/test_body_nested_models/test_tutorial009_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -35,7 +34,6 @@ def test_post_invalid_body(client: TestClient):
"loc": ["body", "foo", "[key]"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py b/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
index ad142ec88..6f7355aaa 100644
--- a/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
+++ b/tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.custom_request_and_route.tutorial002 import app
@@ -23,7 +22,6 @@ def test_exception_handler_body_access():
"loc": ["body"],
"msg": "Input should be a valid list",
"input": {"numbers": [1, 2, 3]},
- "url": match_pydantic_error_url("list_type"),
}
],
"body": '{"numbers": [1, 2, 3]}',
diff --git a/tests/test_tutorial/test_custom_response/test_tutorial006c.py b/tests/test_tutorial/test_custom_response/test_tutorial006c.py
index 51aa1833d..2675f2a93 100644
--- a/tests/test_tutorial/test_custom_response/test_tutorial006c.py
+++ b/tests/test_tutorial/test_custom_response/test_tutorial006c.py
@@ -8,7 +8,7 @@ client = TestClient(app)
def test_redirect_status_code():
response = client.get("/pydantic", follow_redirects=False)
assert response.status_code == 302
- assert response.headers["location"] == "https://pydantic-docs.helpmanual.io/"
+ assert response.headers["location"] == "https://docs.pydantic.dev/"
def test_openapi_schema():
diff --git a/tests/test_tutorial/test_dataclasses/test_tutorial001.py b/tests/test_tutorial/test_dataclasses/test_tutorial001.py
index 9f1200f37..762654d29 100644
--- a/tests/test_tutorial/test_dataclasses/test_tutorial001.py
+++ b/tests/test_tutorial/test_dataclasses/test_tutorial001.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dataclasses.tutorial001 import app
@@ -29,7 +28,6 @@ def test_post_invalid_item():
"loc": ["body", "price"],
"msg": "Input should be a valid number, unable to parse string as a number",
"input": "invalid price",
- "url": match_pydantic_error_url("float_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial006.py b/tests/test_tutorial/test_dependencies/test_tutorial006.py
index 704e389a5..5f14d9a3b 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial006.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial006.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial006 import app
@@ -18,14 +17,12 @@ def test_get_no_headers():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial006_an.py b/tests/test_tutorial/test_dependencies/test_tutorial006_an.py
index 5034fceba..a307ff808 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial006_an.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial006_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial006_an import app
@@ -18,14 +17,12 @@ def test_get_no_headers():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
index 3fc22dd3c..b41b1537e 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -26,14 +25,12 @@ def test_get_no_headers(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
index 7f51fc52a..7d24809a8 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
@@ -1,23 +1,33 @@
+import pytest
from fastapi.testclient import TestClient
-from docs_src.dependencies.tutorial008b_an import app
-
-client = TestClient(app)
+from ...utils import needs_py39
-def test_get_no_item():
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008b_an_py39 import app
+
+ client = TestClient(app)
+ return client
+
+
+@needs_py39
+def test_get_no_item(client: TestClient):
response = client.get("/items/foo")
assert response.status_code == 404, response.text
assert response.json() == {"detail": "Item not found"}
-def test_owner_error():
+@needs_py39
+def test_owner_error(client: TestClient):
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
assert response.json() == {"detail": "Owner error: Rick"}
-def test_get_item():
+@needs_py39
+def test_get_item(client: TestClient):
response = client.get("/items/portal-gun")
assert response.status_code == 200, response.text
assert response.json() == {"description": "Gun to create portals", "owner": "Rick"}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008c.py b/tests/test_tutorial/test_dependencies/test_tutorial008c.py
new file mode 100644
index 000000000..27be8895a
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008c.py
@@ -0,0 +1,38 @@
+import pytest
+from fastapi.exceptions import FastAPIError
+from fastapi.testclient import TestClient
+
+
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008c import app
+
+ client = TestClient(app)
+ return client
+
+
+def test_get_no_item(client: TestClient):
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
+
+
+def test_get(client: TestClient):
+ response = client.get("/items/plumbus")
+ assert response.status_code == 200, response.text
+ assert response.json() == "plumbus"
+
+
+def test_fastapi_error(client: TestClient):
+ with pytest.raises(FastAPIError) as exc_info:
+ client.get("/items/portal-gun")
+ assert "No response object was returned" in exc_info.value.args[0]
+
+
+def test_internal_server_error():
+ from docs_src.dependencies.tutorial008c import app
+
+ client = TestClient(app, raise_server_exceptions=False)
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 500, response.text
+ assert response.text == "Internal Server Error"
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008c_an.py b/tests/test_tutorial/test_dependencies/test_tutorial008c_an.py
new file mode 100644
index 000000000..10fa1ab50
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008c_an.py
@@ -0,0 +1,38 @@
+import pytest
+from fastapi.exceptions import FastAPIError
+from fastapi.testclient import TestClient
+
+
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008c_an import app
+
+ client = TestClient(app)
+ return client
+
+
+def test_get_no_item(client: TestClient):
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
+
+
+def test_get(client: TestClient):
+ response = client.get("/items/plumbus")
+ assert response.status_code == 200, response.text
+ assert response.json() == "plumbus"
+
+
+def test_fastapi_error(client: TestClient):
+ with pytest.raises(FastAPIError) as exc_info:
+ client.get("/items/portal-gun")
+ assert "No response object was returned" in exc_info.value.args[0]
+
+
+def test_internal_server_error():
+ from docs_src.dependencies.tutorial008c_an import app
+
+ client = TestClient(app, raise_server_exceptions=False)
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 500, response.text
+ assert response.text == "Internal Server Error"
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008c_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial008c_an_py39.py
new file mode 100644
index 000000000..6c3acff50
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008c_an_py39.py
@@ -0,0 +1,44 @@
+import pytest
+from fastapi.exceptions import FastAPIError
+from fastapi.testclient import TestClient
+
+from ...utils import needs_py39
+
+
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008c_an_py39 import app
+
+ client = TestClient(app)
+ return client
+
+
+@needs_py39
+def test_get_no_item(client: TestClient):
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
+
+
+@needs_py39
+def test_get(client: TestClient):
+ response = client.get("/items/plumbus")
+ assert response.status_code == 200, response.text
+ assert response.json() == "plumbus"
+
+
+@needs_py39
+def test_fastapi_error(client: TestClient):
+ with pytest.raises(FastAPIError) as exc_info:
+ client.get("/items/portal-gun")
+ assert "No response object was returned" in exc_info.value.args[0]
+
+
+@needs_py39
+def test_internal_server_error():
+ from docs_src.dependencies.tutorial008c_an_py39 import app
+
+ client = TestClient(app, raise_server_exceptions=False)
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 500, response.text
+ assert response.text == "Internal Server Error"
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008d.py b/tests/test_tutorial/test_dependencies/test_tutorial008d.py
new file mode 100644
index 000000000..043496112
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008d.py
@@ -0,0 +1,41 @@
+import pytest
+from fastapi.testclient import TestClient
+
+
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008d import app
+
+ client = TestClient(app)
+ return client
+
+
+def test_get_no_item(client: TestClient):
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
+
+
+def test_get(client: TestClient):
+ response = client.get("/items/plumbus")
+ assert response.status_code == 200, response.text
+ assert response.json() == "plumbus"
+
+
+def test_internal_error(client: TestClient):
+ from docs_src.dependencies.tutorial008d import InternalError
+
+ with pytest.raises(InternalError) as exc_info:
+ client.get("/items/portal-gun")
+ assert (
+ exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
+ )
+
+
+def test_internal_server_error():
+ from docs_src.dependencies.tutorial008d import app
+
+ client = TestClient(app, raise_server_exceptions=False)
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 500, response.text
+ assert response.text == "Internal Server Error"
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008d_an.py b/tests/test_tutorial/test_dependencies/test_tutorial008d_an.py
new file mode 100644
index 000000000..f29d8cdbe
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008d_an.py
@@ -0,0 +1,41 @@
+import pytest
+from fastapi.testclient import TestClient
+
+
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008d_an import app
+
+ client = TestClient(app)
+ return client
+
+
+def test_get_no_item(client: TestClient):
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
+
+
+def test_get(client: TestClient):
+ response = client.get("/items/plumbus")
+ assert response.status_code == 200, response.text
+ assert response.json() == "plumbus"
+
+
+def test_internal_error(client: TestClient):
+ from docs_src.dependencies.tutorial008d_an import InternalError
+
+ with pytest.raises(InternalError) as exc_info:
+ client.get("/items/portal-gun")
+ assert (
+ exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
+ )
+
+
+def test_internal_server_error():
+ from docs_src.dependencies.tutorial008d_an import app
+
+ client = TestClient(app, raise_server_exceptions=False)
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 500, response.text
+ assert response.text == "Internal Server Error"
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py
new file mode 100644
index 000000000..0a585f4ad
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py
@@ -0,0 +1,47 @@
+import pytest
+from fastapi.testclient import TestClient
+
+from ...utils import needs_py39
+
+
+@pytest.fixture(name="client")
+def get_client():
+ from docs_src.dependencies.tutorial008d_an_py39 import app
+
+ client = TestClient(app)
+ return client
+
+
+@needs_py39
+def test_get_no_item(client: TestClient):
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
+
+
+@needs_py39
+def test_get(client: TestClient):
+ response = client.get("/items/plumbus")
+ assert response.status_code == 200, response.text
+ assert response.json() == "plumbus"
+
+
+@needs_py39
+def test_internal_error(client: TestClient):
+ from docs_src.dependencies.tutorial008d_an_py39 import InternalError
+
+ with pytest.raises(InternalError) as exc_info:
+ client.get("/items/portal-gun")
+ assert (
+ exc_info.value.args[0] == "The portal gun is too dangerous to be owned by Rick"
+ )
+
+
+@needs_py39
+def test_internal_server_error():
+ from docs_src.dependencies.tutorial008d_an_py39 import app
+
+ client = TestClient(app, raise_server_exceptions=False)
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 500, response.text
+ assert response.text == "Internal Server Error"
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial012.py b/tests/test_tutorial/test_dependencies/test_tutorial012.py
index 753e62e43..6b53c83bb 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial012.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial012.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial012 import app
@@ -18,14 +17,12 @@ def test_get_no_headers_items():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -59,14 +56,12 @@ def test_get_no_headers_users():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial012_an.py b/tests/test_tutorial/test_dependencies/test_tutorial012_an.py
index 4157d4612..75adb69fc 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial012_an.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial012_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.dependencies.tutorial012_an import app
@@ -18,14 +17,12 @@ def test_get_no_headers_items():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -59,14 +56,12 @@ def test_get_no_headers_users():
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
index 9e46758cb..e0a3d1ec2 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial012_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -26,14 +25,12 @@ def test_get_no_headers_items(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -68,14 +65,12 @@ def test_get_no_headers_users(client: TestClient):
"loc": ["header", "x-token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["header", "x-key"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001.py
index 7710446ce..5558671b9 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001.py
@@ -67,6 +67,7 @@ def test_openapi_schema():
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -86,7 +87,7 @@ def test_openapi_schema():
}
)
}
- }
+ },
},
}
}
@@ -97,40 +98,16 @@ def test_openapi_schema():
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -151,10 +128,8 @@ def test_openapi_schema():
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -166,6 +141,7 @@ def test_openapi_schema():
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
index 9951b3b51..e309f8bd6 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
@@ -67,6 +67,7 @@ def test_openapi_schema():
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -86,7 +87,7 @@ def test_openapi_schema():
}
)
}
- }
+ },
},
}
}
@@ -97,40 +98,16 @@ def test_openapi_schema():
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -151,10 +128,8 @@ def test_openapi_schema():
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -166,6 +141,7 @@ def test_openapi_schema():
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py
index 7c482b8cb..ca110dc00 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
}
)
}
- }
+ },
},
}
}
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py
index 87473867b..3386fb1fd 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py39.py
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
}
)
}
- }
+ },
},
}
}
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py b/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py
index 0b71d9177..50c9aefdf 100644
--- a/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py
+++ b/tests/test_tutorial/test_extra_data_types/test_tutorial001_py310.py
@@ -76,6 +76,7 @@ def test_openapi_schema(client: TestClient):
}
],
"requestBody": {
+ "required": True,
"content": {
"application/json": {
"schema": IsDict(
@@ -95,7 +96,7 @@ def test_openapi_schema(client: TestClient):
}
)
}
- }
+ },
},
}
}
@@ -106,40 +107,16 @@ def test_openapi_schema(client: TestClient):
"title": "Body_read_items_items__item_id__put",
"type": "object",
"properties": {
- "start_datetime": IsDict(
- {
- "title": "Start Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "Start Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
- "end_datetime": IsDict(
- {
- "title": "End Datetime",
- "anyOf": [
- {"type": "string", "format": "date-time"},
- {"type": "null"},
- ],
- }
- )
- | IsDict(
- # TODO: remove when deprecating Pydantic v1
- {
- "title": "End Datetime",
- "type": "string",
- "format": "date-time",
- }
- ),
+ "start_datetime": {
+ "title": "Start Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
+ "end_datetime": {
+ "title": "End Datetime",
+ "type": "string",
+ "format": "date-time",
+ },
"repeat_at": IsDict(
{
"title": "Repeat At",
@@ -160,10 +137,8 @@ def test_openapi_schema(client: TestClient):
"process_after": IsDict(
{
"title": "Process After",
- "anyOf": [
- {"type": "string", "format": "duration"},
- {"type": "null"},
- ],
+ "type": "string",
+ "format": "duration",
}
)
| IsDict(
@@ -175,6 +150,7 @@ def test_openapi_schema(client: TestClient):
}
),
},
+ "required": ["start_datetime", "end_datetime", "process_after"],
},
"ValidationError": {
"title": "ValidationError",
diff --git a/tests/test_tutorial/test_handling_errors/test_tutorial005.py b/tests/test_tutorial/test_handling_errors/test_tutorial005.py
index 494c317ca..581b2e4c7 100644
--- a/tests/test_tutorial/test_handling_errors/test_tutorial005.py
+++ b/tests/test_tutorial/test_handling_errors/test_tutorial005.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.handling_errors.tutorial005 import app
@@ -18,7 +17,6 @@ def test_post_validation_error():
"loc": ["body", "size"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "XL",
- "url": match_pydantic_error_url("int_parsing"),
}
],
"body": {"title": "towel", "size": "XL"},
diff --git a/tests/test_tutorial/test_handling_errors/test_tutorial006.py b/tests/test_tutorial/test_handling_errors/test_tutorial006.py
index cc2b496a8..7d2f553aa 100644
--- a/tests/test_tutorial/test_handling_errors/test_tutorial006.py
+++ b/tests/test_tutorial/test_handling_errors/test_tutorial006.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.handling_errors.tutorial006 import app
@@ -18,7 +17,6 @@ def test_get_validation_error():
"loc": ["path", "item_id"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "foo",
- "url": match_pydantic_error_url("int_parsing"),
}
]
}
diff --git a/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py b/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
index 2d2802269..8240b60a6 100644
--- a/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
+++ b/tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py
@@ -1,6 +1,5 @@
import pytest
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_pydanticv2
@@ -64,7 +63,6 @@ def test_post_invalid(client: TestClient):
"loc": ["tags", 3],
"msg": "Input should be a valid string",
"input": {"sneaky": "object"},
- "url": match_pydantic_error_url("string_type"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params/test_tutorial005.py b/tests/test_tutorial/test_query_params/test_tutorial005.py
index 921586357..05ae85b45 100644
--- a/tests/test_tutorial/test_query_params/test_tutorial005.py
+++ b/tests/test_tutorial/test_query_params/test_tutorial005.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.query_params.tutorial005 import app
@@ -24,7 +23,6 @@ def test_foo_no_needy():
"loc": ["query", "needy"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params/test_tutorial006.py b/tests/test_tutorial/test_query_params/test_tutorial006.py
index e07803d6c..dbd63da16 100644
--- a/tests/test_tutorial/test_query_params/test_tutorial006.py
+++ b/tests/test_tutorial/test_query_params/test_tutorial006.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -34,21 +33,18 @@ def test_foo_no_needy(client: TestClient):
"loc": ["query", "needy"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "int_parsing",
"loc": ["query", "skip"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "a",
- "url": match_pydantic_error_url("int_parsing"),
},
{
"type": "int_parsing",
"loc": ["query", "limit"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "b",
- "url": match_pydantic_error_url("int_parsing"),
},
]
}
diff --git a/tests/test_tutorial/test_query_params/test_tutorial006_py310.py b/tests/test_tutorial/test_query_params/test_tutorial006_py310.py
index 6c4c0b4dc..5055e3805 100644
--- a/tests/test_tutorial/test_query_params/test_tutorial006_py310.py
+++ b/tests/test_tutorial/test_query_params/test_tutorial006_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -38,21 +37,18 @@ def test_foo_no_needy(client: TestClient):
"loc": ["query", "needy"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "int_parsing",
"loc": ["query", "skip"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "a",
- "url": match_pydantic_error_url("int_parsing"),
},
{
"type": "int_parsing",
"loc": ["query", "limit"],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "b",
- "url": match_pydantic_error_url("int_parsing"),
},
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
index 287c2e8f8..945cee3d2 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -45,7 +44,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
index 5b0515070..23951a9aa 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -45,7 +44,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
index d22b1ce20..2968af563 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
index 3e7d5d3ad..534ba8759 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
index 1c3a09d39..886bceca2 100644
--- a/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
+++ b/tests/test_tutorial/test_query_params_str_validations/test_tutorial010_py310.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py310
@@ -51,7 +50,6 @@ def test_query_params_str_validations_item_query_nonregexquery(client: TestClien
"msg": "String should match pattern '^fixedquery$'",
"input": "nonregexquery",
"ctx": {"pattern": "^fixedquery$"},
- "url": match_pydantic_error_url("string_pattern_mismatch"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial001.py b/tests/test_tutorial/test_request_files/test_tutorial001.py
index 91cc2b636..f5817593b 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial001.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial001.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial001 import app
@@ -29,7 +28,6 @@ def test_post_form_no_body():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -58,7 +56,6 @@ def test_post_body_json():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial001_an.py b/tests/test_tutorial/test_request_files/test_tutorial001_an.py
index 3021eb3c3..1c78e3679 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial001_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial001_an import app
@@ -18,7 +17,6 @@ def test_post_form_no_body():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -47,7 +45,6 @@ def test_post_body_json():
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py b/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
index 04f3a4693..843fcec28 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -26,7 +25,6 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -56,7 +54,6 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002.py b/tests/test_tutorial/test_request_files/test_tutorial002.py
index ed9680b62..db1552e5c 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial002 import app
@@ -18,7 +17,6 @@ def test_post_form_no_body():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -47,7 +45,6 @@ def test_post_body_json():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002_an.py b/tests/test_tutorial/test_request_files/test_tutorial002_an.py
index ea8c1216c..b16da1669 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002_an.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002_an.py
@@ -1,6 +1,5 @@
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from docs_src.request_files.tutorial002_an import app
@@ -18,7 +17,6 @@ def test_post_form_no_body():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -47,7 +45,6 @@ def test_post_body_json():
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py b/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
index 6d5877836..e092a516d 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -32,7 +31,6 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -62,7 +60,6 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_files/test_tutorial002_py39.py b/tests/test_tutorial/test_request_files/test_tutorial002_py39.py
index 2d0445421..341a9ac8e 100644
--- a/tests/test_tutorial/test_request_files/test_tutorial002_py39.py
+++ b/tests/test_tutorial/test_request_files/test_tutorial002_py39.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -43,7 +42,6 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -73,7 +71,6 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "files"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
diff --git a/tests/test_tutorial/test_request_forms/test_tutorial001.py b/tests/test_tutorial/test_request_forms/test_tutorial001.py
index 805daeb10..cbef9d30f 100644
--- a/tests/test_tutorial/test_request_forms/test_tutorial001.py
+++ b/tests/test_tutorial/test_request_forms/test_tutorial001.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_post_body_form_no_password(client: TestClient):
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -58,7 +56,6 @@ def test_post_body_form_no_username(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -87,14 +84,12 @@ def test_post_body_form_no_data(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,14 +123,12 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms/test_tutorial001_an.py b/tests/test_tutorial/test_request_forms/test_tutorial001_an.py
index c43a0b695..88b8452bc 100644
--- a/tests/test_tutorial/test_request_forms/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_request_forms/test_tutorial001_an.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="client")
@@ -29,7 +28,6 @@ def test_post_body_form_no_password(client: TestClient):
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -58,7 +56,6 @@ def test_post_body_form_no_username(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -87,14 +84,12 @@ def test_post_body_form_no_data(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,14 +123,12 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py b/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
index 078b812aa..3229897c9 100644
--- a/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
@@ -1,7 +1,6 @@
import pytest
from dirty_equals import IsDict
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -33,7 +32,6 @@ def test_post_body_form_no_password(client: TestClient):
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -63,7 +61,6 @@ def test_post_body_form_no_username(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
}
]
}
@@ -93,14 +90,12 @@ def test_post_body_form_no_data(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -135,14 +130,12 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "username"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "password"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
index cac58639f..1e1ad2a87 100644
--- a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
+++ b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="app")
@@ -29,21 +28,18 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -82,14 +78,12 @@ def test_post_form_no_file(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -123,21 +117,18 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -181,14 +172,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
index 009568048..5daf4dbf4 100644
--- a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
+++ b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
@pytest.fixture(name="app")
@@ -29,21 +28,18 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -82,14 +78,12 @@ def test_post_form_no_file(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -123,21 +117,18 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -181,14 +172,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
index 3d007e90b..3f1204efa 100644
--- a/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
+++ b/tests/test_tutorial/test_request_forms_and_files/test_tutorial001_an_py39.py
@@ -2,7 +2,6 @@ import pytest
from dirty_equals import IsDict
from fastapi import FastAPI
from fastapi.testclient import TestClient
-from fastapi.utils import match_pydantic_error_url
from ...utils import needs_py39
@@ -32,21 +31,18 @@ def test_post_form_no_body(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -86,14 +82,12 @@ def test_post_form_no_file(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -128,21 +122,18 @@ def test_post_body_json(client: TestClient):
"loc": ["body", "file"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
@@ -187,14 +178,12 @@ def test_post_file_no_token(tmp_path, app: FastAPI):
"loc": ["body", "fileb"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
{
"type": "missing",
"loc": ["body", "token"],
"msg": "Field required",
"input": None,
- "url": match_pydantic_error_url("missing"),
},
]
}
diff --git a/tests/test_tutorial/test_security/test_tutorial005.py b/tests/test_tutorial/test_security/test_tutorial005.py
index c669c306d..2e580dbb3 100644
--- a/tests/test_tutorial/test_security/test_tutorial005.py
+++ b/tests/test_tutorial/test_security/test_tutorial005.py
@@ -128,7 +128,7 @@ def test_token_no_scope():
assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
-def test_token_inexistent_user():
+def test_token_nonexistent_user():
response = client.get(
"/users/me",
headers={
diff --git a/tests/test_tutorial/test_security/test_tutorial005_an.py b/tests/test_tutorial/test_security/test_tutorial005_an.py
index aaab04f78..04c7d60bc 100644
--- a/tests/test_tutorial/test_security/test_tutorial005_an.py
+++ b/tests/test_tutorial/test_security/test_tutorial005_an.py
@@ -128,7 +128,7 @@ def test_token_no_scope():
assert response.headers["WWW-Authenticate"] == 'Bearer scope="me"'
-def test_token_inexistent_user():
+def test_token_nonexistent_user():
response = client.get(
"/users/me",
headers={
diff --git a/tests/test_tutorial/test_security/test_tutorial005_an_py310.py b/tests/test_tutorial/test_security/test_tutorial005_an_py310.py
index 243d0773c..9c7f83ed2 100644
--- a/tests/test_tutorial/test_security/test_tutorial005_an_py310.py
+++ b/tests/test_tutorial/test_security/test_tutorial005_an_py310.py
@@ -151,7 +151,7 @@ def test_token_no_scope(client: TestClient):
@needs_py310
-def test_token_inexistent_user(client: TestClient):
+def test_token_nonexistent_user(client: TestClient):
response = client.get(
"/users/me",
headers={
diff --git a/tests/test_tutorial/test_security/test_tutorial005_an_py39.py b/tests/test_tutorial/test_security/test_tutorial005_an_py39.py
index 17a3f9aa2..04cc1b014 100644
--- a/tests/test_tutorial/test_security/test_tutorial005_an_py39.py
+++ b/tests/test_tutorial/test_security/test_tutorial005_an_py39.py
@@ -151,7 +151,7 @@ def test_token_no_scope(client: TestClient):
@needs_py39
-def test_token_inexistent_user(client: TestClient):
+def test_token_nonexistent_user(client: TestClient):
response = client.get(
"/users/me",
headers={
diff --git a/tests/test_tutorial/test_security/test_tutorial005_py310.py b/tests/test_tutorial/test_security/test_tutorial005_py310.py
index 06455cd63..98c60c1c2 100644
--- a/tests/test_tutorial/test_security/test_tutorial005_py310.py
+++ b/tests/test_tutorial/test_security/test_tutorial005_py310.py
@@ -151,7 +151,7 @@ def test_token_no_scope(client: TestClient):
@needs_py310
-def test_token_inexistent_user(client: TestClient):
+def test_token_nonexistent_user(client: TestClient):
response = client.get(
"/users/me",
headers={
diff --git a/tests/test_tutorial/test_security/test_tutorial005_py39.py b/tests/test_tutorial/test_security/test_tutorial005_py39.py
index 9455bfb4e..cd2157d54 100644
--- a/tests/test_tutorial/test_security/test_tutorial005_py39.py
+++ b/tests/test_tutorial/test_security/test_tutorial005_py39.py
@@ -151,7 +151,7 @@ def test_token_no_scope(client: TestClient):
@needs_py39
-def test_token_inexistent_user(client: TestClient):
+def test_token_nonexistent_user(client: TestClient):
response = client.get(
"/users/me",
headers={
diff --git a/tests/test_tutorial/test_sql_databases/test_sql_databases.py b/tests/test_tutorial/test_sql_databases/test_sql_databases.py
index 03e747433..e3e2b36a8 100644
--- a/tests/test_tutorial/test_sql_databases/test_sql_databases.py
+++ b/tests/test_tutorial/test_sql_databases/test_sql_databases.py
@@ -54,7 +54,7 @@ def test_get_user(client):
# TODO: pv2 add version with Pydantic v2
@needs_pydanticv1
-def test_inexistent_user(client):
+def test_nonexistent_user(client):
response = client.get("/users/999")
assert response.status_code == 404, response.text
diff --git a/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py b/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py
index a503ef2a6..73b97e09d 100644
--- a/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py
+++ b/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py
@@ -50,7 +50,7 @@ def test_get_user(client):
# TODO: pv2 add version with Pydantic v2
@needs_pydanticv1
-def test_inexistent_user(client):
+def test_nonexistent_user(client):
response = client.get("/users/999")
assert response.status_code == 404, response.text
diff --git a/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py b/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py
index d54cc6552..a078f012a 100644
--- a/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py
+++ b/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py
@@ -58,7 +58,7 @@ def test_get_user(client):
@needs_py310
# TODO: pv2 add version with Pydantic v2
@needs_pydanticv1
-def test_inexistent_user(client):
+def test_nonexistent_user(client):
response = client.get("/users/999")
assert response.status_code == 404, response.text
diff --git a/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py b/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py
index 4e43995e6..a5da07ac6 100644
--- a/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py
+++ b/tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py39.py
@@ -58,7 +58,7 @@ def test_get_user(client):
@needs_py39
# TODO: pv2 add version with Pydantic v2
@needs_pydanticv1
-def test_inexistent_user(client):
+def test_nonexistent_user(client):
response = client.get("/users/999")
assert response.status_code == 404, response.text
diff --git a/tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py b/tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py
index b89b8b031..5a9106598 100644
--- a/tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py
+++ b/tests/test_tutorial/test_sql_databases/test_sql_databases_py310.py
@@ -57,7 +57,7 @@ def test_get_user(client):
@needs_py310
# TODO: pv2 add version with Pydantic v2
@needs_pydanticv1
-def test_inexistent_user(client):
+def test_nonexistent_user(client):
response = client.get("/users/999")
assert response.status_code == 404, response.text
diff --git a/tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py b/tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py
index 13351bc81..a354ba905 100644
--- a/tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py
+++ b/tests/test_tutorial/test_sql_databases/test_sql_databases_py39.py
@@ -57,7 +57,7 @@ def test_get_user(client):
@needs_py39
# TODO: pv2 add version with Pydantic v2
@needs_pydanticv1
-def test_inexistent_user(client):
+def test_nonexistent_user(client):
response = client.get("/users/999")
assert response.status_code == 404, response.text
diff --git a/tests/test_tutorial/test_testing/test_main_b.py b/tests/test_tutorial/test_testing/test_main_b.py
index fc1a832f9..1e1836f5b 100644
--- a/tests/test_tutorial/test_testing/test_main_b.py
+++ b/tests/test_tutorial/test_testing/test_main_b.py
@@ -5,6 +5,6 @@ def test_app():
test_main.test_create_existing_item()
test_main.test_create_item()
test_main.test_create_item_bad_token()
- test_main.test_read_inexistent_item()
+ test_main.test_read_nonexistent_item()
test_main.test_read_item()
test_main.test_read_item_bad_token()
diff --git a/tests/test_tutorial/test_testing/test_main_b_an.py b/tests/test_tutorial/test_testing/test_main_b_an.py
index b64c5f710..e53fc3224 100644
--- a/tests/test_tutorial/test_testing/test_main_b_an.py
+++ b/tests/test_tutorial/test_testing/test_main_b_an.py
@@ -5,6 +5,6 @@ def test_app():
test_main.test_create_existing_item()
test_main.test_create_item()
test_main.test_create_item_bad_token()
- test_main.test_read_inexistent_item()
+ test_main.test_read_nonexistent_item()
test_main.test_read_item()
test_main.test_read_item_bad_token()
diff --git a/tests/test_tutorial/test_testing/test_main_b_an_py310.py b/tests/test_tutorial/test_testing/test_main_b_an_py310.py
index 194700b6d..c974e5dc1 100644
--- a/tests/test_tutorial/test_testing/test_main_b_an_py310.py
+++ b/tests/test_tutorial/test_testing/test_main_b_an_py310.py
@@ -8,6 +8,6 @@ def test_app():
test_main.test_create_existing_item()
test_main.test_create_item()
test_main.test_create_item_bad_token()
- test_main.test_read_inexistent_item()
+ test_main.test_read_nonexistent_item()
test_main.test_read_item()
test_main.test_read_item_bad_token()
diff --git a/tests/test_tutorial/test_testing/test_main_b_an_py39.py b/tests/test_tutorial/test_testing/test_main_b_an_py39.py
index 2f8a13623..71f99726c 100644
--- a/tests/test_tutorial/test_testing/test_main_b_an_py39.py
+++ b/tests/test_tutorial/test_testing/test_main_b_an_py39.py
@@ -8,6 +8,6 @@ def test_app():
test_main.test_create_existing_item()
test_main.test_create_item()
test_main.test_create_item_bad_token()
- test_main.test_read_inexistent_item()
+ test_main.test_read_nonexistent_item()
test_main.test_read_item()
test_main.test_read_item_bad_token()
diff --git a/tests/test_tutorial/test_testing/test_main_b_py310.py b/tests/test_tutorial/test_testing/test_main_b_py310.py
index a504ed234..e30cdc073 100644
--- a/tests/test_tutorial/test_testing/test_main_b_py310.py
+++ b/tests/test_tutorial/test_testing/test_main_b_py310.py
@@ -8,6 +8,6 @@ def test_app():
test_main.test_create_existing_item()
test_main.test_create_item()
test_main.test_create_item_bad_token()
- test_main.test_read_inexistent_item()
+ test_main.test_read_nonexistent_item()
test_main.test_read_item()
test_main.test_read_item_bad_token()