Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for declarations (0.24 sec)

  1. docs/en/docs/tutorial/path-params.md

    You can use the same type declarations with `str`, `float`, `bool` and many other complex data types.
    
    Several of these are explored in the next chapters of the tutorial.
    
    ## Order matters
    
    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)
  2. docs/en/docs/tutorial/body-multiple-params.md

    # Body - Multiple Parameters
    
    Now that we have seen how to use `Path` and `Query`, let's see more advanced uses of request body declarations.
    
    ## Mix `Path`, `Query` and body parameters
    
    First, of course, you can mix `Path`, `Query` and request body parameter declarations freely and **FastAPI** will know what to do.
    
    And you can also declare body parameters as optional, by setting the default to `None`:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 7.7K bytes
    - Viewed (0)
  3. docs/en/docs/features.md

    **FastAPI** gives you the following:
    
    ### Based on open standards
    
    * <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>OpenAPI</strong></a> for API creation, including declarations of <abbr title="also known as: endpoints, routes">path</abbr> <abbr title="also known as HTTP methods, as POST, GET, PUT, DELETE">operations</abbr>, parameters, body requests, security, etc.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  4. docs/en/docs/history-design-future.md

    Then I contributed to it, to make it fully compliant with JSON Schema, to support different ways to define constraint declarations, and to improve editor support (type checks, autocompletion) based on the tests in several editors.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  5. docs/en/docs/alternatives.md

        This actually inspired updating parts of Pydantic, to support the same validation declaration style (all this functionality is now already available in Pydantic).
    
    ### <a href="https://www.hug.rest/" class="external-link" target="_blank">Hug</a>
    
    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.
    
    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)
  6. docs/en/docs/tutorial/extra-models.md

    We could do better.
    
    We can declare a `UserBase` model that serves as a base for our other models. And then we can make subclasses of that model that inherit its attributes (type declarations, validation, etc).
    
    All the data conversion, validation, documentation, etc. will still work as normally.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  7. docs/en/docs/tutorial/body-nested-models.md

    ```Python
    my_list: list[str]
    ```
    
    In versions of Python before 3.9, it would be:
    
    ```Python
    from typing import List
    
    my_list: List[str]
    ```
    
    That's all standard Python syntax for type declarations.
    
    Use that same standard syntax for model attributes with internal types.
    
    So, in our example, we can make `tags` be specifically a "list of strings":
    
    === "Python 3.10+"
    
        ```Python hl_lines="12"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  8. docs/en/docs/python-types.md

    **FastAPI** takes advantage of these type hints to do several things.
    
    With **FastAPI** you declare parameters with type hints and you get:
    
    * **Editor support**.
    * **Type checks**.
    
    ...and **FastAPI** uses the same declarations to:
    
    * **Define requirements**: from request path parameters, query parameters, headers, bodies, dependencies, etc.
    * **Convert data**: from the request to the required type.
    * **Validate data**: coming from each request:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/index.md

    !!! note
        If you don't know, check the [Async: *"In a hurry?"*](../../async.md#in-a-hurry){.internal-link target=_blank} section about `async` and `await` in the docs.
    
    ## Integrated with OpenAPI
    
    All the request declarations, validations and requirements of your dependencies (and sub-dependencies) will be integrated in the same OpenAPI schema.
    
    So, the interactive docs will have all the information from these dependencies too:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  10. docs/fr/docs/tutorial/path-params.md

    ```
    
    !!! check "vérifier"
        Comme vous l'avez remarqué, la valeur reçue par la fonction (et renvoyée ensuite) est `3`,
        en tant qu'entier (`int`) Python, pas la chaîne de caractères (`string`) `"3"`.
    
        Grâce aux déclarations de types, **FastAPI** fournit du
        <abbr title="conversion de la chaîne de caractères venant de la requête HTTP en données Python">"parsing"</abbr> automatique.
    
    ## Validation de données
    
    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)
Back to top