Search Options

Results per page
Sort
Preferred Languages
Advance

Results 271 - 280 of 1,976 for Fastapi (0.08 sec)

  1. tests/test_additional_responses_custom_model_in_callback.py

    from dirty_equals import IsDict
    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, HttpUrl
    from starlette.responses import JSONResponse
    
    
    class CustomModel(BaseModel):
        a: int
    
    
    app = FastAPI()
    
    callback_router = APIRouter(default_response_class=JSONResponse)
    
    
    @callback_router.get(
        "{$callback_url}/callback/", responses={400: {"model": CustomModel}}
    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  2. .github/DISCUSSION_TEMPLATE/questions.yml

      - type: input
        id: fastapi-version
        attributes:
          label: FastAPI Version
          description: |
            What FastAPI version are you using?
    
            You can find the FastAPI version with:
    
            ```bash
            python -c "import fastapi; print(fastapi.__version__)"
            ```
        validations:
          required: true
      - type: input
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 03 15:59:41 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  3. docs_src/encoder/tutorial001.py

    from datetime import datetime
    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.encoders import jsonable_encoder
    from pydantic import BaseModel
    
    fake_db = {}
    
    
    class Item(BaseModel):
        title: str
        timestamp: datetime
        description: Union[str, None] = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{id}")
    def update_item(id: str, item: Item):
        json_compatible_item_data = jsonable_encoder(item)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 461 bytes
    - Viewed (0)
  4. docs/pt/docs/tutorial/request-files.md

    Quando você usa os métodos `async`, o **FastAPI** executa os métodos de arquivo em um threadpool e aguarda por eles.
    
    ///
    
    /// note | "Detalhes Técnicos do Starlette"
    
    O `UploadFile` do ***FastAPI** herda diretamente do `UploadFile` do **Starlette** , mas adiciona algumas partes necessárias para torná-lo compatível com o **Pydantic** e as outras partes do FastAPI.
    
    ///
    
    ## O que é "Form Data"
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 30 19:52:32 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  5. tests/test_forms_from_non_typing_sequences.py

    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.post("/form/python-list")
    def post_form_param_list(items: list = Form()):
        return items
    
    
    @app.post("/form/python-set")
    def post_form_param_set(items: set = Form()):
        return items
    
    
    @app.post("/form/python-tuple")
    def post_form_param_tuple(items: tuple = Form()):
        return items
    
    
    client = TestClient(app)
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/body-multiple-params.md

    Например, расширяя предыдущую модель, вы можете решить, что вам нужен еще один ключ `importance` в том же теле запроса, помимо параметров `item` и `user`.
    
    Если вы объявите его без указания, какой именно объект (Path, Query, Body и .т.п.) ожидаете, то, поскольку это является простым типом данных, **FastAPI** будет считать, что это query-параметр.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  7. docs_src/schema_extra_example/tutorial005.py

    from typing import Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  8. tests/test_validate_response.py

    from typing import List, Optional, Union
    
    import pytest
    from fastapi import FastAPI
    from fastapi.exceptions import ResponseValidationError
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: Optional[float] = None
        owner_ids: Optional[List[int]] = None
    
    
    @app.get("/items/invalid", response_model=Item)
    def get_invalid():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 2K bytes
    - Viewed (0)
  9. docs/uk/docs/tutorial/index.md

    Використання його у своєму редакторі – це те, що дійсно показує вам переваги FastAPI, бачите, як мало коду вам потрібно написати, всі перевірки типів, автозаповнення тощо.
    
    ---
    
    ## Встановлення FastAPI
    
    Першим кроком є встановлення FastAPI.
    
    Для туторіалу ви можете встановити його з усіма необов’язковими залежностями та функціями:
    
    <div class="termy">
    
    ```console
    $ pip install "fastapi[all]"
    
    ---> 100%
    ```
    
    </div>
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  10. tests/test_compat.py

    from typing import Any, Dict, List, Union
    
    from fastapi import FastAPI, UploadFile
    from fastapi._compat import (
        ModelField,
        Undefined,
        _get_model_config,
        get_cached_model_fields,
        get_model_fields,
        is_bytes_sequence_annotation,
        is_scalar_field,
        is_uploadfile_sequence_annotation,
    )
    from fastapi.testclient import TestClient
    from pydantic import BaseConfig, BaseModel, ConfigDict
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Sep 11 07:45:30 UTC 2024
    - 3.5K bytes
    - Viewed (0)
Back to top