]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🌐 Add Korean translation for `docs/ko/docs/tutorial/path-operation-configuration...
authorjungsu.kwon <jungsu.kwon@seoulrobotics.org>
Mon, 22 Jan 2024 19:43:22 +0000 (04:43 +0900)
committerGitHub <noreply@github.com>
Mon, 22 Jan 2024 19:43:22 +0000 (14:43 -0500)
docs/ko/docs/tutorial/path-operation-configuration.md [new file with mode: 0644]

diff --git a/docs/ko/docs/tutorial/path-operation-configuration.md b/docs/ko/docs/tutorial/path-operation-configuration.md
new file mode 100644 (file)
index 0000000..22aad04
--- /dev/null
@@ -0,0 +1,97 @@
+# κ²½λ‘œ λ™μž‘ μ„€μ •
+
+*경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*λ₯Ό μ„€μ •ν•˜κΈ° μœ„ν•΄μ„œ μ „λ‹¬ν• μˆ˜ μžˆλŠ” λͺ‡ κ°€μ§€ λ§€κ°œλ³€μˆ˜κ°€ μžˆμŠ΅λ‹ˆλ‹€.
+
+!!! warning "κ²½κ³ "
+    μ•„λž˜ λ§€κ°œλ³€μˆ˜λ“€μ€ *경둜 μž‘동 ν•¨μˆ˜*κ°€ μ•„λ‹Œ *경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*에 μ§μ ‘ μ „λ‹¬λœλ‹€λŠ” μ‚¬μ‹€μ„ κΈ°μ–΅ν•˜μ‹­μ‹œμ˜€.
+
+## μ‘λ‹΅ μƒνƒœ μ½”λ“œ
+
+*경둜 μž‘동*의 μ‘닡에 μ‚¬μš©λ  (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**λŠ” κ°œλ°œμž μ—¬λŸ¬λΆ„μ˜ νŽΈμ˜λ₯Ό μœ„ν•΄μ„œ `starlette.status`와 λ™μΌν•œ `fastapi.status`λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. ν•˜μ§€λ§Œ Starletteμ—μ„œ μ§μ ‘ μ˜¨ κ²ƒμž…λ‹ˆλ‹€.
+
+## νƒœκ·Έ
+
+(보톡 λ‹¨μΌ `str`인) `str`둜 κ΅¬μ„±λœ `list`와 ν•¨κ»˜ λ§€κ°œλ³€μˆ˜ `tags`λ₯Ό μ „λ‹¬ν•˜μ—¬, `경둜 μž‘동`에 νƒœκ·Έλ₯Ό μΆ”κ°€ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+```Python hl_lines="17  22  27"
+{!../../../docs_src/path_operation_configuration/tutorial002.py!}
+```
+
+μ „λ‹¬λœ νƒœκ·Έλ“€μ€ OpenAPI의 μŠ€ν‚€λ§ˆμ— μΆ”κ°€λ˜λ©°, μžλ™ λ¬Έμ„œ μΈν„°νŽ˜μ΄μŠ€μ—μ„œ μ‚¬μš©λ©λ‹ˆλ‹€:
+
+<img src="/img/tutorial/path-operation-configuration/image01.png">
+
+## μš”μ•½κ³Ό κΈ°μˆ 
+
+`summary`와 `description`을 μΆ”κ°€ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+```Python hl_lines="20-21"
+{!../../../docs_src/path_operation_configuration/tutorial003.py!}
+```
+
+## λ…μŠ€νŠΈλ§μœΌλ‘œ λ§Œλ“  κΈ°μˆ 
+
+μ„€λͺ…은 λ³΄ν†΅ κΈΈμ–΄μ§€κ³  μ—¬λŸ¬ μ€„에 κ±Έμ³μžˆκΈ° λ•Œλ¬Έμ—, *경둜 μž‘동* κΈ°μˆ μ„ ν•¨μˆ˜ <abbr title="ν•¨μˆ˜μ•ˆμ— μžˆλŠ” μ²«λ²ˆμ§Έ ν‘œν˜„μ‹μœΌλ‘œ, λ¬Έμ„œλ‘œ μ‚¬μš©λ  μ—¬λŸ¬ μ€„에 κ±ΈμΉœ (λ³€μˆ˜μ— ν• λ‹Ήλ˜μ§€ μ•Šμ€) λ¬Έμžμ—΄"> λ…μŠ€νŠΈλ§</abbr> μ— μ„ μ–Έν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€, μ΄λ₯Ό **FastAPI**κ°€ λ…μŠ€νŠΈλ§μœΌλ‘œλΆ€ν„° μ½μŠ΅λ‹ˆλ‹€.
+
+<a href="https://ko.wikipedia.org/wiki/%EB%A7%88%ED%81%AC%EB%8B%A4%EC%9A%B4" class="external-link" target="_blank">λ§ˆν¬λ‹€μš΄</a> λ¬Έλ²•μœΌλ‘œ λ…μŠ€νŠΈλ§μ„ μž‘μ„±ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€, μž‘μ„±λœ λ§ˆν¬λ‹€μš΄ ν˜•μ‹μ˜ λ…μŠ€νŠΈλ§μ€ (λ§ˆν¬λ‹€μš΄μ˜ λ“€μ—¬μ“°κΈ°λ₯Ό κ³ λ €ν•˜μ—¬) μ˜¬λ°”λ₯΄κ²Œ ν™”면에 μΆœλ ₯λ©λ‹ˆλ‹€.
+
+```Python hl_lines="19-27"
+{!../../../docs_src/path_operation_configuration/tutorial004.py!}
+```
+
+μ΄λŠ” λŒ€ν™”ν˜• λ¬Έμ„œμ—μ„œ μ‚¬μš©λ©λ‹ˆλ‹€:
+
+<img src="/img/tutorial/path-operation-configuration/image02.png">
+
+## μ‘λ‹΅ κΈ°μˆ 
+
+`response_description` λ§€κ°œλ³€μˆ˜λ‘œ μ‘닡에 κ΄€ν•œ μ„€λͺ…을 λͺ…μ‹œν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+```Python hl_lines="21"
+{!../../../docs_src/path_operation_configuration/tutorial005.py!}
+```
+
+!!! info "정보"
+    `response_description`은 κ΅¬μ²΄μ μœΌλ‘œ μ‘닡을 μ§€μΉ­ν•˜λ©°, `description`은 μΌλ°˜μ μΈ *경둜 μž‘동*을 μ§€μΉ­ν•©λ‹ˆλ‹€.
+
+!!! check "확인"
+    OpenAPIλŠ” κ° *경둜 μž‘동*이 μ‘닡에 κ΄€ν•œ μ„€λͺ…을 μš”ꡬ할 κ²ƒμ„ λͺ…μ‹œν•©λ‹ˆλ‹€.
+
+    λ”°λΌμ„œ, μ‘닡에 κ΄€ν•œ μ„€λͺ…이 μ—†μ„κ²½μš°, **FastAPI**κ°€ μžλ™μœΌλ‘œ "성곡 μ‘λ‹΅" μ€‘ ν•˜λ‚˜λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
+
+<img src="/img/tutorial/path-operation-configuration/image03.png">
+
+## λ‹¨μΌ *경둜 μž‘동* μ§€μ›μ€‘단
+
+단일 *경둜 μž‘동*을 μ—†μ• μ§€ μ•Šκ³  <abbr title="ꡬ식, μ‚¬μš©ν•˜μ§€ μ•ŠλŠ”κ²ƒμ΄ κΆŒμž₯됨">지원쀑단</abbr>을 ν•΄μ•Όν•œλ‹€λ©΄, `deprecated` λ§€κ°œλ³€μˆ˜λ₯Ό μ „λ‹¬ν•˜λ©΄ λ©λ‹ˆλ‹€.
+
+```Python hl_lines="16"
+{!../../../docs_src/path_operation_configuration/tutorial006.py!}
+```
+
+λŒ€ν™”ν˜• λ¬Έμ„œμ— μ§€μ›μ€‘단이라고 ν‘œμ‹œλ©λ‹ˆλ‹€.
+
+<img src="/img/tutorial/path-operation-configuration/image04.png">
+
+μ§€μ›μ€‘λ‹¨λœ κ²½μš°μ™€ μ§€μ›μ€‘단 λ˜μ§€ μ•Šμ€ κ²½μš°μ— λŒ€ν•œ *경둜 μž‘동*이 μ–΄λ–»κ²Œ λ³΄μ΄λŠ” μ§€ ν™•μΈν•˜μ‹­μ‹œμ˜€.
+
+<img src="/img/tutorial/path-operation-configuration/image05.png">
+
+## μ •리
+
+*경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*에 λ§€κ°œλ³€μˆ˜(λ“€)λ₯Ό μ „λ‹¬ν•¨μœΌλ‘œ *경둜 μž‘동*을 μ„€μ •ν•˜κ³  λ©”타데이터λ₯Ό μΆ”κ°€ν• μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.