- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 323 for declare (0.34 sec)
-
docs/en/docs/advanced/security/oauth2-scopes.md
/// {* ../../docs_src/security/tutorial005_an_py310.py hl[157] *} ## Declare scopes in *path operations* and dependencies { #declare-scopes-in-path-operations-and-dependencies } Now we declare that the *path operation* for `/users/me/items/` requires the scope `items`. For this, we import and use `Security` from `fastapi`.Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 10:49:48 UTC 2025 - 13.5K bytes - Viewed (0) -
docs/en/docs/tutorial/request-form-models.md
/// /// note This is supported since FastAPI version `0.113.0`. 🤓 /// ## Pydantic Models for Forms { #pydantic-models-for-forms } You just need to declare a **Pydantic model** with the fields you want to receive as **form fields**, and then declare the parameter as `Form`: {* ../../docs_src/request_form_models/tutorial001_an_py39.py hl[9:11,15] *}Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 2.2K bytes - Viewed (0) -
docs/en/docs/tutorial/path-params-numeric-validations.md
/// ## Declare metadata { #declare-metadata } You can declare all the same parameters as for `Query`. For example, to declare a `title` metadata value for the path parameter `item_id` you can type: {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[10] *}Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 6.2K bytes - Viewed (0) -
docs/en/docs/tutorial/body.md
```JSON { "name": "Foo", "price": 45.2 } ``` ## Declare it as a parameter { #declare-it-as-a-parameter } To add it to your *path operation*, declare it the same way you declared path and query parameters: {* ../../docs_src/body/tutorial001_py310.py hl[16] *} ...and declare its type as the model you created, `Item`. ## Results { #results } With just that Python type declaration, **FastAPI** will:Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 10:58:56 UTC 2025 - 7.1K bytes - Viewed (0) -
docs/en/docs/tutorial/body-fields.md
# Body - Fields { #body-fields } The same way you can declare additional validation and metadata in *path operation function* parameters with `Query`, `Path` and `Body`, you can declare validation and metadata inside of Pydantic models using Pydantic's `Field`. ## Import `Field` { #import-field } First, you have to import it: {* ../../docs_src/body_fields/tutorial001_an_py310.py hl[4] *} /// warningRegistered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 2.3K bytes - Viewed (0) -
docs/en/docs/tutorial/query-params-str-validations.md
q: Annotated[str | None, Query(min_length=3)] = None ``` //// So, when you need to declare a value as required while using `Query`, you can simply not declare a default value: {* ../../docs_src/query_params_str_validations/tutorial006_an_py39.py hl[9] *} ### Required, can be `None` { #required-can-be-none }
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 17.2K bytes - Viewed (0) -
docs/pt/docs/tutorial/cookie-params.md
## Importe `Cookie` Primeiro importe `Cookie`: {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *} ## Declare parâmetros de `Cookie` Então declare os paramêtros de cookie usando a mesma estrutura que em `Path` e `Query`. Você pode definir o valor padrão, assim como todas as validações extras ou parâmetros de anotação:Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 1.1K bytes - Viewed (0) -
docs/en/docs/tutorial/body-nested-models.md
This will make `tags` be a list, although it doesn't declare the type of the elements of the list. ## List fields with type parameter { #list-fields-with-type-parameter } But Python has a specific way to declare lists with internal types, or "type parameters": ### Import typing's `List` { #import-typings-list } In Python 3.9 and above you can use the standard `list` to declare these type annotations as we'll see below. 💡
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Sun Aug 31 09:15:41 UTC 2025 - 7.3K bytes - Viewed (0) -
docs/pt/docs/tutorial/header-params.md
## importe `Header` Primeiro importe `Header`: {* ../../docs_src/header_params/tutorial001_py310.py hl[1] *} ## Declare parâmetros de `Header` Então declare os paramêtros de cabeçalho usando a mesma estrutura que em `Path`, `Query` e `Cookie`. O primeiro valor é o valor padrão, você pode passar todas as validações adicionais ou parâmetros de anotação:Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 3.1K bytes - Viewed (0) -
docs/pt/docs/tutorial/query-param-models.md
Isso permitiria que você **reutilizasse o modelo** em **diversos lugares**, e também declarasse validações e metadados de todos os parâmetros de uma única vez. 😎 /// note | Nota Isso é suportado desde o FastAPI versão `0.115.0`. 🤓 /// ## Parâmetros de Consulta com um Modelo Pydantic
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 2.3K bytes - Viewed (0)