Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 574 for type (0.14 sec)

  1. tests/test_include_router_defaults_overrides.py

    
    class ResponseLevel0(JSONResponse):
        media_type = "application/x-level-0"
    
    
    class ResponseLevel1(JSONResponse):
        media_type = "application/x-level-1"
    
    
    class ResponseLevel2(JSONResponse):
        media_type = "application/x-level-2"
    
    
    class ResponseLevel3(JSONResponse):
        media_type = "application/x-level-3"
    
    
    class ResponseLevel4(JSONResponse):
        media_type = "application/x-level-4"
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
  2. tests/test_additional_responses_response_class.py

                    "Error": {
                        "title": "Error",
                        "required": ["status", "title"],
                        "type": "object",
                        "properties": {
                            "status": {"title": "Status", "type": "string"},
                            "title": {"title": "Title", "type": "string"},
                        },
                    },
                    "JsonApiError": {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  3. tests/test_response_code_no_body.py

                    "Error": {
                        "title": "Error",
                        "required": ["status", "title"],
                        "type": "object",
                        "properties": {
                            "status": {"title": "Status", "type": "string"},
                            "title": {"title": "Title", "type": "string"},
                        },
                    },
                    "JsonApiError": {
                        "title": "JsonApiError",
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  4. tests/test_custom_route_class.py

    from fastapi.testclient import TestClient
    from starlette.routing import Route
    
    app = FastAPI()
    
    
    class APIRouteA(APIRoute):
        x_type = "A"
    
    
    class APIRouteB(APIRoute):
        x_type = "B"
    
    
    class APIRouteC(APIRoute):
        x_type = "C"
    
    
    router_a = APIRouter(route_class=APIRouteA)
    router_b = APIRouter(route_class=APIRouteB)
    router_c = APIRouter(route_class=APIRouteC)
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  5. tests/test_computed_fields.py

                    "Rectangle": {
                        "properties": {
                            "width": {"type": "integer", "title": "Width"},
                            "length": {"type": "integer", "title": "Length"},
                            "area": {"type": "integer", "title": "Area", "readOnly": True},
                        },
                        "type": "object",
                        "required": ["width", "length", "area"],
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  6. tests/test_typing_python39.py

    
    @needs_py310
    def test_typing():
        types = {
            list[int]: [1, 2, 3],
            dict[str, list[int]]: {"a": [1, 2, 3], "b": [4, 5, 6]},
            set[int]: [1, 2, 3],  # `set` is converted to `list`
            tuple[int, ...]: [1, 2, 3],  # `tuple` is converted to `list`
        }
        for test_type, expect in types.items():
            app = FastAPI()
    
            @app.post("/", response_model=test_type)
            def post_endpoint(input: test_type):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 709 bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/path-params.md

    ```JSON
    {"item_id":"foo"}
    ```
    
    ## Path parameters with types
    
    You can declare the type of a path parameter in the function, using standard Python type annotations:
    
    ```Python hl_lines="7"
    {!../../../docs_src/path_params/tutorial002.py!}
    ```
    
    In this case, `item_id` is declared to be an `int`.
    
    !!! check
    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)
  8. docs/en/docs/advanced/dataclasses.md

    7. Here the `response_model` is using a type annotation of a list of `Author` dataclasses.
    
        Again, you can combine `dataclasses` with standard type annotations.
    
    8. Notice that this *path operation function* uses regular `def` instead of `async def`.
    
        As always, in FastAPI you can combine `def` and `async def` as needed.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  9. tests/test_response_by_alias.py

                        "type": "object",
                        "properties": {"alias": {"title": "Alias", "type": "string"}},
                    },
                    "ModelNoAlias": {
                        "title": "ModelNoAlias",
                        "required": ["name"],
                        "type": "object",
                        "properties": {"name": {"title": "Name", "type": "string"}},
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.1K bytes
    - Viewed (0)
  10. docs/en/docs/alternatives.md

    Hug was one of the first frameworks to implement the declaration of API parameter types using Python type hints. This was a great idea that inspired other tools to do the same.
    
    It used custom types in its declarations instead of standard Python types, but it was still a huge step forward.
    
    It also was one of the first frameworks to generate a custom schema declaring the whole API in JSON.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
Back to top