Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 7.7K bytes
    - Viewed (0)
  2. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/path-params-numeric-validations.md

    But you can re-order them, and have the value without a default (the query parameter `q`) first.
    
    It doesn't matter for **FastAPI**. It will detect the parameters by their names, types and default declarations (`Query`, `Path`, etc), it doesn't care about the order.
    
    So, you can declare your function as:
    
    === "Python 3.8 non-Annotated"
    
        !!! tip
            Prefer to use the `Annotated` version if possible.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  4. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  6. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  7. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/sql-databases.md

        {!> ../../../docs_src/sql_databases/sql_app/schemas.py!}
        ```
    
    !!! tip
        Notice it's assigning a value with `=`, like:
    
        `orm_mode = True`
    
        It doesn't use `:` as for the type declarations before.
    
        This is setting a config value, not declaring a type.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  9. docs/en/docs/release-notes.md

        * Add support for type annotations using `Optional` as in `param: Optional[str] = None`. New documentation: [Optional type declarations](https://fastapi.tiangolo.com/tutorial/query-params/#optional-type-declarations).
        * PR [#278](https://github.com/tiangolo/fastapi/pull/278).
    
    ## 0.26.0
    
    * Separate error handling for validation errors.
    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)
  10. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
Back to top