Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 329 for declare (0.91 sec)

  1. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

    We can do better...
    
    ## What makes a dependency { #what-makes-a-dependency }
    
    Up to now you have seen dependencies declared as functions.
    
    But that's not the only way to declare dependencies (although it would probably be the more common).
    
    The key factor is that a dependency should be a "callable".
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 6.7K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/index.md

    ///
    
    ### Import `Depends` { #import-depends }
    
    {* ../../docs_src/dependencies/tutorial001_an_py310.py hl[3] *}
    
    ### Declare the dependency, in the "dependant" { #declare-the-dependency-in-the-dependant }
    
    The same way you use `Body`, `Query`, etc. with your *path operation function* parameters, use `Depends` with a new parameter:
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 9.6K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/custom-response.md

    But if you return a `Response` directly (or any subclass, like `JSONResponse`), the data won't be automatically converted (even if you declare a `response_model`), and the documentation won't be automatically generated (for example, including the specific "media type", in the HTTP header `Content-Type` as part of the generated OpenAPI).
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 12.2K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/events.md

    These functions can be declared with `async def` or normal `def`.
    
    ### `startup` event { #startup-event }
    
    To add a function that should be run before the application starts, declare it with the event `"startup"`:
    
    {* ../../docs_src/events/tutorial001.py hl[8] *}
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

    ## Dependencies errors and return values { #dependencies-errors-and-return-values }
    
    You can use the same dependency *functions* you use normally.
    
    ### Dependency requirements { #dependency-requirements }
    
    They can declare request requirements (like headers) or other sub-dependencies:
    
    {* ../../docs_src/dependencies/tutorial006_an_py39.py hl[8,13] *}
    
    ### Raise exceptions { #raise-exceptions }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.9K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/security/get-current-user.md

    {* ../../docs_src/security/tutorial002_an_py310.py hl[31] *}
    
    Notice that we declare the type of `current_user` as the Pydantic model `User`.
    
    This will help us inside of the function with all the completion and type checks.
    
    /// tip
    
    You might remember that request bodies are also declared with Pydantic models.
    
    Here **FastAPI** won't get confused because you are using `Depends`.
    
    ///
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 4K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/dependencies/sub-dependencies.md

    {* ../../docs_src/dependencies/tutorial005_an_py310.py hl[13] *}
    
    Let's focus on the parameters declared:
    
    * Even though this function is a dependency ("dependable") itself, it also declares another dependency (it "depends" on something else).
        * It depends on the `query_extractor`, and assigns the value returned by it to the parameter `q`.
    * It also declares an optional `last_query` cookie, as a `str`.
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 3.7K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/io/Closer.java

       *
       * @return this method does not return; it always throws
       * @throws IOException when the given throwable is an IOException
       * @throws X1 when the given throwable is of the declared type X1
       * @throws X2 when the given throwable is of the declared type X2
       */
      public <X1 extends Exception, X2 extends Exception> RuntimeException rethrow(
          Throwable e, Class<X1> declaredType1, Class<X2> declaredType2) throws IOException, X1, X2 {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  9. docs/pt/docs/tutorial/body-fields.md

    ///
    
    ## Adicione informações extras
    
    Você pode declarar informação extra em `Field`, `Query`, `Body`, etc. E isso será incluído no JSON Schema gerado.
    
    Você irá aprender mais sobre adicionar informações extras posteriormente nessa documentação, quando estiver aprendendo a declarar exemplos.
    
    ## Recapitulando
    
    Você pode usar `Field` do Pydantic para declarar validações extras e metadados para atributos do modelo.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  10. docs/en/docs/reference/response.md

    # `Response` class
    
    You can declare a parameter in a *path operation function* or dependency to be of type `Response` and then you can set data for the response like headers or cookies.
    
    You can also use it directly to create an instance of it and return it from your *path operations*.
    
    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import Response
    ```
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 397 bytes
    - Viewed (0)
Back to top