Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 171 - 180 of 349 for unionOf (0.03 seconds)

  1. docs_src/dependencies/tutorial002_py39.py

    from typing import Union
    
    from fastapi import Depends, FastAPI
    
    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/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 656 bytes
    - Click Count (0)
  2. docs_src/dependencies/tutorial003_an_py39.py

    from typing import Annotated, Any, Union
    
    from fastapi import Depends, FastAPI
    
    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/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 668 bytes
    - Click Count (0)
  3. docs_src/extra_models/tutorial003_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class BaseItem(BaseModel):
        description: str
        type: str
    
    
    class CarItem(BaseItem):
        type: str = "car"
    
    
    class PlaneItem(BaseItem):
        type: str = "plane"
        size: int
    
    
    items = {
        "item1": {"description": "All my friends drive a low rider", "type": "car"},
        "item2": {
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 644 bytes
    - Click Count (0)
  4. scripts/people.py

        github_repository: str
        httpx_timeout: int = 30
        sleep_interval: int = 5
    
    
    def get_graphql_response(
        *,
        settings: Settings,
        query: str,
        after: Union[str, None] = None,
        category_id: Union[str, None] = None,
    ) -> dict[str, Any]:
        headers = {"Authorization": f"token {settings.github_token.get_secret_value()}"}
        variables = {"after": after, "category_id": category_id}
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 12.3K bytes
    - Click Count (0)
  5. docs_src/additional_responses/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.responses import FileResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    responses = {
        404: {"description": "Item not found"},
        302: {"description": "The item was moved"},
        403: {"description": "Not enough privileges"},
    }
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 701 bytes
    - Click Count (0)
  6. docs_src/python_types/tutorial009b_py39.py

    from typing import Union
    
    
    def say_hi(name: Union[str, None] = None):
        if name is not None:
            print(f"Hey {name}!")
        else:
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 164 bytes
    - Click Count (0)
  7. docs_src/cookie_params/tutorial001_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Cookie, FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(ads_id: Annotated[Union[str, None], Cookie()] = None):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 218 bytes
    - Click Count (0)
  8. docs_src/header_params/tutorial001_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(user_agent: Annotated[Union[str, None], Header()] = None):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 230 bytes
    - Click Count (0)
  9. docs_src/header_params/tutorial002_py39.py

    from typing import Union
    
    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        strange_header: Union[str, None] = Header(default=None, convert_underscores=False),
    ):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 260 bytes
    - Click Count (0)
  10. docs_src/query_params_str_validations/tutorial011_py39.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Union[list[str], None] = Query(default=None)):
        query_items = {"q": q}
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 221 bytes
    - Click Count (0)
Back to Top