Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 524 for Lyding (0.16 sec)

  1. tests/test_typing_python39.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    from .utils import needs_py310
    
    
    @needs_py310
    def test_typing():
        types = {
            list[int]: [1, 2, 3],
            dict[str, list[int]]: {"a": [1, 2, 3], "b": [4, 5, 6]},
            set[int]: [1, 2, 3],  # `set` is converted to `list`
            tuple[int, ...]: [1, 2, 3],  # `tuple` is converted to `list`
        }
        for test_type, expect in types.items():
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 709 bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial012_an.py

    from typing import List
    
    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[List[str], Query()] = ["foo", "bar"]):
        query_items = {"q": q}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 262 bytes
    - Viewed (0)
  3. docs_src/query_params_str_validations/tutorial003_an.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 372 bytes
    - Viewed (0)
  4. docs_src/path_params_numeric_validations/tutorial001_an.py

    from typing import Union
    
    from fastapi import FastAPI, Path, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_items(
        item_id: Annotated[int, Path(title="The ID of the item to get")],
        q: Annotated[Union[str, None], Query(alias="item-query")] = None,
    ):
        results = {"item_id": item_id}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 417 bytes
    - Viewed (0)
  5. docs_src/schema_extra_example/tutorial004_an.py

    from typing import Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    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: Annotated[
            Item,
            Body(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jul 01 16:43:29 GMT 2023
    - 965 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial003_an.py

    from typing import Any, Union
    
    from fastapi import Depends, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
    
    
    class CommonQueryParams:
        def __init__(self, q: Union[str, None] = None, skip: int = 0, limit: int = 100):
            self.q = q
            self.skip = skip
            self.limit = limit
    
    
    @app.get("/items/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 697 bytes
    - Viewed (0)
  7. docs/uk/docs/python-types.md

    Щоб оголосити ці типи та внутрішні типи, ви можете використовувати стандартний модуль Python `typing`. Він існує спеціально для підтримки анотацій типів.
    
    #### Новіші версії Python
    
    Синтаксис із використанням `typing` **сумісний** з усіма версіями, від Python 3.6 до останніх, включаючи Python 3.9, Python 3.10 тощо.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  8. tests/test_ws_dependencies.py

    import json
    from typing import List
    
    from fastapi import APIRouter, Depends, FastAPI, WebSocket
    from fastapi.testclient import TestClient
    from typing_extensions import Annotated
    
    
    def dependency_list() -> List[str]:
        return []
    
    
    DepList = Annotated[List[str], Depends(dependency_list)]
    
    
    def create_dependency(name: str):
        def fun(deps: DepList):
            deps.append(name)
    
        return Depends(fun)
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sun Jun 11 20:35:39 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  9. fastapi/security/http.py

    import binascii
    from base64 import b64decode
    from typing import Optional
    
    from fastapi.exceptions import HTTPException
    from fastapi.openapi.models import HTTPBase as HTTPBaseModel
    from fastapi.openapi.models import HTTPBearer as HTTPBearerModel
    from fastapi.security.base import SecurityBase
    from fastapi.security.utils import get_authorization_scheme_param
    from pydantic import BaseModel
    from starlette.requests import Request
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 15:29:38 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  10. tests/test_additional_responses_response_class.py

    import typing
    
    from fastapi import FastAPI
    from fastapi.responses import JSONResponse
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class JsonApiResponse(JSONResponse):
        media_type = "application/vnd.api+json"
    
    
    class Error(BaseModel):
        status: str
        title: str
    
    
    class JsonApiError(BaseModel):
        errors: typing.List[Error]
    
    
    @app.get(
        "/a",
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.5K bytes
    - Viewed (0)
Back to top