Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for enim (0.18 sec)

  1. docs_src/path_operation_configuration/tutorial002b.py

    from enum import Enum
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    class Tags(Enum):
        items = "items"
        users = "users"
    
    
    @app.get("/items/", tags=[Tags.items])
    async def get_items():
        return ["Portal gun", "Plumbus"]
    
    
    @app.get("/users/", tags=[Tags.users])
    async def read_users():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jan 23 17:43:04 GMT 2022
    - 323 bytes
    - Viewed (0)
  2. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:28:59 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_path_params/test_tutorial005.py

            {
                "detail": [
                    {
                        "ctx": {"enum_values": ["alexnet", "resnet", "lenet"]},
                        "loc": ["path", "model_name"],
                        "msg": "value is not a valid enumeration member; permitted: 'alexnet', 'resnet', 'lenet'",
                        "type": "type_error.enum",
                    }
                ]
            }
        )
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 5K bytes
    - Viewed (0)
  4. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
  5. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:07:48 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/path-operation-configuration.md

    В этих случаях, имеет смысл хранить теги в классе `Enum`.
    
    **FastAPI** поддерживает это так же, как и в случае с обычными строками:
    
    ```Python hl_lines="1  8-10  13  18"
    {!../../../docs_src/path_operation_configuration/tutorial002b.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 8K bytes
    - Viewed (0)
  7. docs/ja/docs/tutorial/query-params.md

    ```
    
    この場合、3つのクエリパラメータがあります。:
    
    * `needy`、必須の `str` 。
    * `skip`、デフォルト値を `0` とする `int` 。
    * `limit`、オプショナルな `int` 。
    
    !!! tip "豆知識"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  8. docs/en/docs/release-notes.md

    * Update wording in docs about [OAuth2 scopes](https://fastapi.tiangolo.com/advanced/security/oauth2-scopes/). PR [#371](https://github.com/tiangolo/fastapi/pull/371) by [@cjw296](https://github.com/cjw296).
    
    * Update docs for `Enum`s to inherit from `str` and improve Swagger UI rendering. PR [#351](https://github.com/tiangolo/fastapi/pull/351).
    
    * Fix regression, add Swagger UI deep linking again. PR [#350](https://github.com/tiangolo/fastapi/pull/350).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Apr 28 00:28:00 GMT 2024
    - 385.5K bytes
    - Viewed (1)
  9. tests/test_jsonable_encoder.py

    
    def test_custom_enum_encoders():
        def custom_enum_encoder(v: Enum):
            return v.value.lower()
    
        class MyEnum(Enum):
            ENUM_VAL_1 = "ENUM_VAL_1"
    
        instance = MyEnum.ENUM_VAL_1
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={MyEnum: custom_enum_encoder}
        )
        assert encoded_instance == custom_enum_encoder(instance)
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  10. fastapi/types.py

    import types
    from enum import Enum
    from typing import Any, Callable, Dict, Set, Type, TypeVar, Union
    
    from pydantic import BaseModel
    
    DecoratedCallable = TypeVar("DecoratedCallable", bound=Callable[..., Any])
    UnionType = getattr(types, "UnionType", Union)
    ModelNameMap = Dict[Union[Type[BaseModel], Type[Enum]], str]
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Dec 12 00:29:03 GMT 2023
    - 383 bytes
    - Viewed (0)
Back to top