- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 43 for pnum (0.17 sec)
-
docs/en/docs/tutorial/path-params.md
### Create an `Enum` class Import `Enum` and create a sub-class that inherits from `str` and from `Enum`. By inheriting from `str` the API docs will be able to know that the values must be of type `string` and will be able to render correctly.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.1K bytes - Viewed (0) -
docs/ru/docs/tutorial/path-params.md
### Создание класса `Enum` Импортируйте `Enum` и создайте подкласс, который наследуется от `str` и `Enum`. Мы наследуемся от `str`, чтобы документация API могла понять, что значения должны быть типа `string` и отображалась правильно.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 14.1K bytes - Viewed (0) -
docs/zh/docs/tutorial/path-params.md
``` 否则,`/users/{user_id}` 将匹配 `/users/me`,FastAPI 会**认为**正在接收值为 `"me"` 的 `user_id` 参数。 ## 预设值 路径操作使用 Python 的 <abbr title="Enumeration">`Enum`</abbr> 类型接收预设的*路径参数*。 ### 创建 `Enum` 类 导入 `Enum` 并创建继承自 `str` 和 `Enum` 的子类。 通过从 `str` 继承,API 文档就能把值的类型定义为**字符串**,并且能正确渲染。 然后,创建包含固定值的类属性,这些固定值是可用的有效值: ```Python hl_lines="1 6-9" {!../../../docs_src/path_params/tutorial005.py!}
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Apr 01 05:35:40 GMT 2024 - 7.6K bytes - Viewed (0) -
docs/fr/docs/tutorial/path-params.md
### Création d'un `Enum` Importez `Enum` et créez une sous-classe qui hérite de `str` et `Enum`. En héritant de `str` la documentation sera capable de savoir que les valeurs doivent être de type `string` et pourra donc afficher cette `Enum` correctement.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 10K bytes - Viewed (0) -
fastapi/params.py
import warnings from enum import Enum from typing import Any, Callable, Dict, List, Optional, Sequence, Union from fastapi.openapi.models import Example from pydantic.fields import FieldInfo from typing_extensions import Annotated, deprecated from ._compat import PYDANTIC_V2, PYDANTIC_VERSION, Undefined _Unset: Any = Undefined class ParamTypes(Enum): query = "query" header = "header" path = "path"
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 27.5K bytes - Viewed (1) -
docs_src/path_operation_configuration/tutorial002b.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sun Jan 23 17:43:04 GMT 2022 - 323 bytes - Viewed (0) -
docs/de/docs/tutorial/path-params.md
### Erstellen Sie eine `Enum`-Klasse Importieren Sie `Enum` und erstellen Sie eine Unterklasse, die von `str` und `Enum` erbt.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:28:59 GMT 2024 - 10.3K bytes - Viewed (0) -
tests/test_tutorial/test_path_params/test_tutorial005.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Sep 28 04:14:40 GMT 2023 - 5K bytes - Viewed (0) -
tests/test_application.py
assert response.status_code == 200, response.text assert response.headers["content-type"] == "text/html; charset=utf-8" assert "redoc@next" in response.text def test_enum_status_code_response(): response = client.get("/enum-status-code") assert response.status_code == 201, response.text assert response.json() == "foo bar" def test_openapi_schema(): response = client.get("/openapi.json")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 21:56:59 GMT 2024 - 52.2K bytes - Viewed (0) -
docs/de/docs/tutorial/path-operation-configuration.md
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!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 18:07:48 GMT 2024 - 5.9K bytes - Viewed (0)