Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 229 for Chen (0.16 sec)

  1. docs/en/docs/how-to/conditional-openapi.md

    ```Python hl_lines="6  11"
    {!../../../docs_src/conditional_openapi/tutorial001.py!}
    ```
    
    Here we declare the setting `openapi_url` with the same default of `"/openapi.json"`.
    
    And then we use it when creating the `FastAPI` app.
    
    Then you could disable OpenAPI (including the UI docs) by setting the environment variable `OPENAPI_URL` to the empty string, like:
    
    <div class="termy">
    
    ```console
    $ OPENAPI_URL= uvicorn main:app
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 19 19:54:04 GMT 2023
    - 2.3K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/sub-applications.md

    ### Top-level application
    
    First, create the main, top-level, **FastAPI** application, and its *path operations*:
    
    ```Python hl_lines="3  6-8"
    {!../../../docs_src/sub_applications/tutorial001.py!}
    ```
    
    ### Sub-application
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/cookie-params.md

        !!! tip
            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/cookie_params/tutorial001.py!}
        ```
    
    ## Declare `Cookie` parameters
    
    Then declare the cookie parameters using the same structure as with `Path` and `Query`.
    
    The first value is the default value, you can pass all the extra validation or annotation parameters:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/body-multiple-params.md

    ## Embed a single body parameter
    
    Let's say you only have a single `item` body parameter from a Pydantic model `Item`.
    
    By default, **FastAPI** will then expect its body directly.
    
    But if you want it to expect a JSON with a key `item` and inside of it the model contents, as it does when you declare extra body parameters, you can use the special `Body` parameter `embed`:
    
    ```Python
    item: Item = Body(embed=True)
    ```
    
    as in:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 7.7K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/security/first-steps.md

        Because we are using a relative URL, if your API was located at `https://example.com/`, then it would refer to `https://example.com/token`. But if your API was located at `https://example.com/api/v1/`, then it would refer to `https://example.com/api/v1/token`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  6. tests/test_params_repr.py

            # TODO: remove when deprecating Pydantic v1
            "Param(Ellipsis)",
        )
    
    
    def test_param_repr_number():
        assert repr(Param(1)) == "Param(1)"
    
    
    def test_param_repr_list():
        assert repr(Param([])) == "Param([])"
    
    
    def test_path_repr():
        assert repr(Path()) == IsOneOf(
            "Path(PydanticUndefined)",
            # TODO: remove when deprecating Pydantic v1
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  7. docs/en/docs/reference/websockets.md

    # WebSockets
    
    When defining WebSockets, you normally declare a parameter of type `WebSocket` and with it you can read data from the client and send data to it.
    
    It is provided directly by Starlette, but you can import it from `fastapi`:
    
    ```python
    from fastapi import WebSocket
    ```
    
    !!! tip
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py

                        "msg": "Input should be a valid integer, unable to parse string as an integer",
                        "input": "foo",
                    }
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["path", "item_id"],
                        "msg": "value is not a valid integer",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

                        "loc": ["body", "importance"],
                        "msg": "Field required",
                        "input": None,
                    },
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "item"],
                        "msg": "field required",
                        "type": "value_error.missing",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body_multiple_params/test_tutorial003_an.py

                        "loc": ["body", "importance"],
                        "msg": "Field required",
                        "input": None,
                    },
                ]
            }
        ) | IsDict(
            # TODO: remove when deprecating Pydantic v1
            {
                "detail": [
                    {
                        "loc": ["body", "item"],
                        "msg": "field required",
                        "type": "value_error.missing",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.4K bytes
    - Viewed (0)
Back to top