- Sort Score
- Num 10 results
- Language All
Results 61 - 70 of 980 for tutorial004_py310 (0.38 seconds)
-
docs/en/docs/tutorial/path-params.md
{* ../../docs_src/path_params/tutorial005_py310.py hl[17] *} #### Get the *enumeration value* { #get-the-enumeration-value } You can get the actual value (a `str` in this case) using `model_name.value`, or in general, `your_enum_member.value`: {* ../../docs_src/path_params/tutorial005_py310.py hl[20] *} /// tipCreated: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 8.8K bytes - Click Count (0) -
docs/ja/docs/advanced/path-operation-advanced-configuration.md
## docstringによる説明の高度な設定 { #advanced-description-from-docstring } *path operation関数* のdocstringからOpenAPIに使用する行を制限できます。 `\f`(エスケープされた「書式送り(form feed)」文字)を追加すると、**FastAPI** はその地点でOpenAPIに使用される出力を切り詰めます。 ドキュメントには表示されませんが、他のツール(Sphinxなど)は残りの部分を利用できます。 {* ../../docs_src/path_operation_advanced_configuration/tutorial004_py310.py hl[17:27] *}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 8.2K bytes - Click Count (0) -
docs/zh/docs/advanced/additional-responses.md
"second old key": "second old value", "new key": "new value", } ``` 你可以使用该技巧在*路径操作*中重用一些预定义响应,并把它们与额外的自定义响应组合在一起。 例如: {* ../../docs_src/additional_responses/tutorial004_py310.py hl[11:15,24] *} ## 关于 OpenAPI 响应的更多信息 { #more-information-about-openapi-responses } 要查看响应中究竟可以包含什么,你可以查看 OpenAPI 规范中的以下部分:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 8.7K bytes - Click Count (0) -
docs/zh/docs/advanced/path-operation-advanced-configuration.md
{* ../../docs_src/path_operation_advanced_configuration/tutorial003_py310.py hl[6] *} ## 来自 docstring 的高级描述 { #advanced-description-from-docstring } 你可以限制 *路径操作函数* 的 `docstring` 中用于 OpenAPI 的行数。 添加一个 `\f`(一个“换页”的转义字符)可以使 **FastAPI** 在那一位置截断用于 OpenAPI 的输出。 剩余部分不会出现在文档中,但是其他工具(比如 Sphinx)可以使用剩余部分。 {* ../../docs_src/path_operation_advanced_configuration/tutorial004_py310.py hl[17:27] *} ## 附加响应 { #additional-responses }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 6.7K bytes - Click Count (0) -
docs/en/docs/advanced/custom-response.md
{* ../../docs_src/response_directly/tutorial002_py310.py hl[1,18] *} ### `HTMLResponse` { #htmlresponse } Takes some text or bytes and returns an HTML response, as you read above. ### `PlainTextResponse` { #plaintextresponse } Takes some text or bytes and returns a plain text response. {* ../../docs_src/custom_response/tutorial005_py310.py hl[2,7,9] *} ### `JSONResponse` { #jsonresponse }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 11K bytes - Click Count (0) -
docs/en/docs/advanced/generate-clients.md
We could download the OpenAPI JSON to a file `openapi.json` and then we could **remove that prefixed tag** with a script like this: {* ../../docs_src/generate_clients/tutorial004_py310.py *} //// tab | Node.js ```Javascript {!> ../../docs_src/generate_clients/tutorial004.js!} ``` ////Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 9.7K bytes - Click Count (1) -
docs/zh/docs/tutorial/path-params.md
{* ../../docs_src/path_params/tutorial001_py310.py hl[6:7] *} 路径参数 `item_id` 的值会作为参数 `item_id` 传递给你的函数。 运行示例并访问 [http://127.0.0.1:8000/items/foo](http://127.0.0.1:8000/items/foo),可获得如下响应: ```JSON {"item_id":"foo"} ``` ## 声明路径参数的类型 { #path-parameters-with-types } 使用 Python 标准类型注解,声明路径操作函数中路径参数的类型: {* ../../docs_src/path_params/tutorial002_py310.py hl[7] *} 本例把 `item_id` 的类型声明为 `int`。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 7.6K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/extra-models.md
同樣地,你可以將回應宣告為物件的 `list`。 為此,使用標準的 Python `list`: {* ../../docs_src/extra_models/tutorial004_py310.py hl[18] *} ## 以任意 `dict` 作為回應 { #response-with-arbitrary-dict } 你也可以用一般的任意 `dict` 宣告回應,只需指定鍵和值的型別,而不必使用 Pydantic 模型。 當你事先不知道可用的欄位/屬性名稱(定義 Pydantic 模型所需)時,這很實用。 此時可使用 `dict`: {* ../../docs_src/extra_models/tutorial005_py310.py hl[6] *} ## 重點回顧 { #recap } 依情境使用多個 Pydantic 模型並靈活繼承。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 6.3K bytes - Click Count (0) -
docs/en/docs/python-types.md
{* ../../docs_src/python_types/tutorial003_py310.py hl[1] *} Because the editor knows the types of the variables, you don't only get completion, you also get error checks: <img src="/img/python-types/image04.png"> Now you know that you have to fix it, convert `age` to a string with `str(age)`: {* ../../docs_src/python_types/tutorial004_py310.py hl[2] *} ## Declaring types { #declaring-types }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 11K bytes - Click Count (0) -
docs/ja/docs/advanced/additional-responses.md
"second old key": "second old value", "new key": "new value", } ``` このテクニックを使うと、*path operations* で事前定義レスポンスを再利用し、さらにカスタムのレスポンスを組み合わせられます。 例えば: {* ../../docs_src/additional_responses/tutorial004_py310.py hl[11:15,24] *} ## OpenAPI レスポンスの詳細 { #more-information-about-openapi-responses } レスポンスに正確に何を含められるかは、OpenAPI 仕様の次のセクションを参照してください:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 10K bytes - Click Count (0)